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


PHP Requirement::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Constructor that initializes the requirement.
  *
  * @param bool           $fulfilled   Whether the requirement is fulfilled
  * @param string         $testMessage The message for testing the requirement
  * @param string         $helpHtml    The help text formatted in HTML for resolving the problem
  * @param string|null    $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
  * @param bool           $optional    Whether this is only an optional recommendation not a mandatory requirement
  * @param array<boolean> $types       Three booleans (informative, dependant, fromApp)
  */
 public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false, $types = [self::INFORMATIVE, self::DEPENDANT, self::FROM_APP])
 {
     parent::__construct($fulfilled, $testMessage, $helpHtml, $helpText, $optional);
     $this->informative = (bool) $types[0];
     $this->dependant = (bool) $types[1];
     $this->fromApp = (bool) $types[2];
 }
开发者ID:stadline,项目名称:status-bundle,代码行数:17,代码来源:AppRequirement.php

示例2: __construct

 /**
 * Constructor that initializes the requirement.
 *
 * @param string           $cfgName    The configuration name used for ini_get()
 * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
                                                or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
 * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
                                                This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
                                                Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
 * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
 * @param string|null $helpHtml    The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
 * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
 * @param Boolean     $optional    Whether this is only an optional recommendation not a mandatory requirement
 */
 public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
 {
     $cfgValue = ini_get($cfgName);
     if (is_callable($evaluation)) {
         if (null === $testMessage || null === $helpHtml) {
             throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.');
         }
         $fulfilled = call_user_func($evaluation, $cfgValue);
     } else {
         if (null === $testMessage) {
             $testMessage = sprintf('%s %s be %s in php.ini', $cfgName, $optional ? 'should' : 'must', $evaluation ? 'enabled' : 'disabled');
         }
         if (null === $helpHtml) {
             $helpHtml = sprintf('Set <strong>%s</strong> to <strong>%s</strong> in php.ini<a href="#phpini">*</a>.', $cfgName, $evaluation ? 'on' : 'off');
         }
         $fulfilled = $evaluation == $cfgValue;
     }
     parent::__construct($fulfilled || $approveCfgAbsence && false === $cfgValue, $testMessage, $helpHtml, $helpText, $optional);
 }
开发者ID:luisbrito,项目名称:Phraseanet,代码行数:33,代码来源:PhpIniRequirement.php

示例3: __construct

 /**
  * @return PhpVersionRequirement
  */
 public function __construct()
 {
     parent::__construct(Craft::t('iconv support'), null, false, '<a href="http://buildwithcraft.com">Craft</a>');
 }
开发者ID:webremote,项目名称:craft_boilerplate,代码行数:7,代码来源:Requirements.php

示例4: __construct

 /**
  * @return WebRootExposedFolderRequirement
  */
 public function __construct()
 {
     parent::__construct(Craft::t('Sensitive Craft folders should not be publicly accessible'), null, false, '<a href="http://craftcms.com">Craft CMS</a>');
 }
开发者ID:andyra,项目名称:tes,代码行数:7,代码来源:Requirements.php

示例5: __construct

 /**
  * @return PhpVersionRequirement
  */
 public function __construct()
 {
     parent::__construct(Craft::t('PHP Version'), null, true, '<a href="http://buildwithcraft.com">Craft</a>');
 }
开发者ID:kentonquatman,项目名称:portfolio,代码行数:7,代码来源:Requirements.php

示例6: __construct

 /**
  * @return IconvRequirement
  */
 public function __construct()
 {
     parent::__construct(Craft::t('iconv support'), null, false, '<a href="http://craftcms.com">Craft CMS</a>');
 }
开发者ID:ericnormannn,项目名称:m,代码行数:7,代码来源:Requirements.php


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