當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。