예제 #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
파일: update.php 프로젝트: infrajs/tester
<?php

use infrajs\load\Load;
use infrajs\access\Access;
use infrajs\event\Event;
use infrajs\config\Config;
use infrajs\update\Update;
$conf = Config::get('tester');
if ($conf['updatetest']) {
    Update::exec();
    //Это отодвинет update testerа в конец очереди
    $ans = Load::loadJSON('-tester/?type=auto');
    if (!$ans || !$ans['result']) {
        error_log('TESTER: There are errors in the tests /-tester/?type=errors ' . $ans['msg']);
        //if (Access::debug()) die('TESTER: There are errors in the tests <a href="/-tester/?type=errors">errors</a> <b>'.$ans['msg'].'</b>');
    } else {
        echo '<div class="well">С обновлением выполнено <a href="/-tester/">тестирование</a>, ошибок не обнаружено</div>';
    }
}