Пример #1
0
 /**
  * Instantiates the crontab handler
  *
  * @author Art <*****@*****.**>
  * @throws OS When the machine is running Windows
  */
 function __construct()
 {
     if (\Alo::serverIsWindows()) {
         throw new OS('Windows does not support cron!', OS::E_UNSUPPORTED);
     } else {
         $this->autocommit = false;
         $this->reloadCrontab();
     }
     self::$this =& $this;
 }
Пример #2
0
	DEFAULT CHARSET = `utf8mb4`;', 'TRUNCATE TABLE alo_locale;', 'TRUNCATE TABLE alo_session;', "INSERT INTO alo_locale(`lang`,`page`,`key`,`value`) VALUES\n('en','global','glob_one','one'),\n('en','global','glob_two','two'),\n('en','local','loc_three','three'),\n('en','local','loc_four','four'),\n('lt','local','loc_four','keturi')"];
/**
 * Global PHPUnit container class
 * @author Art <*****@*****.**>
 */
abstract class PhuGlobal
{
    /** @var Cron */
    static $cron;
    /** @var MemcachedWrapper */
    static $mcWrapper;
    /** @var RedisWrapper */
    static $redisWrapper;
    /** @var MySQL */
    static $mysql;
    /** @var Locale */
    static $locale;
}
if (!Alo::serverIsWindows()) {
    PhuGlobal::$cron = new Cron();
}
PhuGlobal::$mcWrapper = new MemcachedWrapper();
PhuGlobal::$redisWrapper = new RedisWrapper();
PhuGlobal::$mysql = new MySQL(ALO_MYSQL_SERVER, ALO_MYSQL_PORT, ALO_MYSQL_USER, ALO_MYSQL_PW, 'phpunit', ALO_MYSQL_CACHE);
foreach ($runThisSQL as $sql) {
    PhuGlobal::$mysql->prepQuery($sql);
}
PhuGlobal::$locale = new Locale(PhuGlobal::$mysql);
PhuGlobal::$locale->fetch(['local'], 'en', 'lt');
include_once 'tests/abstractcachetest.php';
include_once 'tests/abstractsessiontest.php';