/** * * @param string $status * @global array $databaseConfig */ protected function updateStatus($status) { global $databaseConfig; DB::connect($databaseConfig); $record = DNCreateEnvironment::get()->byID($this->args['createID']); $record->Status = $status; $record->write(); }
public function createenvlog(SS_HTTPRequest $request) { $this->setCurrentActionType(self::ACTION_SNAPSHOT); $params = $request->params(); $env = DNCreateEnvironment::get()->byId($params['Identifier']); if (!$env || !$env->ID) { throw new SS_HTTPResponse_Exception('Log not found', 404); } if (!$env->canView()) { return Security::permissionFailure(); } $project = $env->Project(); if ($project->Name != $params['Project']) { throw new LogicException("Project in URL doesn't match this deploy"); } $log = $env->log(); if ($log->exists()) { $content = $log->content(); } else { $content = 'Waiting for action to start'; } return $this->sendResponse($env->ResqueStatus(), $content); }