phpCAS::traceEnd PHP Method

traceEnd() public static method

This method is used to indicate the end of the execution of a function in debug mode.
public static traceEnd ( string $res = '' ) : void
$res string the result of the function
return void
    public static function traceEnd($res = '')
    {
        if (empty(self::$_PHPCAS_DEBUG['indent'])) {
            self::$_PHPCAS_DEBUG['indent'] = 0;
        } else {
            self::$_PHPCAS_DEBUG['indent']--;
        }
        $dbg = debug_backtrace();
        $str = '';
        if (is_object($res)) {
            $str .= '<= ' . get_class($res);
        } else {
            $str .= '<= ' . str_replace(array("\r\n", "\n", "\r"), "", var_export($res, true));
        }
        phpCAS::log($str);
    }

Usage Example

Beispiel #1
0
 /**
  * Send the request and store the results.
  *
  * @return bool true on success, false on failure.
  */
 protected function sendRequest()
 {
     phpCAS::traceBegin();
     /*********************************************************
      * initialize the CURL session
      *********************************************************/
     $ch = $this->_initAndConfigure();
     /*********************************************************
      * Perform the query
      *********************************************************/
     $buf = curl_exec($ch);
     if ($buf === false) {
         phpCAS::trace('curl_exec() failed');
         $this->storeErrorMessage('CURL error #' . curl_errno($ch) . ': ' . curl_error($ch));
         $res = false;
     } else {
         $this->storeResponseBody($buf);
         phpCAS::trace("Response Body: \n" . $buf . "\n");
         $res = true;
     }
     // close the CURL session
     curl_close($ch);
     phpCAS::traceEnd($res);
     return $res;
 }
All Usage Examples Of phpCAS::traceEnd