예제 #1
0
    $GLOBALS["VERBOSE"] = true;
    ini_set('html_errors', 0);
    ini_set('display_errors', 1);
    ini_set('error_reporting', E_ALL);
}
//$GLOBALS["VERBOSE"]=true;$GLOBALS["VERBOSE"]=true;$GLOBALS["debug"]=true;ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null);
include_once dirname(__FILE__) . '/ressources/class.templates.inc';
include_once dirname(__FILE__) . '/ressources/class.ldap.inc';
include_once dirname(__FILE__) . '/ressources/class.ini.inc';
include_once dirname(__FILE__) . '/ressources/class.mysql.inc';
include_once dirname(__FILE__) . '/ressources/class.ccurl.inc';
include_once dirname(__FILE__) . '/framework/class.unix.inc';
include_once dirname(__FILE__) . '/framework/frame.class.inc';
include_once dirname(__FILE__) . '/ressources/class.squidguard.inc';
if ($argv[1] == "--checklic") {
    HyperCache_create_license();
    exit;
}
if ($argv[1] == "--wizard") {
    $GLOBALS["NOPROGRESS"] = true;
}
checkcaches();
function build_progress($text, $pourc)
{
    if ($GLOBALS["NOPROGRESS"]) {
        return;
    }
    $array["POURC"] = $pourc;
    $array["TEXT"] = $text;
    echo "[{$pourc}]: {$text}\n";
    @file_put_contents("/usr/share/artica-postfix/ressources/logs/web/squid.rock.progress", serialize($array));
예제 #2
0
function build_sequence()
{
    $unix = new unix();
    $php = $unix->LOCATE_PHP5_BIN();
    $sock = new sockets();
    $HyperCacheStoreID = intval($sock->GET_INFO("HyperCacheStoreID"));
    $HyperCacheLicensedMode = intval($sock->GET_INFO("HyperCacheLicensedMode"));
    if ($HyperCacheLicensedMode == 0) {
        if ($HyperCacheStoreID == 1) {
            build_progress(10, "{checking_plugin}");
            build_sequence_plugin();
            return;
        }
    }
    build_progress(10, "{checking_license_status}");
    if (!HyperCache()) {
        if ($HyperCacheStoreID == 0) {
            if (!verify_proxy_configuration()) {
                build_progress(50, "{reconfigure_proxy_service}");
                system("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
                build_progress(100, "{checking_license_status} {success} {disabled}");
                return;
            }
            build_progress(100, "{checking_license_status} {success} {disabled}");
            return;
        }
        build_progress(110, "{checking_license_status} {failed}");
        return;
    }
    build_progress(15, "{update_websites_list}");
    HyperCache_websites();
    build_progress(20, "{verify_the_license}");
    HyperCache_create_license();
    build_progress(30, "{verify_proxy_configuration}");
    if (!verify_proxy_configuration()) {
        build_progress(50, "{reconfigure_proxy_service}");
        system("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
        build_progress(70, "{verify_proxy_configuration}");
        if (!verify_proxy_configuration()) {
            build_progress(110, "{verify_proxy_configuration} {failed}");
            return;
        }
        system("/etc/artica-postfix/artica-status restart --force");
    }
    build_progress(100, "{verify_proxy_configuration} {success}");
}