示例#1
0
文件: Update.php 项目: infrajs/update
 public static function init()
 {
     Once::exec(__FILE__ . 'init', function () {
         $action = Ans::GET('-update');
         Config::init();
         $path = Path::$conf;
         if ($action) {
             Access::test(true);
             if (!Update::$is) {
                 Path::fullrmdir($path['cache']);
                 Update::exec();
             }
         }
         if ($path['fs'] && !Update::$is) {
             if (!is_dir($path['cache'])) {
                 Access::$conf['test'] = true;
                 Update::exec();
             }
             if (Access::isTest()) {
                 if (is_file($path['data'] . 'update')) {
                     unlink($path['data'] . 'update');
                     Access::$conf['test'] = true;
                     if (!Update::$is) {
                         Path::fullrmdir($path['cache']);
                         Update::exec();
                     }
                 }
             }
         }
         if (Update::$is) {
             if (is_file($path['data'] . 'update')) {
                 unlink($path['data'] . 'update');
             }
         }
     });
 }
示例#2
0
文件: Cache.php 项目: infrajs/cache
 public static function fullrmdir($delfile, $ischild = false)
 {
     return Path::fullrmdir($delfile, $ischild);
 }
示例#3
0
文件: flush.php 项目: infrajs/admin
<?php

use infrajs\access\Access;
use infrajs\config\Config;
use infrajs\ans\Ans;
use infrajs\mem\Mem;
use infrajs\path\Path;
use infrajs\router\Router;
if (!is_file('vendor/autoload.php')) {
    chdir('../../../');
    require_once 'vendor/autoload.php';
    Router::init();
}
Access::test(true);
Mem::flush();
Path::fullrmdir('!', true);
$ans = array();
Ans::ret($ans, 'Cache cleared Mem::flush, Path::fulrmdir');
示例#4
0
文件: index.php 项目: infrajs/update
<?php

namespace infrajs\update;

use infrajs\access\Access;
use infrajs\ans\Ans;
use infrajs\once\Once;
use infrajs\path\Path;
$ans = array();
if (Update::$is) {
    return Ans::ret($ans, 'update итак запущен');
}
Access::test(true);
Path::fullrmdir(Path::$conf['cache']);
Update::exec();
return Ans::ret($ans);