예제 #1
0
 protected function installUpdate()
 {
     $scriptFilePath = __DIR__ . '/Scripts/InstallScript.php';
     if (file_exists($scriptFilePath)) {
         include $scriptFilePath;
         $updater = new \InstallScript($this->kernel);
         $updater->execute();
     }
     $this->initBlock();
 }
예제 #2
0
 private function executeInstall($pluginDir)
 {
     $installFile = $pluginDir . '/Scripts/InstallScript.php';
     if (file_exists($installFile)) {
         include $installFile;
         if (!class_exists('InstallScript')) {
             throw new \RuntimeException("插件脚本{$installFile}中,不存在InstallScript类。");
         }
         $installer = new \InstallScript(ServiceKernel::instance());
         $installer->setInstallMode('command');
         $installer->execute();
     }
 }