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


PHP Module::validateConfig方法代码示例

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


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

示例1: validateConfig

 /**
  * Provide and override for the config settings and allow custom settings depending on the service being used.
  */
 protected function validateConfig()
 {
     $this->IMDriver = $this->createIMDriver();
     $this->requiredFields = $this->IMDriver->getRequiredConfig();
     $this->config = array_merge($this->IMDriver->getDefaultConfig(), $this->config);
     parent::validateConfig();
 }
开发者ID:nathanmac,项目名称:im-codeception-module,代码行数:10,代码来源:IM.php

示例2: validateConfig

 /**
  * Ensure the class specified is valid.
  *
  * @see \Codeception\Module::validateConfig()
  * @throws \Codeception\Exception\ModuleConfig
  */
 protected function validateConfig()
 {
     parent::validateConfig();
     $class = $this->config['class'];
     if (!class_exists($class)) {
         throw new \Codeception\Exception\ModuleConfig("DrupalVariable", "Invalid config. Class '{$class}' does not exist");
     }
     $interface = "Codeception\\Module\\Drupal\\Variable\\VariableStorage\\StorageInterface";
     if (!in_array($interface, class_implements($class))) {
         throw new \Codeception\Exception\ModuleConfig("DrupalVariable", "Invalid config. Class '{$class}' must implement '{$interface}'");
     }
 }
开发者ID:ixis,项目名称:codeception-drupal-variable,代码行数:18,代码来源:DrupalVariable.php

示例3: validateConfig

 /**
  * Provide and override for the config settings and allow custom settings depending on the service being used.
  */
 protected function validateConfig()
 {
     // Customisable requirement fields depending on the queue type selected. (aws_sqs, iron_mq, beanstalkq)
     switch (strtolower($this->config['type'])) {
         case 'aws':
         case 'sqs':
         case 'aws_sqs':
             $this->requiredFields = array('key', 'secret', 'region');
             break;
         case 'iron':
         case 'iron_mq':
             $this->requiredFields = array('host', 'token', 'project');
             break;
         default:
             $this->requiredFields = array('host');
             $this->config = array_merge(array('port' => 11300, 'timeout' => 90), $this->config);
     }
     parent::validateConfig();
 }
开发者ID:Eli-TW,项目名称:Codeception,代码行数:22,代码来源:Queue.php

示例4: validateConfig

 /**
  * @inheritdoc
  */
 protected function validateConfig()
 {
     parent::validateConfig();
     // If windows, certain chars cannot be passed safely as
     // an argument.
     // See escapeshellarg().
     // See https://github.com/ixis/codeception-module-drupal-user-registry/issues/13
     if (!$this->isWindows()) {
         return;
     }
     $chars = array('!', '%', '"');
     $values = array();
     foreach ($this->config['users'] as $user) {
         foreach ($user as $key => $value) {
             switch ($key) {
                 // We don't need to validate root, a boolean value.
                 case 'root':
                     continue;
                     // roles should be an non-associative array of role name values.
                 // roles should be an non-associative array of role name values.
                 case 'roles':
                     $values = array_merge($values, $value);
                     break;
                     // All other values should be validated.
                 // All other values should be validated.
                 default:
                     $values[] = $value;
             }
         }
     }
     // If the defaultPass key is set, validate this too.
     if (isset($this->config['defaultPass'])) {
         $values = array_merge(array($this->config['defaultPass']), $values);
     }
     foreach ($values as $value) {
         $present = array_filter($chars, function ($char) use($value) {
             return strpos($value, $char) !== false;
         });
         if (!empty($present)) {
             throw new Exception\ModuleConfig(get_class($this), sprintf("\nOn windows, the characters %s cannot be used for %s\n\n", implode(", ", $chars), implode(", ", array("roles", "password"))));
         }
     }
 }
开发者ID:ixis,项目名称:codeception-module-drupal-user-registry,代码行数:46,代码来源:DrupalUserRegistry.php


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