当前位置: 首页>>代码示例>>PHP>>正文


PHP unix::CPU_NUMBER方法代码示例

本文整理汇总了PHP中unix::CPU_NUMBER方法的典型用法代码示例。如果您正苦于以下问题:PHP unix::CPU_NUMBER方法的具体用法?PHP unix::CPU_NUMBER怎么用?PHP unix::CPU_NUMBER使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在unix的用法示例。


在下文中一共展示了unix::CPU_NUMBER方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CPU_NUMBER

function CPU_NUMBER()
{
    $unix = new unix();
    $CPUNUM = $unix->CPU_NUMBER();
    echo "<articadatascgi>{$CPUNUM}</articadatascgi>";
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:6,代码来源:services.php

示例2: build

function build($OnlySingle = false)
{
    if (isset($GLOBALS[__FILE__ . __FUNCTION__])) {
        return;
    }
    $GLOBALS[__FILE__ . __FUNCTION__] = true;
    $unix = new unix();
    $php5 = $unix->LOCATE_PHP5_BIN();
    shell_exec("/etc/init.d/mysql start");
    build_progress("{building_main_settings}", 10);
    if ($unix->SQUID_GET_LISTEN_PORT() == 80) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: Squid listen 80, ports conflicts, change it\n";
        }
        shell_exec("{$php5} /usr/share/artica-postfix/exec.squid.php --build --force");
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: Restarting Squid-cache..\n";
        }
        shell_exec("/etc/init.d/squid restart --script=" . basename(__FILE__));
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: done...\n";
        }
    }
    if ($unix->SQUID_GET_LISTEN_SSL_PORT() == 443) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: Squid listen 443, ports conflicts, change it\n";
        }
        shell_exec("{$php5} /usr/share/artica-postfix/exec.squid.php --build --force");
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: Restarting Squid-cache..\n";
        }
        shell_exec("/etc/init.d/squid restart --script=" . basename(__FILE__));
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: done...\n";
        }
    }
    $reconfigured = false;
    if ($unix->APACHE_GET_LISTEN_PORT() == 80) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: Apache listen 80, ports conflicts, change it\n";
        }
        shell_exec("{$php5} /usr/share/artica-postfix/exec.freeweb.php --build --force");
        shell_exec("{$php5} /usr/share/artica-postfix/exec.freeweb.php --stop --force");
        shell_exec("{$php5} /usr/share/artica-postfix/exec.freeweb.php --start --force");
        $reconfigured = true;
    }
    if (!$reconfigured) {
        if ($unix->APACHE_GET_LISTEN_PORT() == 443) {
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: Apache listen 443, ports conflicts, change it\n";
            }
            shell_exec("{$php5} /usr/share/artica-postfix/exec.freeweb.php --build --force");
        }
    }
    $APACHE_USER = $unix->APACHE_SRC_ACCOUNT();
    $APACHE_SRC_GROUP = $unix->APACHE_SRC_GROUP();
    $NginxProxyStorePath = "/home/nginx";
    @mkdir("/etc/nginx/sites-enabled", 0755, true);
    @mkdir("/etc/nginx/local-sites", 0755, true);
    @mkdir("/etc/nginx/local-sslsites", 0755, true);
    @mkdir($NginxProxyStorePath, 0755, true);
    @mkdir($NginxProxyStorePath . "/tmp", 0755, true);
    @mkdir($NginxProxyStorePath . "/disk", 0755, true);
    @mkdir("/var/lib/nginx/fastcgi", 0755, true);
    @mkdir("/home/nginx/tmp", 0755, true);
    $Tempdir = $unix->TEMP_DIR() . "/nginx";
    @mkdir($Tempdir, 0755, true);
    $unix->chown_func($APACHE_USER, $APACHE_SRC_GROUP, $NginxProxyStorePath);
    $unix->chown_func($APACHE_USER, $APACHE_SRC_GROUP, "/etc/nginx/sites-enabled");
    $unix->chown_func($APACHE_USER, $APACHE_SRC_GROUP, $NginxProxyStorePath . "/tmp");
    $unix->chown_func($APACHE_USER, $APACHE_SRC_GROUP, $NginxProxyStorePath . "/disk");
    $unix->chown_func($APACHE_USER, $APACHE_SRC_GROUP, "/var/lib/nginx/fastcgi");
    $unix->chown_func($APACHE_USER, $APACHE_SRC_GROUP, $Tempdir);
    nginx_ulimit();
    $workers = $unix->CPU_NUMBER();
    build_progress("Building configuration", 15);
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: Running {$APACHE_USER}:{$APACHE_SRC_GROUP}..\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: Running {$workers} worker(s)..\n";
    }
    if (is_file("/etc/nginx/sites-enabled/default")) {
        @unlink("/etc/nginx/sites-enabled/default");
    }
    if (is_link("/etc/nginx/sites-enabled/default")) {
        @unlink("/etc/nginx/sites-enabled/default");
    }
    if (is_link("/etc/nginx/conf.d/example_ssl.conf")) {
        @unlink("/etc/nginx/conf.d/example_ssl.conf");
    }
    $limit = 4096 * $workers;
    if ($limit > 65535) {
        $limit = 65535;
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: Nginx, Running limit of {$limit} open files\n";
    }
    $L = explode("\n", @file_get_contents("/etc/security/limits.conf"));
    $FOUNDL = false;
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:exec.nginx.php

