Ejemplo n.º 1
0
 /**
  * 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));
 }
Ejemplo n.º 2
0
 /**
  * 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));
 }
Ejemplo n.º 3
0
 /**
  * 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;
     }
 }