Ejemplo n.º 1
0
function restart($nopid = false)
{
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    if (!$nopid) {
        $pid = $unix->get_pid_from_file($pidfile);
        if ($unix->process_exists($pid, basename(__FILE__))) {
            $time = $unix->PROCCESS_TIME_MIN($pid);
            if ($GLOBALS["OUTPUT"]) {
                echo "Restarting....: " . date("H:i:s") . " [INIT]: Already Artica task running PID {$pid} since {$time}mn\n";
            }
            return;
        }
    }
    @file_put_contents($pidfile, getmypid());
    stop(true);
    if ($GLOBALS["CHECK"]) {
        check_dirs();
    }
    build();
    if (!install_video_cache()) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Restarting....: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Unable to install\n";
        }
        return;
    }
    start(true);
    $php = $unix->LOCATE_PHP5_BIN();
    $nohup = $unix->find_program("nohup");
    if ($GLOBALS["OUTPUT"]) {
        echo "Restarting....: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Reloading Apache\n";
    }
    shell_exec("{$php} /usr/share/artica-postfix/exec.freeweb.php --reload");
    if ($GLOBALS["OUTPUT"]) {
        echo "Restarting....: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Reloading Main Proxy\n";
    }
    shell_exec("/etc/init.d/squid reload --script=" . basename(__FILE__));
}
Ejemplo n.º 2
0
if ($act == "1") {
    $install_smarty->assign("act", $act);
    $install_smarty->display('step1.htm');
}
if ($act == "2") {
    $system_info = array();
    $system_info['version'] = QISHI_VERSION;
    $system_info['os'] = PHP_OS;
    $system_info['ip'] = $_SERVER['SERVER_ADDR'];
    $system_info['web_server'] = $_SERVER['SERVER_SOFTWARE'];
    $system_info['php_ver'] = PHP_VERSION;
    $system_info['max_filesize'] = ini_get('upload_max_filesize');
    if (PHP_VERSION < 5.0) {
        exit("安装失败,请使用PHP5.0及以上版本");
    }
    $dir_check = check_dirs($need_check_dirs);
    $install_smarty->assign("dir_check", $dir_check);
    $install_smarty->assign("system_info", $system_info);
    $install_smarty->assign("act", $act);
    $install_smarty->display('step2.htm');
}
if ($act == "3") {
    $install_smarty->assign("act", $act);
    $install_smarty->display('step3.htm');
}
if ($act == "4") {
    $dbhost = isset($_POST['dbhost']) ? trim($_POST['dbhost']) : '';
    $dbname = isset($_POST['dbname']) ? trim($_POST['dbname']) : '';
    $dbuser = isset($_POST['dbuser']) ? trim($_POST['dbuser']) : '';
    $dbpass = isset($_POST['dbpass']) ? trim($_POST['dbpass']) : '';
    $pre = isset($_POST['pre']) ? trim($_POST['pre']) : 'qs_';
Ejemplo n.º 3
0
error_reporting(E_ERROR | E_PARSE);
define("WCMS_BOOTSTRAP_LOADED");
// set up some options
ini_set('arg_separator.output', '&amp;');
ini_set('magic_quotes_runtime', 0);
ini_set('magic_quotes_sybase', 0);
ini_set('session.cache_limiter', 'none');
ini_set('session.use_only_cookies', 1);
ini_set('session.use_trans_sid', 0);
// Set Up PEAR Path
ini_set("include_path", realpath(dirname(__FILE__)) . '/classes/pear/' . PATH_SEPARATOR . ".");
$paths = array('classes' => 'classes', 'data' => 'data', 'templates' => 'templates', 'images' => 'images', 'plugins' => 'plugins');
require_once "classes/paths_class.php";
$base_paths = path::parse_paths();
path::set($base_paths['file'], $base_paths['http'], $paths);
check_dirs();
require_once path::file("classes") . "vars_class.php";
include_once path::file("data") . "settings.php";
$db_prefix = $settings['db_prefix'];
$cache_options = array('data_dir' => path::file("data") . "cache/", 'cache_tag' => md5(path::http("templates") . $settings['theme'] . "/theme.css" . filemtime(path::file("templates") . $settings['theme'] . "/theme.css")));
require_once path::file("classes") . "cache_handling_class.php";
$cache = new cache_handler($cache_options);
// implement smarty object
require_once path::file("classes") . "smarty/Smarty.class.php";
$smarty = new Smarty();
$smarty->compile_check = true;
$smarty->debugging = false;
$smarty->template_dir = path::file("templates");
$smarty->compile_dir = path::file("data") . "template_cache/";
// Assign some useful smarty vars
$smarty->assign("theme", path::file("templates") . $settings['theme'] . "/");