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)]); }
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']); } }