當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OperationCommand::process方法代碼示例

本文整理匯總了PHP中Guzzle\Service\Command\OperationCommand::process方法的典型用法代碼示例。如果您正苦於以下問題:PHP OperationCommand::process方法的具體用法?PHP OperationCommand::process怎麽用?PHP OperationCommand::process使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Guzzle\Service\Command\OperationCommand的用法示例。


在下文中一共展示了OperationCommand::process方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: process

 /**
  * Validate response model after processing
  * @throws ValidationException
  * @override
  */
 protected function process()
 {
     parent::process();
     if ($this[AbstractCommand::DISABLE_VALIDATION]) {
         // skipping validation in all cases
         return;
     }
     if (!$this->result instanceof Model) {
         // result is not a model - no way to validate
         return;
     }
     $errors = array();
     $validator = SchemaValidator::getInstance();
     // validate parameters present
     $schema = $this->result->getStructure();
     $value = $this->result->toArray();
     if (!$validator->validate($schema, $value)) {
         $errors = $validator->getErrors();
     }
     // @todo validate additional parameters?
     // $schema->getAdditionalProperties() );
     if ($errors) {
         $e = new ValidationException('Response failed model validation: ' . implode("\n", $errors));
         $e->setErrors($errors);
         throw $e;
     }
 }
開發者ID:rodsouto,項目名稱:swizzle,代碼行數:32,代碼來源:StrictCommand.php

示例2: process

 /**
  * {@inheritdoc}
  */
 protected function process()
 {
     parent::process();
     // Set the GetObject URL if using the PutObject operation
     if ($this->result instanceof Model && $this->getName() == 'PutObject') {
         $this->result->set('ObjectURL', $this->getRequest()->getUrl());
     }
 }
開發者ID:cstuder,項目名稱:nagios-plugins,代碼行數:11,代碼來源:S3Command.php

示例3: process

 protected function process()
 {
     parent::process();
     $response = $this->request->getResponse();
     $links = [];
     if ($response->hasHeader('Link')) {
         $linkParser = new LinkParser();
         $links = $linkParser->parseLinkHeader($response->getHeader('Link'));
     }
     $this->result = new Collection($this->result, $links, $this->getClient());
 }
開發者ID:smaft-sarl,項目名稱:okta-php-sdk,代碼行數:11,代碼來源:ListUserCommand.php

示例4: process

 /**
  * {@inheritdoc}
  */
 protected function process()
 {
     $request = $this->getRequest();
     $response = $this->getResponse();
     // Dispatch an error if a 301 redirect occurred
     if ($response->getStatusCode() == 301) {
         $this->getClient()->getEventDispatcher()->dispatch('request.error', new Event(array('request' => $this->getRequest(), 'response' => $response)));
     }
     parent::process();
     // Set the GetObject URL if using the PutObject operation
     if ($this->result instanceof Model && $this->getName() == 'PutObject') {
         $this->result->set('ObjectURL', $request->getUrl());
     }
 }
開發者ID:omusico,項目名稱:isle-web-framework,代碼行數:17,代碼來源:S3Command.php

示例5: process

 /**
  * {@inheritdoc}
  */
 protected function process()
 {
     $request = $this->getRequest();
     $response = $this->getResponse();
     // Dispatch an error if a 301 redirect occurred
     if ($response->getStatusCode() == 301) {
         $this->getClient()->getEventDispatcher()->dispatch('request.error', new Event(array('request' => $this->getRequest(), 'response' => $response)));
     }
     parent::process();
     // Set the GetObject URL if using the PutObject operation
     if ($this->result instanceof Model && $this->getName() == 'PutObject') {
         $this->result->set('ObjectURL', $request->getUrl());
     }
     if ($this->result instanceof Model && $this->getName() == 'GetObject') {
         $npos = strpos($response, "\n\r");
         $head = substr($response, 0, $npos);
         COMMONLOG(DEBUG, "receive head:%s", $head);
     } else {
         COMMONLOG(DEBUG, "receive msg:%s", $response);
     }
     COMMONLOG(INFO, "http request:status:%d, code:, message:", $response->getStatusCode());
 }
開發者ID:eSDK,項目名稱:esdk_obs_native_php,代碼行數:25,代碼來源:S3Command.php

示例6: process

 protected function process()
 {
     parent::process();
 }
開發者ID:matmar10,項目名稱:campbx,代碼行數:4,代碼來源:AuthenticatedCommand.php


注:本文中的Guzzle\Service\Command\OperationCommand::process方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。