コード例 #1
0
 /**
  * Returns response if the action finished as expected
  * @param AbstractActionController $controller
  * @param array $params
  */
 public function onWaitInstall($controller, $params)
 {
     $appId = $params['appId'];
     $response = $controller->forward()->dispatch('webapi-api-controller', array('action' => 'applicationGetStatus', 'applications' => array($appId)));
     $xml = new \SimpleXMLElement($response->getBody());
     $status = (string) $xml->responseData->applicationsList->applicationInfo->status;
     if (stripos($status, 'error') !== false) {
         throw new \Exception(sprintf("Got error '%s' during deployment.\nThe following error message is reported from the server:\n%s", $status, $xml->responseData->applicationsList->applicationInfo->messageList->error));
     }
     if ($status != 'deployed') {
         return;
     }
     return $response;
 }