|
|
@@ -22,6 +22,7 @@ abstract class ExtensionAbstract implements ExtensionInterface
|
|
|
/**
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
+ #[\Override]
|
|
|
public function getInfo(): array
|
|
|
{
|
|
|
if (empty($this->info)) {
|
|
|
@@ -44,6 +45,7 @@ abstract class ExtensionAbstract implements ExtensionInterface
|
|
|
|
|
|
abstract protected function getBaseDir(): string;
|
|
|
|
|
|
+ #[\Override]
|
|
|
public function getConfig(): array
|
|
|
{
|
|
|
if (!file_exists($this->getBaseDir() . '/config.php')) {
|
|
|
@@ -52,14 +54,17 @@ abstract class ExtensionAbstract implements ExtensionInterface
|
|
|
return require $this->getBaseDir() . '/config.php';
|
|
|
}
|
|
|
|
|
|
+ #[\Override]
|
|
|
public function install(): void
|
|
|
{
|
|
|
}
|
|
|
|
|
|
+ #[\Override]
|
|
|
public function uninstall(): void
|
|
|
{
|
|
|
}
|
|
|
|
|
|
+ #[\Override]
|
|
|
public function getCommands(): array
|
|
|
{
|
|
|
if (!file_exists($this->getBaseDir() . '/command.php')) {
|
|
|
@@ -68,15 +73,23 @@ abstract class ExtensionAbstract implements ExtensionInterface
|
|
|
return require $this->getBaseDir() . '/command.php';
|
|
|
}
|
|
|
|
|
|
+ #[\Override]
|
|
|
public function getHooks(): array
|
|
|
{
|
|
|
return [];
|
|
|
}
|
|
|
|
|
|
+ #[\Override]
|
|
|
+ public function getSubscribes(): array
|
|
|
+ {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取路由
|
|
|
* @return array<string, string>
|
|
|
*/
|
|
|
+ #[\Override]
|
|
|
public function getRoutes(): array
|
|
|
{
|
|
|
$adminRoute = $this->getBaseDir() . '/route/admin.php';
|
|
|
@@ -91,11 +104,13 @@ abstract class ExtensionAbstract implements ExtensionInterface
|
|
|
return $routes;
|
|
|
}
|
|
|
|
|
|
+ #[\Override]
|
|
|
public function getCronJobs(): array
|
|
|
{
|
|
|
return [];
|
|
|
}
|
|
|
|
|
|
+ #[\Override]
|
|
|
public function boot(): void
|
|
|
{
|
|
|
$this->isBooted = true;
|