예제 #1
0
파일: module.php 프로젝트: dalinhuang/zotop
 public function cache($flush = false)
 {
     $name = $this->table();
     $data = zotop::data($name);
     if ($flush || $data === null) {
         $data = $this->getAll();
         if (is_array($data)) {
             zotop::data($name, $data);
         }
         //重启系统
         zotop::reboot();
     }
     return $data;
 }
예제 #2
0
파일: module.php 프로젝트: dalinhuang/zotop
 public function cache()
 {
     $data = array();
     $rows = $this->getAll(array('where' => array('status', '>=', '0')));
     foreach ($rows as $row) {
         $data[$row['id']] = $row;
     }
     zotop::data('module', $data);
     zotop::reboot();
     return $data;
 }
예제 #3
0
파일: module.php 프로젝트: dalinhuang/zotop
 public function cache($reload = false)
 {
     $name = $this->table();
     $data = zotop::data($name);
     //设置缓存数据
     if ($reload || $data === null) {
         $data = $this->getAll($sql);
         $data = arr::hashmap($data, $this->key());
         if (is_array($data)) {
             zotop::data($name, $data);
         }
         //重启系统
         zotop::reboot();
     }
     return $data;
 }
예제 #4
0
파일: config.php 프로젝트: dalinhuang/zotop
 public function cache($reload = false)
 {
     $data = $this->db()->select('id', 'value')->getAll();
     $data = arr::hashmap($data, 'id', 'value');
     zotop::data('config', $data);
     zotop::reboot();
     return $data;
 }
예제 #5
0
파일: index.php 프로젝트: dalinhuang/zotop
define('ZOTOP_PATH_CACHE', ZOTOP_PATH_DATA . DS . 'cache');
define('ZOTOP_PATH_RUNTIME', ZOTOP_PATH_DATA . DS . 'runtime');
define('ZOTOP_PATH_APPLICATION', ZOTOP_PATH_ROOT . DS . 'site');
//定义URL路径及参数
define('ZOTOP_URL_ROOT', dirname($_SERVER['SCRIPT_NAME']));
define('ZOTOP_URL_MODULES', ZOTOP_URL_ROOT . '/modules');
define('ZOTOP_URL_THEMES', ZOTOP_URL_ROOT . '/themes');
define('ZOTOP_URL_COMMON', ZOTOP_URL_ROOT . '/site/common');
//加载运行文件
if (file_exists(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION . '.core.php') && !DEBUG) {
    require ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION . '.core.php';
    //加载hook文件
    zotop::load(ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION . '.hooks.php');
    //加载配置参数
    zotop::config(include ZOTOP_PATH_RUNTIME . DS . ZOTOP_APPLICATION . '.config.php');
    //系统启动
    zotop::boot();
} else {
    //加载系统核心
    require ZOTOP_PATH_MODULES . DS . 'system' . DS . 'libraries' . DS . 'zotop.php';
    //注册自动加载系统库文件
    zotop::register(@(include ZOTOP_PATH_MODULES . DS . 'system' . DS . 'libraries.php'));
    zotop::register(@(include ZOTOP_PATH_APPLICATION . DS . 'libraries.php'));
    zotop::reboot();
}
//系统启动并运行
zotop::run('system.init');
zotop::run('system.route');
zotop::run('system.ready');
zotop::run('system.run');
zotop::run('system.shutdown');
예제 #6
0
파일: zotop.php 프로젝트: dalinhuang/zotop
 /**
  * 系统重建
  *
  * @return string
  */
 public static function build()
 {
     zotop::boot();
     zotop::reboot();
 }