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'); } } }); }
public static function fullrmdir($delfile, $ischild = false) { return Path::fullrmdir($delfile, $ischild); }
<?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');
<?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);