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


PHP CString::toBool方法代码示例

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


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

示例1: valueForLongOptionBool

 /**
  * Returns the value of a specified long option with which the script was run, as a boolean value.
  *
  * If the option's value is "1", "true", "yes", or "on", case-insensitively, it's recognized as `true`, and as
  * `false` for any other value.
  *
  * @param  string $optionName The name of the option, excluding "-".
  *
  * @return bool `true` for "1", "true", "yes", and "on", case-insensitively, `false` otherwise.
  */
 public static function valueForLongOptionBool($optionName)
 {
     assert('is_cstring($optionName)', vs(isset($this), get_defined_vars()));
     return CString::toBool(self::valueForLongOption($optionName));
 }
开发者ID:nunodotferreira,项目名称:Phred,代码行数:15,代码来源:CShell.php

示例2: configOptionOrigBool

 /**
  * Returns the original value of a specified PHP's configuration option, as a boolean value.
  *
  * @param  string $optionName The name of the option.
  *
  * @return bool The value of the option.
  */
 public static function configOptionOrigBool($optionName)
 {
     assert('is_cstring($optionName)', vs(isset($this), get_defined_vars()));
     return CString::toBool(self::configOptionOrig($optionName));
 }
开发者ID:nunodotferreira,项目名称:Phred,代码行数:12,代码来源:CSystem.php

示例3: requestSslVerificationResult

 /**
  * Returns the result of the verification of the SSL certificate of the remote server.
  *
  * @return bool `true` if the SSL certificate was verified successfully, `false` otherwise.
  */
 public function requestSslVerificationResult()
 {
     assert('$this->m_done && !$this->m_hasError', vs(isset($this), get_defined_vars()));
     $key = "ssl_verify_result";
     if (CMap::hasKey($this->m_requestSummary, $key)) {
         $value = $this->m_requestSummary[$key];
         if (!is_bool($value)) {
             if (!is_cstring($value)) {
                 $value = CString::fromInt($value);
             }
             return CString::toBool($value);
         } else {
             return $value;
         }
     } else {
         return false;
     }
 }
开发者ID:nunodotferreira,项目名称:Phred,代码行数:23,代码来源:CInetRequest.php


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