示例#1
0
<?php

namespace bmtmgr;

// All modules can assume access the following modules and the timezone being set correctly.
require_once \dirname(__DIR__) . '/src/utils.php';
require_once \dirname(__DIR__) . '/src/model.php';
require_once \dirname(__DIR__) . '/src/config.php';
\bmtmgr\config\Config::load(__DIR__ . '/testconfig.json');
require_once \dirname(__DIR__) . '/src/db.php';
require_once \dirname(__DIR__) . '/src/user.php';
// These should be autoloaded later
require_once \dirname(__DIR__) . '/models/discipline.php';
require_once \dirname(__DIR__) . '/models/entry.php';
require_once \dirname(__DIR__) . '/models/player.php';
require_once \dirname(__DIR__) . '/models/season.php';
require_once \dirname(__DIR__) . '/models/tournament.php';
require_once \dirname(__DIR__) . '/models/user.php';
\date_default_timezone_set(\bmtmgr\config\get('timezone'));
示例#2
0
文件: install.php 项目: nishad/bmtmgr
<?php

namespace bmtmgr\install;

require_once __DIR__ . '/utils.php';
require_once __DIR__ . '/config.php';
\bmtmgr\config\Config::load();
define('LIB_ROOT', dirname(__DIR__) . '/libs/');
function get_libs()
{
    return [['url' => 'http://code.jquery.com/jquery-1.11.2.min.js', 'symlink' => 'jquery.min.js'], ['url' => 'http://cdn.craig.is/js/mousetrap/mousetrap.min.js'], ['url' => 'http://jqueryui.com/resources/download/jquery-ui-1.11.4.zip', 'symlink' => 'jquery-ui'], ['url' => 'https://github.com/bobthecow/mustache.php.git'], ['url' => 'https://github.com/mk-j/PHP_XLSXWriter.git']];
}
if (\bmtmgr\config\get('allow_install', false)) {
    if (isset($argv)) {
        if (count($argv) == 1 || $argv[1] == 'install') {
            install_libs();
        } elseif ($argv[1] == 'clean') {
            clean();
        } else {
            die('Usage: ' . $argv[0] . ' install|clean' . "\n");
        }
    } else {
        install_libs();
    }
} elseif (isset($argv)) {
    echo 'Configuration option allow_install unset!' . "\n";
}
function rm_rf($fn)
{
    if (!\bmtmgr\utils\startswith($fn, LIB_ROOT)) {
        throw new \Exception('Invalid rm of ' . $fn);