Example #1
0
 public function error()
 {
     $a = func_get_args();
     $h = xbNode::errorHandler();
     if (is_callable($h, true)) {
         return call_user_func_array($h, $a);
     } elseif ($h === true) {
         return true;
     }
     throw new Exception('xbNode error: ' . implode('|', $a));
 }
Example #2
0
 function __get($n)
 {
     switch ($n) {
         case 'fileName':
             $F = xbNode::cacheDeploy() . $this->_module . DIRECTORY_SEPARATOR;
             if (is_array($this->_path)) {
                 if (count($this->_path) > 0) {
                     $F .= implode(DIRECTORY_SEPARATOR, $this->_path);
                     if (!is_dir($F)) {
                         if (!mkdir($F, 0744, true)) {
                             return false;
                         }
                     }
                 }
             }
             return $F . DIRECTORY_SEPARATOR . $this->_name . '.cache';
     }
     $N = "_{$n}";
     return property_exists($this, $N) ? $this->{$N} : false;
 }
Example #3
0
File: lib.php Project: vgrish/xblib
 public static function errorHandler($v = null)
 {
     if (is_callable($v, true) || $v === true) {
         self::$_errorHandler = $v;
     } elseif ($v === false) {
         self::$_errorHandler = null;
     }
     return self::$_errorHandler;
 }