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


PHP CommandInterface::getName方法代码示例

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


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

示例1: visit

 public function visit(CommandInterface $command, RequestInterface $request, Parameter $param, $value)
 {
     $this->fqname = $command->getName();
     $query = array();
     $this->customResolver($value, $param, $query, $param->getWireName());
     $request->addPostFields($query);
 }
开发者ID:loulancn,项目名称:core,代码行数:7,代码来源:AwsQueryVisitor.php

示例2: hook_amazons3_command_alter

/**
 * Allows modules to alter an S3 command after it has been created.
 *
 * @param \Guzzle\Service\Command\CommandInterface $command
 *   The command that was created.
 */
function hook_amazons3_command_alter(\Guzzle\Service\Command\CommandInterface $command)
{
    if ($command->getName('HeadObject')) {
        $command->setOnComplete(function () {
            watchdog('amazons3', 'HeadObject was called.');
        });
    }
}
开发者ID:vuhoanglinh2002,项目名称:drupal,代码行数:14,代码来源:amazons3.api.php

示例3: build

 /**
  * Create a resource iterator
  *
  * @param CommandInterface $data    Command used for building the iterator
  * @param array            $options Iterator options.
  *
  * @return ResourceIteratorInterface
  */
 public function build($data, array $options = null)
 {
     if (!$data instanceof CommandInterface) {
         throw new InvalidArgumentException('The first argument must be an ' . 'instance of CommandInterface');
     }
     // Determine the name of the class to load
     $className = $this->baseNamespace . '\\' . Inflector::camel($data->getName()) . 'Iterator';
     return new $className($data, $options);
 }
开发者ID:norv,项目名称:guzzle,代码行数:17,代码来源:ResourceIteratorClassFactory.php

示例4: getClassName

 /**
  * {@inheritdoc}
  */
 protected function getClassName(CommandInterface $command)
 {
     // If it's a ListWidgets command, we can iterate over it
     if (preg_match('/^List[A-Za-z]+/', $command->getName())) {
         return $this->iteratorClassName;
     }
     // Otherwise, we don't know how to iterate over that command
     return null;
 }
开发者ID:dh-open,项目名称:desk-php,代码行数:12,代码来源:Factory.php

示例5: getClassName

 public function getClassName(CommandInterface $command)
 {
     $className = $command->getName();
     if (isset($this->map[$className])) {
         return $this->map[$className];
     } elseif (isset($this->map['*'])) {
         return $this->map['*'];
     }
     return null;
 }
开发者ID:Ryu0621,项目名称:SaNaVi,代码行数:10,代码来源:MapResourceIteratorFactory.php

示例6: getClassName

 protected function getClassName(CommandInterface $command)
 {
     $iteratorName = $this->inflector->camel($command->getName()) . 'Iterator';
     foreach ($this->namespaces as $namespace) {
         $potentialClassName = $namespace . '\\' . $iteratorName;
         if (class_exists($potentialClassName)) {
             return $potentialClassName;
         }
     }
     return false;
 }
开发者ID:Ryu0621,项目名称:SaNaVi,代码行数:11,代码来源:ResourceIteratorClassFactory.php

示例7: build

 /**
  * {@inheritdoc}
  */
 public function build(CommandInterface $command, array $options = array())
 {
     // Get the configuration data for the command
     $commandName = $command->getName();
     $iteratorConfig = $this->operations->get($commandName) ?: array();
     $options = array_replace($this->config->getAll(), $iteratorConfig, $options);
     // Instantiate the iterator using the primary factory (if there is one)
     if ($this->primaryIteratorFactory && $this->primaryIteratorFactory->canBuild($command)) {
         $iterator = $this->primaryIteratorFactory->build($command, $options);
     } elseif (!$this->operations->hasKey($commandName)) {
         throw new InvalidArgumentException("Iterator was not found for {$commandName}.");
     } else {
         // Fallback to this factory for creating the iterator if the primary factory did not work
         $iterator = new AwsResourceIterator($command, $options);
     }
     return $iterator;
 }
开发者ID:cstuder,项目名称:nagios-plugins,代码行数:20,代码来源:AwsResourceIteratorFactory.php

示例8: build

 public function build(CommandInterface $command, array $options = array())
 {
     // Get the configuration data for the command
     $commandName = $command->getName();
     $commandSupported = isset($this->config[$commandName]);
     $options = $this->translateLegacyConfigOptions($options);
     $options += $commandSupported ? $this->config[$commandName] : array();
     // Instantiate the iterator using the primary factory (if one was provided)
     if ($this->primaryIteratorFactory && $this->primaryIteratorFactory->canBuild($command)) {
         $iterator = $this->primaryIteratorFactory->build($command, $options);
     } elseif (!$commandSupported) {
         throw new InvalidArgumentException("Iterator was not found for {$commandName}.");
     } else {
         // Instantiate a generic AWS resource iterator
         $iterator = new MssResourceIterator($command, $options);
     }
     return $iterator;
 }
开发者ID:ChengHuaUESTC,项目名称:mssapi_php,代码行数:18,代码来源:MssResourceIteratorFactory.php

示例9: build

 /**
  * Create a resource iterator
  *
  * @param CommandInterface $data    Command used for building the iterator
  * @param array            $options Iterator options that are exposed as data.
  *
  * @return ResourceIteratorInterface
  */
 public function build($data, array $options = array())
 {
     if (!$data instanceof CommandInterface) {
         throw new InvalidArgumentException('The first argument must be an instance of CommandInterface');
     }
     $iteratorName = $this->inflector->camel($data->getName()) . 'Iterator';
     // Determine the name of the class to load
     $className = null;
     foreach ($this->namespaces as $namespace) {
         $potentialClassName = $namespace . '\\' . $iteratorName;
         if (class_exists($potentialClassName)) {
             $className = $potentialClassName;
             break;
         }
     }
     if (!$className) {
         throw new InvalidArgumentException("Iterator was not found matching {$iteratorName}");
     }
     return new $className($data, $options);
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:28,代码来源:ResourceIteratorClassFactory.php

示例10: getClassName

 protected function getClassName(CommandInterface $command)
 {
     $iteratorName = $this->inflector->camel($command->getName()) . 'Iterator';
     $iteratorSpecified = $command->getOperation()->getData('iteratorClass');
     // @TODO fix this near duplication
     if (!is_null($iteratorSpecified)) {
         foreach ($this->namespaces as $namespace) {
             $potentialClassName = $namespace . '\\' . $iteratorSpecified;
             if (class_exists($potentialClassName)) {
                 return $potentialClassName;
             }
         }
     }
     foreach ($this->namespaces as $namespace) {
         $potentialClassName = $namespace . '\\' . $iteratorName;
         if (class_exists($potentialClassName)) {
             return $potentialClassName;
         }
     }
     return false;
 }
开发者ID:jyokum,项目名称:healthgraph,代码行数:21,代码来源:HealthGraphIteratorFactory.php


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