catchAdmin/catch/domain/DomainService.php

54 lines
1.8 KiB
PHP
Raw Normal View History

2020-09-26 15:10:41 +08:00
<?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;
2020-09-28 09:55:30 +08:00
use catchAdmin\domain\support\contract\DomainRecordInterface;
2020-09-26 15:10:41 +08:00
use catchAdmin\domain\support\driver\aliyun\Domain;
2020-09-28 09:55:30 +08:00
use catchAdmin\domain\support\driver\aliyun\DomainRecord;
2020-09-26 15:10:41 +08:00
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';
}
2020-09-28 09:55:30 +08:00
/**
* @return string
*/
2020-09-26 15:10:41 +08:00
public function loadRouteFrom()
{
// TODO: Implement loadRouteFrom() method.
return __DIR__ . DIRECTORY_SEPARATOR . 'route.php';
}
2020-09-28 09:55:30 +08:00
/**
*
*/
2020-09-26 15:10:41 +08:00
protected function registerInstance()
{
$default = config('catch.domains.default');
2020-09-28 09:55:30 +08:00
$this->app->instance(DomainActionInterface::class, $this->app->make(__NAMESPACE__ . '\\support\\driver\\' . $default . '\Domain'));
$this->app->instance(DomainRecordInterface::class, $this->app->make(__NAMESPACE__ . '\\support\\driver\\' . $default . '\DomainRecord'));
2020-09-26 15:10:41 +08:00
}
}