示例#1
0
文件: dog.php 项目: sinfocol/gwf3
# Require config
$config_file = $argv[1];
require_once '../../../www/protected/' . $config_file;
# and gwf
require_once '../../../gwf3.class.php';
$gwf = new GWF3(NULL, array('init' => true, 'bootstrap' => false, 'website_init' => false, 'autoload_modules' => false, 'load_module' => false, 'load_config' => false, 'start_debug' => true, 'get_user' => false, 'do_logging' => false, 'log_request' => false, 'blocking' => true, 'no_session' => true, 'store_last_url' => false, 'ignore_user_abort' => false, 'kick_banned_ip' => false, 'env' => isset($argv[5]) ? $argv[5] : 'prod', 'unix_user' => isset($argv[6]) ? $argv[6] : 'root'));
# That´s all of GWF3 we will share with the worker.
GWF_HTML::init();
GWF_Debug::setDieOnError(false);
GWF_Debug::setMailOnError(false);
$_GET['ajax'] = 1;
# And this is the worker process
require 'dog_include/Dog_WorkerThread.php';
$worker = new Dog_WorkerThread();
$worker->start();
# Parent resources
GWF_Log::init(false, GWF_Log::_DEFAULT - GWF_Log::BUFFERED, GWF_PATH . 'www/protected/logs/dog');
gdo_db();
# Dog please
require_once 'Dog.php';
Dog::setUnixUsername(GWF3::getConfig('unix_user'));
# Dog installer
if (isset($argv[2]) && $argv[2] === 'install') {
    require_once 'mini_install.php';
}
# Dog init
Dog_Init::init($worker);
# Dog l(a)unch
if (!defined('DOG_NO_LAUNCH') && Dog_Init::validate()) {
    Dog::mainloop();
}