Logger::Debug PHP Method

Debug() public method

Debug functions
public Debug ( $filename )
    public function Debug($filename)
    {
        if (is_null($filename)) {
            $filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'debug.log';
        }
        $this->filename = $filename;
        if (isset($_SERVER['REMOTE_ADDR'])) {
            if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
                $a = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
                $this->_current_ip = array_shift($a);
            } else {
                $this->_current_ip = $_SERVER['REMOTE_ADDR'];
            }
        }
    }

Usage Example

Example #1
0
 public static function relativePath($from, $to)
 {
     $arFrom = explode(DIRECTORY_SEPARATOR, rtrim($from, DIRECTORY_SEPARATOR));
     $arTo = explode(DIRECTORY_SEPARATOR, rtrim($to, DIRECTORY_SEPARATOR));
     while (count($arFrom) && count($arTo) && $arFrom[0] == $arTo[0]) {
         array_shift($arFrom);
         array_shift($arTo);
     }
     $p = array();
     Logger::Debug(print_r($arFrom, true));
     if (count($arFrom) > 0) {
         $p = array_fill(0, count($arFrom), '..');
     }
     $p = array_merge($p, $arTo);
     return implode(DIRECTORY_SEPARATOR, $p);
 }
All Usage Examples Of Logger::Debug