Пример #1
0
 public static function autoload($class)
 {
     $class = strtolower($class);
     if (strpos($class, 't_') !== false) {
         $file = 'table/' . $class;
         //若是表模型类
     } else {
         $file = $class;
     }
     try {
         self::import($file);
         return true;
     } catch (Exception $exc) {
         $trace = $exc->getTrace();
         foreach ($trace as $log) {
             if (empty($log['class']) && $log['function'] == 'class_exists') {
                 return false;
             }
         }
         jam_error::exception_error($exc);
     }
 }
Пример #2
0
 private function _get_script_url()
 {
     if (!isset($this->b['PHP_SELF'])) {
         $scriptName = basename($_SERVER['SCRIPT_FILENAME']);
         if (basename($_SERVER['SCRIPT_NAME']) === $scriptName) {
             $this->b['PHP_SELF'] = $_SERVER['SCRIPT_NAME'];
         } else {
             if (basename($_SERVER['PHP_SELF']) === $scriptName) {
                 $this->b['PHP_SELF'] = $_SERVER['PHP_SELF'];
             } else {
                 if (isset($_SERVER['ORIG_SCRIPT_NAME']) && basename($_SERVER['ORIG_SCRIPT_NAME']) === $scriptName) {
                     $this->b['PHP_SELF'] = $_SERVER['ORIG_SCRIPT_NAME'];
                 } else {
                     if (($pos = strpos($_SERVER['PHP_SELF'], '/' . $scriptName)) !== false) {
                         $this->b['PHP_SELF'] = substr($_SERVER['SCRIPT_NAME'], 0, $pos) . '/' . $scriptName;
                     } else {
                         if (isset($_SERVER['DOCUMENT_ROOT']) && strpos($_SERVER['SCRIPT_FILENAME'], $_SERVER['DOCUMENT_ROOT']) === 0) {
                             $this->b['PHP_SELF'] = str_replace('\\', '/', str_replace($_SERVER['DOCUMENT_ROOT'], '', $_SERVER['SCRIPT_FILENAME']));
                             $this->b['PHP_SELF'][0] != '/' && ($this->b['PHP_SELF'] = '/' . $this->b['PHP_SELF']);
                         } else {
                             jam_error::system_error('request_tainting');
                         }
                     }
                 }
             }
         }
     }
     return $this->b['PHP_SELF'];
 }
Пример #3
0
 function _error($message, $tplname)
 {
     jam_error::system_error($message, $tplname);
     exit;
 }