コード例 #1
0
ファイル: ServiceController.php プロジェクト: alfhan/plansys
 public function actionUpdate($id = null)
 {
     $model = DevServiceForm::load($id);
     if (!$model) {
         throw new CHttpException(404);
     }
     Asset::registerJS('application.static.js.lib.ace');
     $instances = ServiceManager::getRunningInstance($id);
     $this->renderForm('DevServiceForm', $model, ['isRunning' => count($instances) > 0, 'instances' => $instances, 'log' => ServiceManager::readLog($id)]);
 }
コード例 #2
0
ファイル: ServiceManager.php プロジェクト: rizabudi/plansys
 public static function kill($name)
 {
     $result = ServiceManager::getRunningInstance($name);
     foreach ($result as $r) {
         ServiceManager::log($name, $r['id'], "SERVICE: " . str_pad("Killing instance #{$r['id']}", 45, "."));
         ServiceManager::process("kill {$r['pid']}");
         ServiceManager::logAppend($name, $r['id'], "[OK]");
         ServiceManager::markAsStopped($name, $r['id']);
     }
 }