示例3: build

function build()
{
    $users = new usersMenus();
    $sock = new sockets();
    $unix = new unix();
    $SystemLoadNotif = $sock->GET_INFO("SystemLoadNotif");
    if (!is_numeric($SystemLoadNotif)) {
        $SystemLoadNotif = 0;
    }
    $EnableSyslogDB = $sock->GET_INFO("EnableSyslogDB");
    if (!is_numeric($EnableSyslogDB)) {
        $EnableSyslogDB = 0;
    }
    $MySQLSyslogType = $sock->GET_INFO("MySQLSyslogType");
    if (!is_numeric($MySQLSyslogType)) {
        $MySQLSyslogType = 1;
    }
    $SquidPerformance = intval($sock->GET_INFO("SquidPerformance"));
    $EnableIntelCeleron = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/EnableIntelCeleron"));
    $python = $unix->find_program("python");
    $nice = $unix->EXEC_NICE();
    $ps = $unix->find_program("ps");
    $sort = $unix->find_program("sort");
    $head = $unix->find_program("head");
    $echo = $unix->find_program("echo");
    $date = $unix->find_program("date");
    $mkdir = $unix->find_program("mkdir");
    $php5 = $unix->LOCATE_PHP5_BIN();
    $ZarafaDedicateMySQLServer = $sock->GET_INFO("ZarafaDedicateMySQLServer");
    if (!is_numeric($ZarafaDedicateMySQLServer)) {
        $ZarafaDedicateMySQLServer = 0;
    }
    build_progress_restart("{reconfiguring}", 22);
    $ini = new Bs_IniHandler();
    $ini->loadFile('/etc/artica-postfix/smtpnotif.conf');
    if (!is_numeric($ini->_params["SMTP"]["EnableNotifs"])) {
        $ini->_params["SMTP"]["EnableNotifs"] = 0;
    }
    if (!is_numeric($ini->_params["SMTP"]["tls_enabled"])) {
        $ini->_params["SMTP"]["tls_enabled"] = 0;
    }
    $smtp_server = trim($ini->_params["SMTP"]['smtp_server_name']);
    $smtp_server_port = $ini->_params["SMTP"]['smtp_server_port'];
    $smtp_dest = $ini->_params["SMTP"]['smtp_dest'];
    $smtp_sender = $ini->_params["SMTP"]['smtp_sender'];
    $smtp_auth_user = $ini->_params["SMTP"]['smtp_auth_user'];
    $smtp_auth_passwd = $ini->_params["SMTP"]['smtp_auth_passwd'];
    $tls_enabled = $ini->_params["SMTP"]["tls_enabled"];
    $recipientsZ = explode("\n", "/etc/artica-postfix/settings/Daemons/SmtpNotificationConfigCC");
    $recipients = array();
    while (list($index, $to) = each($recipientsZ)) {
        if (trim($to) == null) {
            continue;
        }
        $recipients[] = $to;
    }
    if ($smtp_server == null) {
        $ini->_params["SMTP"]["EnableNotifs"] = 0;
    }
    if ($smtp_dest == null) {
        if (count($recipients) == 0) {
            $ini->_params["SMTP"]["EnableNotifs"] = 0;
        }
    }
    if (!is_numeric($smtp_server_port)) {
        $smtp_server_port = 25;
    }
    $EnableNotifs = $ini->_params["SMTP"]["EnableNotifs"];
    $monit_not_on = 'instance,action';
    $f[] = 'set daemon 60 with start delay 5';
    $f[] = 'set idfile /var/run/monit/monit.id';
    $cpunum = $unix->CPU_NUMBER();
    $normal = $cpunum * 2 + 1;
    $normal2 = $cpunum * 2;
    $busy = $cpunum * 4;
    build_progress_restart("{reconfiguring}", 23);
    $EnableMONITSmtpNotif = $sock->GET_INFO("EnableMONITSmtpNotif");
    if (!is_numeric($EnableMONITSmtpNotif)) {
        $EnableMONITSmtpNotif = 1;
    }
    $MonitCPUUsage = intval($sock->GET_INFO("MonitCPUUsage"));
    $MonitCPUUsageCycles = intval($sock->GET_INFO("MonitCPUUsageCycles"));
    $MonitMemUsage = intval($sock->GET_INFO("MonitMemUsage"));
    $MonitMemUsageCycles = intval($sock->GET_INFO("MonitMemUsageCycles"));
    $MonitReportLoadVG1mn = intval($sock->GET_INFO("MonitReportLoadVG1mn"));
    $MonitReportLoadVG1mnCycles = intval($sock->GET_INFO("MonitReportLoadVG1mnCycles"));
    if ($MonitReportLoadVG1mnCycles == 0) {
        $MonitReportLoadVG1mnCycles = 5;
    }
    $MonitReportLoadVG5mn = intval($sock->GET_INFO("MonitReportLoadVG5mn"));
    $MonitReportLoadVG5mnCycles = intval($sock->GET_INFO("MonitReportLoadVG5mnCycles"));
    if ($MonitReportLoadVG5mnCycles == 0) {
        $MonitReportLoadVG5mnCycles = 15;
    }
    $MonitReportLoadVG15mn = intval($sock->GET_INFO("MonitReportLoadVG15mn"));
    $MonitReportLoadVG15mnCycles = intval($sock->GET_INFO("MonitReportLoadVG15mnCycles"));
    if ($MonitReportLoadVG15mnCycles == 0) {
        $MonitReportLoadVG15mnCycles = 60;
    }
    $MonitMemPurgeCache = intval($sock->GET_INFO("MonitMemPurgeCache"));
//.........这里部分代码省略.........
开发者ID:articatech,项目名称:artica,代码行数:101,代码来源:exec.monit.php

示例4: system_values

function system_values()
{
    $unix = new unix();
    $CPU_NUMBER = $unix->CPU_NUMBER();
    @file_put_contents("/usr/share/artica-postfix/ressources/interface-cache/CPU_NUMBER", $CPU_NUMBER);
    events("CPU_NUMBER: {$CPU_NUMBER}");
    @chmod("/usr/share/artica-postfix/ressources/interface-cache/CPU_NUMBER", 0755);
    $influxdb_version = influxdb_version();
    events("InfluxDB version: {$influxdb_version}");
    @file_put_contents("{$GLOBALS["BASEDIR"]}/influxdb_version", $influxdb_version);
    @chmod("{$GLOBALS["BASEDIR"]}/influxdb_version", 0777);
}
开发者ID:articatech,项目名称:artica,代码行数:12,代码来源:exec.squid.interface-size.php

示例5: WizardExecute


//.........这里部分代码省略.........
    @file_put_contents("/etc/artica-postfix/WIZARD_INSTALL_EXECUTED", time());
    writeprogress(16, "{reconfigure}: {openldap_server}");
    @unlink("/etc/artica-postfix/no-ldap-change");
    @chmod("/usr/share/artica-postfix/bin/artica-install", 0755);
    @chmod("/usr/share/artica-postfix/bin/process1", 0755);
    writeprogress(17, "{building_openldap_configuration_file}");
    system("/usr/share/artica-postfix/bin/artica-install --slapdconf >>{$DEBUG_LOG} 2>&1");
    writeprogress(18, "{restarting_service} {openldap_server} [{$suffix}] (1/3)");
    shell_exec("{$php5} /usr/share/artica-postfix/exec.initslapd.php --ldapd-conf --verbose >>{$DEBUG_LOG} 2>&1");
    system("/etc/init.d/slapd restart --force --framework=" . basename(__FILE__) . "-" . __LINE__ . " >>{$DEBUG_LOG} 2>&1");
    usleep(800);
    writeprogress(19, "{restarting_service} {openldap_server} [{$suffix}] (2/3)");
    system("/etc/init.d/slapd restart --force --framework=" . basename(__FILE__) . "-" . __LINE__ . " >>{$DEBUG_LOG} 2>&1");
    usleep(800);
    writeprogress(20, "{restarting_service} {openldap_server} [{$suffix}] (3/3)");
    system("/etc/init.d/slapd restart --force --framework=" . basename(__FILE__) . "-" . __LINE__ . " >>{$DEBUG_LOG} 2>&1");
    sleep(2);
    writeprogress(22, "{refresh_global_settings}");
    system('/usr/share/artica-postfix/bin/process1 --checkout --force --verbose ' . time());
    writeprogress(23, "{scanning_hardware_software}");
    system('/usr/share/artica-postfix/bin/process1 --force --verbose ' . time());
    $SUBNIC = null;
    FINAL___();
    @file_get_contents($pidfile, getmypid());
    writeprogress(24, "{restarting_service}: {mysql_server}");
    system('/etc/init.d/mysql restart --force');
    sleep(1);
    $users = new usersMenus();
    $q = new mysql();
    writeprogress(25, "{creating_databases}");
    sleep(1);
    $q->BuildTables();
    $sock = new sockets();
    $CPU_NUMBERS = $unix->CPU_NUMBER();
    if ($CPU_NUMBERS == 0) {
        $CPU_NUMBERS = 4;
    }
    $MEMORY = $unix->MEM_TOTAL_INSTALLEE();
    $MEMORY_TEXT = FormatBytes($MEMORY);
    $INTEL_CELERON = FALSE;
    writeprogress(25, "CPUs {$CPU_NUMBERS} - {memory}: {$MEMORY_TEXT}");
    sleep(2);
    if ($MEMORY > 1) {
        if ($unix->MEM_TOTAL_INSTALLEE() < 624288) {
            @file_put_contents("/etc/artica-postfix/settings/Daemons/EnableIntelCeleron", 1);
            @file_put_contents("/etc/artica-postfix/settings/Daemons/SquidPerformance", 3);
            writeprogress(25, "{$MEMORY_TEXT} = Enable Intel Celeron mode....");
            shell_exec("{$php5} /usr/share/artica-postfix/exec.intel.celeron.php");
            $INTEL_CELERON = true;
        }
    }
    if (!$INTEL_CELERON) {
        if ($CPU_NUMBERS < 2) {
            @file_put_contents("/etc/artica-postfix/settings/Daemons/EnableIntelCeleron", 1);
            @file_put_contents("/etc/artica-postfix/settings/Daemons/SquidPerformance", 3);
            writeprogress(25, "CPUs:{$CPU_NUMBERS} = Intel Celeron mode....");
            shell_exec("{$php5} /usr/share/artica-postfix/exec.intel.celeron.php");
            $INTEL_CELERON = true;
        }
    }
    if (!$INTEL_CELERON) {
        if ($CPU_NUMBERS < 3) {
            @file_put_contents("/etc/artica-postfix/settings/Daemons/SquidPerformance", 2);
            writeprogress(25, "CPUs:{$CPU_NUMBERS} = {features}: {no_statistics}");
            sleep(1);
        }
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:67,代码来源:exec.wizard-install.php

示例6: build

function build()
{
    $users = new usersMenus();
    $sock = new sockets();
    $unix = new unix();
    $SystemLoadNotif = $sock->GET_INFO("SystemLoadNotif");
    if (!is_numeric($SystemLoadNotif)) {
        $SystemLoadNotif = 0;
    }
    $EnableSyslogDB = $sock->GET_INFO("EnableSyslogDB");
    if (!is_numeric($EnableSyslogDB)) {
        $EnableSyslogDB = 0;
    }
    $MySQLSyslogType = $sock->GET_INFO("MySQLSyslogType");
    if (!is_numeric($MySQLSyslogType)) {
        $MySQLSyslogType = 1;
    }
    $ZarafaDedicateMySQLServer = $sock->GET_INFO("ZarafaDedicateMySQLServer");
    if (!is_numeric($ZarafaDedicateMySQLServer)) {
        $ZarafaDedicateMySQLServer = 0;
    }
    $ini = new Bs_IniHandler();
    $ini->loadFile('/etc/artica-postfix/smtpnotif.conf');
    if (!is_numeric($ini->_params["SMTP"]["EnableNotifs"])) {
        $ini->_params["SMTP"]["EnableNotifs"] = 0;
    }
    if (!is_numeric($ini->_params["SMTP"]["tls_enabled"])) {
        $ini->_params["SMTP"]["tls_enabled"] = 0;
    }
    $smtp_server = trim($ini->_params["SMTP"]['smtp_server_name']);
    $smtp_server_port = $ini->_params["SMTP"]['smtp_server_port'];
    $smtp_dest = $ini->_params["SMTP"]['smtp_dest'];
    $smtp_sender = $ini->_params["SMTP"]['smtp_sender'];
    $smtp_auth_user = $ini->_params["SMTP"]['smtp_auth_user'];
    $smtp_auth_passwd = $ini->_params["SMTP"]['smtp_auth_passwd'];
    $tls_enabled = $ini->_params["SMTP"]["tls_enabled"];
    $recipientsZ = explode("\n", "/etc/artica-postfix/settings/Daemons/SmtpNotificationConfigCC");
    $recipients = array();
    while (list($index, $to) = each($recipientsZ)) {
        if (trim($to) == null) {
            continue;
        }
        $recipients[] = $to;
    }
    if ($smtp_server == null) {
        $ini->_params["SMTP"]["EnableNotifs"] = 0;
    }
    if ($smtp_dest == null) {
        if (count($recipients) == 0) {
            $ini->_params["SMTP"]["EnableNotifs"] = 0;
        }
    }
    if (!is_numeric($smtp_server_port)) {
        $smtp_server_port = 25;
    }
    $EnableNotifs = $ini->_params["SMTP"]["EnableNotifs"];
    $monit_not_on = 'instance,action';
    $f[] = 'set daemon 60 with start delay 5';
    $f[] = 'set idfile /var/run/monit/monit.id';
    $cpunum = $unix->CPU_NUMBER();
    $normal = $cpunum * 2 + 1;
    $normal2 = $cpunum * 2;
    $busy = $cpunum * 4;
    $EnableMONITSmtpNotif = $sock->GET_INFO("EnableMONITSmtpNotif");
    if (!is_numeric($EnableMONITSmtpNotif)) {
        $EnableMONITSmtpNotif = 1;
    }
    $EnableWatchMemoryUsage = $sock->GET_INFO("EnableWatchMemoryUsage");
    if (!is_numeric($EnableWatchMemoryUsage)) {
        $EnableWatchMemoryUsage = 1;
    }
    $EnableWatchCPUsage = $sock->GET_INFO("EnableWatchCPUsage");
    if (!is_numeric($EnableWatchCPUsage)) {
        $EnableWatchCPUsage = 1;
    }
    $SystemWatchMemoryUsage = $sock->GET_INFO("SystemWatchMemoryUsage");
    if (!is_numeric($SystemWatchMemoryUsage)) {
        $SystemWatchMemoryUsage = 75;
    }
    $EnableWatchCPUsage = $sock->GET_INFO("EnableWatchCPUsage");
    if (!is_numeric($EnableWatchCPUsage)) {
        $EnableWatchCPUsage = 1;
    }
    $SystemWatchCPUUser = $sock->GET_INFO("SystemWatchCPUUser");
    if (!is_numeric($SystemWatchCPUUser)) {
        $SystemWatchCPUUser = 80;
    }
    $SystemWatchCPUSystem = $sock->GET_INFO("SystemWatchCPUSystem");
    if (!is_numeric($SystemWatchCPUSystem)) {
        $SystemWatchCPUSystem = 80;
    }
    $EnableLoadAvg1mnUser = $sock->GET_INFO("EnableLoadAvg1mnUser");
    if (!is_numeric($EnableLoadAvg1mnUser)) {
        $EnableLoadAvg1mnUser = 1;
    }
    $EnableLoadAvg5mnUser = $sock->GET_INFO("EnableLoadAvg5mnUser");
    if (!is_numeric($EnableLoadAvg5mnUser)) {
        $EnableLoadAvg5mnUser = 1;
    }
    $EnableLoadAvg15mnUser = $sock->GET_INFO("EnableLoadAvg15mnUser");
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:exec.monit.php

示例7: register

function register()
{
    if ($GLOBALS["VERBOSE"]) {
        echo __FUNCTION__ . "() in line " . __LINE__ . "\n";
    }
    $sock = new sockets();
    $unix = new unix();
    $URIBASE = $unix->MAIN_URI();
    $URIBASE = str_replace("articatech.net", "artica.fr", $URIBASE);
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $cachetime = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    $pid = @file_get_contents($pidfile);
    if ($unix->process_exists($pid)) {
        WriteMyLogs("Already executed PID:{$pid}, die()", __FUNCTION__, __FILE__, __LINE__);
        die;
    }
    $sock = new sockets();
    $EnableKerbAuth = $sock->GET_INFO("EnableKerbAuth");
    if (!is_numeric("{$EnableKerbAuth}")) {
        $EnableKerbAuth = 0;
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "Loading WizardSavedSettings " . __FUNCTION__ . "() in line " . __LINE__ . "\n";
    }
    $WizardSavedSettings = unserialize(base64_decode($sock->GET_INFO("WizardSavedSettings")));
    $WizardSavedSettingsSend = $sock->GET_INFO("WizardSavedSettingsSend");
    if (count($WizardSavedSettings) < 2) {
        if ($GLOBALS["VERBOSE"]) {
            echo "WizardSavedSettings array is less than 2" . __FUNCTION__ . "() in line " . __LINE__ . "\n";
        }
        return;
    }
    if (!isset($WizardSavedSettings["company_name"])) {
        $WizardSavedSettings["company_name"] = null;
    }
    if ($WizardSavedSettings["company_name"] == null) {
        return;
    }
    if (!is_numeric($WizardSavedSettingsSend)) {
        $WizardSavedSettingsSend = 0;
    }
    if ($WizardSavedSettingsSend == 1) {
        if (!$GLOBALS["FORCE"]) {
            if ($GLOBALS["VERBOSE"]) {
                echo "WizardSavedSettingsSend == 1, aborting.. (use --force)" . __FUNCTION__ . "() in line " . __LINE__ . "\n";
            }
            return;
        }
    }
    $uuid = $unix->GetUniqueID();
    if ($uuid == null) {
        if ($GLOBALS["VERBOSE"]) {
            echo "No system ID !\n";
        }
        return;
    }
    $WizardSavedSettings["ACTIVE_DIRECTORY"] = $EnableKerbAuth;
    if ($EnableKerbAuth == 1) {
        include_once dirname(__FILE__) . "/ressources/class.external.ad.inc";
        $ldap = new external_ad_search();
        $NET_RPC_INFOS = $ldap->NET_RPC_INFOS();
        while (list($a, $b) = each($NET_RPC_INFOS)) {
            $WizardSavedSettings[$a] = $b;
        }
    }
    $WizardSavedSettings["UUID"] = $uuid;
    $WizardSavedSettings["CPUS_NUMBER"] = $unix->CPU_NUMBER();
    $WizardSavedSettings["MEMORY"] = $unix->SYSTEM_GET_MEMORY_MB() . "MB";
    $WizardSavedSettings["LINUX_DISTRI"] = $unix->LINUX_DISTRIBUTION();
    $WizardSavedSettings["ARTICAVERSION"] = @file_get_contents("/usr/share/artica-postfix/VERSION");
    $WizardSavedSettings["STATS_APPLIANCE"] = 0;
    if (is_file("/etc/artica-postfix/STATS_APPLIANCE")) {
        $WizardSavedSettings["APPLIANCE"] = "Artica Stats Appliance";
        $WizardSavedSettings["STATS_APPLIANCE"] = 1;
    }
    $zarafa_server = $unix->find_program("zarafa-server");
    if (is_file($zarafa_server)) {
        $WizardSavedSettings["ZARAFA APPLIANCE"] = "YES";
    }
    $squid = $unix->find_program("squid");
    if (is_file($squid)) {
        $WizardSavedSettings["PROXY INSTALLED"] = "YES";
    }
    if (is_file("/etc/artica-postfix/FROM_ISO")) {
        $WizardSavedSettings["FROM ISO"] = "YES";
    }
    if (is_file("/etc/artica-postfix/SQUID_APPLIANCE")) {
        $WizardSavedSettings["APPLIANCE"] = "Artica Proxy";
        $WizardSavedSettings["PROXY APPLIANCE"] = "YES";
    }
    if (is_file("/etc/artica-postfix/SAMBA_APPLIANCE")) {
        $WizardSavedSettings["APPLIANCE"] = "Artica NAS";
        $WizardSavedSettings["N.A.S APPLIANCE"] = "YES";
    }
    if (is_file("/etc/artica-postfix/artica-iso-first-reboot")) {
        $zDate = filemtime("/etc/artica-postfix/artica-iso-first-reboot");
        $WizardSavedSettings["INSTALL_DATE"] = date("Y-m-d H:i:s", $zDate);
    } else {
        $zDate = filemtime("/etc/artica-postfix/.");
        $WizardSavedSettings["INSTALL_DATE"] = date("Y-m-d H:i:s", $zDate);
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:exec.web-community-filter.php


注:本文中的unix::CPU_NUMBER方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。