get('schema'))->execute(); } } /** * Activate after install. * * @param DatabasePool $dbPool Database instance * @param ModuleInfo $info Module info * * @return void * * @since 1.0.0 */ protected static function activate(DatabasePool $dbPool, ModuleInfo $info) : void { if (($path = \realpath(static::PATH)) === false) { return; // @codeCoverageIgnore } $classPath = \substr($path . '/Status', (int) \strlen((string) \realpath(__DIR__ . '/../../'))); /** @var class-string $class */ $class = \str_replace('/', '\\', $classPath); if (!Autoloader::exists($class)) { throw new \UnexpectedValueException($class); // @codeCoverageIgnore } $class::activate($dbPool, $info); } /** * Re-init module. * * @param ModuleInfo $info Module info * @param null|ApplicationInfo $appInfo Application info * * @return void * * @since 1.0.0 */ public static function reInit(ModuleInfo $info, ApplicationInfo $appInfo = null) : void { if (($path = \realpath(static::PATH)) === false) { return; // @codeCoverageIgnore } $classPath = \substr($path . '/Status', \strlen((string) \realpath(__DIR__ . '/../../'))); /** @var class-string $class */ $class = \str_replace('/', '\\', $classPath); if (!Autoloader::exists($class)) { throw new \UnexpectedValueException($class); // @codeCoverageIgnore } $class::activateRoutes($info, $appInfo); $class::activateHooks($info, $appInfo); } }