本文整理汇总了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;
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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;
}
示例6: __call
/**
* {@inheritdoc}
*/
public function __call($method, $args = null)
{
return parent::__call(ucfirst($method), $args);
}
示例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;
}
}
示例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);
}
示例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);
}