Пример #1
0
 /**
  * App注册运行
  * @param $apppath
  * @throws TXException
  */
 public static function registry($apppath)
 {
     TXDefine::init();
     self::$base = new self();
     self::$base_root = dirname(__DIR__);
     self::$plugins_root = self::$base_root . DS . "plugins";
     self::$log_root = self::$base_root . DS . "logs";
     if (RUN_SHELL) {
         self::$log_root .= '/shell';
     }
     if (is_readable($apppath)) {
         self::$app_root = $apppath;
     } else {
         throw new TXException(1001, array($apppath));
     }
     self::$view_root = self::$app_root . DS . "template";
     if (!is_writable(self::$log_root) && !mkdir(self::$log_root)) {
         throw new TXException(1007, array(self::$log_root));
     }
     self::init();
 }