add:域名管理first commit
This commit is contained in:
50
catch/domain/DomainService.php
Normal file
50
catch/domain/DomainService.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CatchAdmin [Just Like ~ ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: JaguarJack [ njphper@gmail.com ]
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace catchAdmin\domain;
|
||||
|
||||
use catchAdmin\domain\support\contract\DomainActionInterface;
|
||||
use catchAdmin\domain\support\driver\aliyun\Domain;
|
||||
use catcher\ModuleService;
|
||||
|
||||
class DomainService extends ModuleService
|
||||
{
|
||||
public function register()
|
||||
{
|
||||
parent::register(); // TODO: Change the autogenerated stub
|
||||
|
||||
$this->registerInstance();
|
||||
}
|
||||
|
||||
public function loadConfig()
|
||||
{
|
||||
return require __DIR__ . DIRECTORY_SEPARATOR . 'config.php';
|
||||
}
|
||||
|
||||
public function loadRouteFrom()
|
||||
{
|
||||
// TODO: Implement loadRouteFrom() method.
|
||||
return __DIR__ . DIRECTORY_SEPARATOR . 'route.php';
|
||||
}
|
||||
|
||||
protected function registerInstance()
|
||||
{
|
||||
$default = config('catch.domains.default');
|
||||
|
||||
switch ($default) {
|
||||
case 'aliyun':
|
||||
$this->app->instance(DomainActionInterface::class, new Domain);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user