本文整理汇总了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));
}
示例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));
}
示例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;
}
}