当前位置: 首页>>代码示例>>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;未经允许,请勿转载。