当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::__call方法代码示例

本文整理汇总了PHP中Guzzle\Service\Client::__call方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::__call方法的具体用法?PHP Client::__call怎么用?PHP Client::__call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Guzzle\Service\Client的用法示例。


在下文中一共展示了Client::__call方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __call

 /**
  * Shortcut for executing Commands in the Definitions.
  *
  * @param string $method
  * @param array|null $args
  *
  * @return mixed|void
  *
  */
 public function __call($method, $args = null)
 {
     $commandName = ucfirst($method);
     $result = parent::__call($commandName, $args);
     // Remove data field
     if (is_array($result) && isset($result['data'])) {
         return $result['data'];
     }
     return $result;
 }
开发者ID:jamosaur,项目名称:guzzle-toggl,代码行数:19,代码来源:TogglClient.php

示例2: __call

 /**
  * {@inheritdoc}
  */
 public function __call($method, $args = null)
 {
     if (substr($method, 0, 9) == 'waitUntil') {
         // Allow magic method calls for waiters (e.g. $client->waitUntil<WaiterName>($resource, $options))
         array_unshift($args, substr($method, 9));
         return call_user_func_array(array($this, 'waitUntil'), $args);
     } else {
         return parent::__call(ucfirst($method), $args);
     }
 }
开发者ID:noahkim,项目名称:kowop,代码行数:13,代码来源:AbstractClient.php

示例3: __call

 /**
  * {@inheritdoc}
  */
 public function __call($method, $args = [])
 {
     if (substr($method, -8) === 'Iterator') {
         // Allow magic method calls for iterators (e.g. $client-><CommandName>Iterator($params))
         $commandOptions = isset($args[0]) ? $args[0] : [];
         $iteratorOptions = isset($args[1]) ? $args[1] : [];
         $command = $this->getCommand(substr($method, 0, -8), $commandOptions);
         return new StripeCommandsCursorIterator($command, $iteratorOptions);
     }
     return parent::__call(ucfirst($method), $args);
 }
开发者ID:netglue,项目名称:zfr-stripe,代码行数:14,代码来源:StripeClient.php

示例4: __call

 public function __call($method, $args)
 {
     if (substr($method, 0, 3) === 'get' && substr($method, -8) === 'Iterator') {
         // Allow magic method calls for iterators (e.g. $client->get<CommandName>Iterator($params))
         $commandOptions = isset($args[0]) ? $args[0] : null;
         $iteratorOptions = isset($args[1]) ? $args[1] : array();
         return $this->getIterator(substr($method, 3, -8), $commandOptions, $iteratorOptions);
     } elseif (substr($method, 0, 9) == 'waitUntil') {
         // Allow magic method calls for waiters (e.g. $client->waitUntil<WaiterName>($params))
         return $this->waitUntil(substr($method, 9), isset($args[0]) ? $args[0] : array());
     } else {
         return parent::__call(ucfirst($method), $args);
     }
 }
开发者ID:risyasin,项目名称:webpagetest,代码行数:14,代码来源:AbstractClient.php

示例5: __call

 /**
  * Shortcut for executing Commands in the Definitions.
  *
  * @param string $method
  * @param array|null $args
  *
  * @return mixed|void
  *
  */
 public function __call($method, $args = null)
 {
     $commandName = ucfirst($method);
     $result = parent::__call($commandName, $args);
     return $result;
 }
开发者ID:jamosaur,项目名称:guzzle-toggl,代码行数:15,代码来源:ReportsClient.php

示例6: __call

 /**
  * {@inheritdoc}
  */
 public function __call($method, $args = null)
 {
     return parent::__call(ucfirst($method), $args);
 }
开发者ID:romainneutron,项目名称:aws-sdk-php,代码行数:7,代码来源:AbstractClient.php

示例7: __call

 public function __call($method, $args)
 {
     COMMONLOG(INFO, "enter %s ...", $method);
     $args = $this->setArgs($method, $args);
     if (substr($method, 0, 3) === 'get' && substr($method, -8) === 'Iterator') {
         // Allow magic method calls for iterators (e.g. $client->get<CommandName>Iterator($params))
         $commandOptions = isset($args[0]) ? $args[0] : null;
         $iteratorOptions = isset($args[1]) ? $args[1] : array();
         return $this->getIterator(substr($method, 3, -8), $commandOptions, $iteratorOptions);
     } elseif (substr($method, 0, 9) == 'waitUntil') {
         // Allow magic method calls for waiters (e.g. $client->waitUntil<WaiterName>($params))
         return $this->waitUntil(substr($method, 9), isset($args[0]) ? $args[0] : array());
     } else {
         try {
             if ($this->checkTransFile($method, $args)) {
                 if (ucfirst($method) === 'PutObject') {
                     $arr = $args;
                     unset($arr[0]['Bucket']);
                     unset($arr[0]['Key']);
                     unset($arr[0]['ACL']);
                     unset($arr[0]['SourceFile']);
                     $fp = fopen($args[0]['SourceFile'], 'rb');
                     return $this->upload($args[0]['Bucket'], $args[0]['Key'], $fp, $args[0]['ACL'], $arr);
                 }
                 $this->mkTempFile($args);
                 return $this->TransFile($method, $args);
             } else {
                 $ret = parent::__call(ucfirst($method), $args);
             }
         } catch (S3Exception $e) {
             throw $e;
         }
         if ("GetObject" === ucfirst($method)) {
             $this->WriteFile($ret, $args);
         }
         return $ret;
     }
 }
开发者ID:eSDK,项目名称:esdk_obs_native_php,代码行数:38,代码来源:AbstractClient.php

示例8: __call

 /**
  * Shortcut for executing Commands in the Definitions.
  *
  * @param string $method
  * @param array $args
  *
  * @return mixed|void
  *
  */
 public function __call($method, $args)
 {
     $commandName = ucfirst($method);
     return parent::__call($commandName, $args);
 }
开发者ID:opdavies,项目名称:nwdrupalwebsite,代码行数:14,代码来源:AbstractMeetupClient.php

示例9: callParent

 /**
  * Exists solely to allow unit testing of the __call function above
  *
  * @param string $method
  * @param array $args
  * @return mixed
  */
 public function callParent($method, $args)
 {
     return parent::__call($method, $args);
 }
开发者ID:balihoo,项目名称:publish-service-client,代码行数:11,代码来源:Client.php


注:本文中的Guzzle\Service\Client::__call方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。