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


PHP build_progress函数代码示例

本文整理汇总了PHP中build_progress函数的典型用法代码示例。如果您正苦于以下问题:PHP build_progress函数的具体用法?PHP build_progress怎么用?PHP build_progress使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: build_rules

function build_rules()
{
    $q = new mysql_squid_builder();
    $unix = new unix();
    $SQUID_BIN = $unix->LOCATE_SQUID_BIN();
    build_progress("{IT_charter}", 25);
    $sql = "SELECT ID,title FROM itcharters WHERE enabled=1";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        build_progress("{IT_charter} {mysql_error}", 110);
        echo $q->mysql_error;
        return;
    }
    if (mysql_num_rows($results) == 0) {
        @unlink("/etc/squid3/itCharts.enabled.db");
        squid_admin_mysql(1, "Reloading Proxy service (itCharts)", null, __FILE__, __LINE__);
        build_progress("{IT_charter} {reload_proxy_service}", 90);
        system("{$SQUID_BIN} -f /etc/squid3/squid.conf -k reconfigure");
        build_progress("{IT_charter} {done} 0 {item}", 100);
        return;
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        build_progress("{$ligne["title"]}", 50);
        echo "{$ligne["ID"]}: {$ligne["title"]}\n";
        $MAIN[$ligne["ID"]] = $ligne["title"];
    }
    @file_put_contents("/etc/squid3/itCharts.enabled.db", serialize($MAIN));
    squid_admin_mysql(1, "Reloading Proxy service (itCharts)", null, __FILE__, __LINE__);
    build_progress("{IT_charter} {reload_proxy_service}", 90);
    system("{$SQUID_BIN} -f /etc/squid3/squid.conf -k reconfigure");
    build_progress("{IT_charter} {done} " . count($MAIN) . " {items}", 100);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:32,代码来源:exec.itchart.php

示例2: xdisable

function xdisable()
{
    $unix = new unix();
    $sock = new sockets();
    $php = $unix->LOCATE_PHP5_BIN();
    build_progress("{checking} Join to the Active Directory Domain", 15);
    system("{$php} /usr/share/artica-postfix/exec.kerbauth.php --join");
    for ($i = 1; $i < 4; $i++) {
        build_progress("{checking} {waiting} {$i}/3 {seconds}", 20);
        sleep(1);
    }
    build_progress("{checking} Active Directory with wbinfo...", 25);
    $php = $unix->LOCATE_PHP5_BIN();
    wbinfo_if_available();
    if (!wbinfo(true)) {
        build_progress("{checking} Active Directory {failed}", 110);
        return;
    }
    build_progress("{checking} Active Directory...", 30);
    if (!testjoin()) {
        build_progress("{checking} Active Directory {failed}", 110);
        return;
    }
    build_progress("Active Directory...", 50);
    $sock->SET_INFO("KerbAuthWatchEv", 0);
    $sock->SET_INFO("ActiveDirectoryEmergency", 0);
    $sock->SET_INFO("ActiveDirectoryEmergencyReboot", 0);
    $sock->SET_INFO("ActiveDirectoryEmergencyNone", 0);
    build_progress("{reconfigure}...", 80);
    system("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
    build_progress("{done}...", 100);
    if ($GLOBALS["META"]) {
        $unix->THREAD_COMMAND_SET("{$php} /usr/share/artica-postfix/exec.artica-meta-client.php --ping --force");
    }
}
开发者ID:articatech,项目名称:artica,代码行数:35,代码来源:exec.kerbauth.watchdog.php

示例3: xdisable

function xdisable()
{
    $unix = new unix();
    $sock = new sockets();
    $php = $unix->LOCATE_PHP5_BIN();
    build_progress("{checking} Active Directory with wbinfo...", 20);
    if (!wbinfo(true)) {
        build_progress("{checking} Active Directory {failed}", 110);
        return;
    }
    build_progress("{checking} Active Directory...", 30);
    if (!testjoin()) {
        build_progress("{checking} Active Directory {failed}", 110);
        return;
    }
    build_progress("Active Directory...", 50);
    $sock->SET_INFO("KerbAuthWatchEv", 0);
    $sock->SET_INFO("ActiveDirectoryEmergency", 0);
    $sock->SET_INFO("ActiveDirectoryEmergencyReboot", 0);
    $sock->SET_INFO("ActiveDirectoryEmergencyNone", 0);
    build_progress("{reconfigure}...", 80);
    build_progress("{done}...", 100);
    if ($GLOBALS["META"]) {
        $unix->THREAD_COMMAND_SET("{$php} /usr/share/artica-postfix/exec.artica-meta-client.php --ping --force");
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:26,代码来源:exec.kerbauth.watchdog.php

示例4: xstart

function xstart()
{
    $sock = new sockets();
    $unix = new unix();
    $php = $unix->LOCATE_PHP5_BIN();
    $SquidAllow80Port = intval($sock->GET_INFO("SquidAllow80Port"));
    build_progress("{starting} {allow_80443_port}", 15);
    if ($SquidAllow80Port == 1) {
        build_progress("{stopping} {web_service}", 20);
        system("/etc/init.d/apache2 stop");
        build_progress("{stopping} Reverse Proxy", 30);
        system("/etc/init.d/nginx stop");
    } else {
        build_progress("{remove} 80/443 ports", 20);
        $q = new mysql_squid_builder();
        $q->QUERY_SQL("DELETE FROM proxy_ports WHERE `port`='80'");
        build_progress("{remove} 80/443 ports", 25);
        $q->QUERY_SQL("DELETE FROM proxy_ports WHERE `port`='443'");
        build_progress("{reconfigure_proxy_service}", 30);
        $php = $unix->LOCATE_PHP5_BIN();
        shell_exec("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
    }
    build_progress("{restarting_artica_status}", 80);
    system("/etc/init.d/artica-status restart --force");
    build_progress("{done}", 100);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:26,代码来源:exec.squid80443.php

示例5: startx

function startx()
{
    $unix = new unix();
    build_progress(50, "{refresh} CPUS");
    @unlink("/etc/artica-postfix/CPU_NUMBER");
    build_progress(55, "{refresh} CPUS");
    @unlink("/usr/share/artica-postfix/ressources/interface-cache/CPU_NUMBER");
    build_progress(60, "{rescan-disk-system}");
    $dirs = $unix->dirdir("/sys/class/scsi_host");
    $echo = $unix->find_program("echo");
    $udevadm = $unix->find_program("udevadm");
    $php = $unix->LOCATE_PHP5_BIN();
    while (list($dirpath, $line) = each($dirs)) {
        $basename = basename($dirpath);
        if (!preg_match("#host[0-9]+#", $basename)) {
            continue;
        }
        $cmd = "{$echo} \"- - -\" >{$dirpath}/scan";
        build_progress(65, "{rescan-disk-system}" . dirname($dirpath));
        shell_exec($cmd);
    }
    build_progress(70, "{rescan-disk-system}");
    $cmdline = "{$php} /usr/share/artica-postfix/exec.usb.scan.write.php --verbose";
    system($cmd);
    build_progress(80, "{rescan-network-system}");
    system("{$udevadm} control --reload-rules");
    system("{$udevadm} trigger --attr-match=subsystem=net");
    sleep(3);
    system("/usr/share/artica-postfix/bin/process1 --force --verbose --" . time());
    build_progress(100, "{refresh} {done}");
}
开发者ID:articatech,项目名称:artica,代码行数:31,代码来源:exec.system.refresh.php

示例6: start

function start()
{
    $EnableStopPostfix = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/EnableStopPostfix"));
    if ($EnableStopPostfix == 1) {
        build_progress("{stop_messaging} {restarting_watchdog}", 15);
        system("/etc/init.d/artica-status restart --force");
        build_progress("{stop_messaging}", 20);
        system("/etc/init.d/postfix stop");
        build_progress("{stop_messaging}", 30);
        system("/etc/init.d/amavis stop");
        build_progress("{stop_messaging}", 40);
        system("/etc/init.d/milter-greylist stop");
        build_progress("{stop_messaging} {success}", 100);
        return;
    }
    build_progress("{start_messaging} {restarting_watchdog}", 15);
    system("/etc/init.d/artica-status restart --force");
    build_progress("{start_messaging}", 20);
    system("/etc/init.d/postfix start");
    build_progress("{start_messaging}", 30);
    system("/etc/init.d/amavis start");
    build_progress("{start_messaging}", 40);
    system("/etc/init.d/milter-greylist start");
    build_progress("{start_messaging} {success}", 100);
}
开发者ID:articatech,项目名称:artica,代码行数:25,代码来源:exec.postfix.stop.php

示例7: xstart

function xstart()
{
    $unix = new unix();
    $php = $unix->LOCATE_PHP5_BIN();
    $tar = $unix->find_program("tar");
    build_progress("{downloading} roundcubeemail-1.1.2.tar.gz", 20);
    $tmpfile = $unix->FILE_TEMP();
    $curl = new ccurl("http://articatech.net/download/postfix-debian7/roundcubeemail-1.1.2.tar.gz");
    if (!$curl->GetFile($tmpfile)) {
        echo "Failed: " . $curl->error . "\n";
        @unlink($tmpfile);
        build_progress("{failed} roundcubeemail-1.1.2.tar.gz", 110);
        return;
    }
    build_progress("{uncompressing} roundcubeemail-1.1.2.tar.gz", 50);
    system("{$tar} xf {$tmpfile} -C /");
    @unlink($tmpfile);
    if (!is_file("/usr/share/roundcube/index.php")) {
        build_progress("{uncompressing} roundcubeemail-1.1.2.tar.gz {failed}", 110);
        return;
    }
    build_progress("{verify_database}", 60);
    system("{$php} /usr/share/artica-postfix/exec.roundcube.php --database");
    build_progress("{restarting_service}", 70);
    system("{$php} /usr/share/artica-postfix/exec.roundcube.php --restart");
    system("/etc/init.d/artica-status restart");
    build_progress("{installing} roundcubeemail-1.1.2.tar.gz {success}", 100);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:28,代码来源:exec.roundcube.install.php

示例8: restore

function restore($filename)
{
    $unix = new unix();
    $sock = new sockets();
    $TMP = $unix->FILE_TEMP();
    $filenameBase = basename($filename);
    if (!is_file($filename)) {
        echo "{$filename} no such file\n";
        build_progress("{failed}", 110);
    }
    $tmpf = $unix->FILE_TEMP();
    build_progress("{uncompress} {$filenameBase}", 10);
    if (!$unix->uncompress($filename, $tmpf)) {
        @unlink($filename);
        build_progress("{uncompress} {$filenameBase} {failed}", 110);
        return;
    }
    @unlink($filename);
    build_progress("{importing} {$tmpf}", 50);
    $q = new mysql_squid_builder();
    $nice = $unix->EXEC_NICE();
    $mysql = $unix->find_program("mysql");
    $gzip = $unix->find_program("gzip");
    $nohup = $unix->find_program("nohup");
    $echo = $unix->find_program("echo");
    $rm = $unix->find_program("rm");
    $php = $unix->LOCATE_PHP5_BIN();
    $sh[] = "#!/bin/sh";
    $sh[] = "{$echo} \"{$mysql} -> {$filenameBase}\"";
    $sh[] = "{$nice} {$mysql} {$q->MYSQL_CMDLINES} -f squidlogs < {$tmpf}";
    $sh[] = "{$rm} {$TMP}.sh";
    $sh[] = "\n";
    @file_put_contents("{$TMP}.sh", @implode("\n", $sh));
    @chmod("{$TMP}.sh", 0755);
    build_progress(10, "Starting restore {$filenameBase} - " . basename("{$TMP}.sh") . " ");
    system("{$nohup} {$TMP}.sh >{$TMP}.txt 2>&1 &");
    sleep(1);
    $PID = $unix->PIDOF_PATTERN("{$TMP}.sh");
    echo "Running PID {$PID}\n";
    while ($unix->process_exists($PID)) {
        build_progress(50, "Starting restoring {$filenameBase}");
        sleep(3);
        $PID = $unix->PIDOF_PATTERN("{$TMP}.sh");
        echo "Running PID {$PID}\n";
    }
    echo @file_get_contents("{$TMP}.txt") . "\n";
    @unlink("{$TMP}.sh");
    @unlink("{$TMP}.txt");
    build_progress(50, "{restore} {done} {$filenameBase}");
    build_progress(50, "{restore} Analyze Hourly tables");
    system("{$php} /usr/share/artica-postfix/exec.squid.stats.hours.php --force --verbose");
    build_progress(60, "{restore} Repair Hourly tables");
    system("{$php} /usr/share/artica-postfix/exec.squid.stats.hours.php --repair --force --verbose");
    build_progress(70, "{restore} Repair Table days");
    system("{$php} /usr/share/artica-postfix/exec.squid.stats.repair.php --tables-day --repair --force --verbose");
    build_progress(80, "{restore} Repair sums");
    system("{$php} /usr/share/artica-postfix/exec.squid.stats.totals.php --repair --force --verbose");
    build_progress(100, "{restore} Done");
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:59,代码来源:exec.articadb.restore.php

示例9: install

function install($filename)
{
    $GLOBALS["PROGRESS_FILE"] = "/usr/share/artica-postfix/ressources/logs/squid.install.progress";
    $GLOBALS["LOG_FILE"] = "/usr/share/artica-postfix/ressources/logs/web/squid.install.progress.txt";
    $unix = new unix();
    $LINUX_CODE_NAME = $unix->LINUX_CODE_NAME();
    $LINUX_DISTRIBUTION = $unix->LINUX_DISTRIBUTION();
    $LINUX_VERS = $unix->LINUX_VERS();
    $LINUX_ARCHITECTURE = $unix->LINUX_ARCHITECTURE();
    $APACHEUSER = $unix->APACHE_SRC_ACCOUNT();
    $DebianVer = "debian{$LINUX_VERS[0]}";
    $TMP_DIR = $unix->TEMP_DIR();
    $ORGV = @file_get_contents("/usr/share/artica-postfix/VERSION");
    $PATCH_VER = null;
    $tarballs_file = "/usr/share/artica-postfix/ressources/conf/upload/{$filename}";
    echo "Package {$tarballs_file}\n";
    $size = filesize($tarballs_file);
    echo "Size....................: " . FormatBytes($size / 1024) . "\n";
    build_progress("Analyze...", 10);
    echo "Current system..........: {$LINUX_CODE_NAME} {$LINUX_DISTRIBUTION} {$LINUX_VERS[0]}/{$LINUX_VERS[1]} {$LINUX_ARCHITECTURE}\n";
    echo "Package.................: {$filename}\n";
    echo "Temp dir................: {$TMP_DIR}\n";
    if (!is_file($tarballs_file)) {
        echo "{$tarballs_file} no such file...\n";
        build_progress("No such file...", 110);
        return;
    }
    echo "Uncompressing {$tarballs_file}...\n";
    build_progress("{extracting} {$filename}...", 20);
    $chown = $unix->find_program("chown");
    $chmod = $unix->find_program("chmod");
    $tar = $unix->find_program("tar");
    $rm = $unix->find_program("rm");
    $nohup = $unix->find_program("nohup");
    $php = $unix->LOCATE_PHP5_BIN();
    $squid = $unix->LOCATE_SQUID_BIN();
    build_progress("{extracting} {$filename}...", 50);
    system("{$tar} xf {$tarballs_file} -C /");
    echo "Removing {$tarballs_file}...\n";
    @unlink($tarballs_file);
    shell_exec("{$rm} -rf /usr/share/artica-postfix/ressources/conf/upload/*");
    @unlink(dirname(__FILE__) . "/ressources/logs/squid.compilation.params");
    build_progress("{restarting} Squid-cache...", 60);
    system("/etc/init.d/squid restart --force");
    build_progress("{reconfiguring} Squid-cache...", 65);
    system("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
    build_progress("{reconfiguring} {APP_UFDBGUARD}...", 70);
    system("{$php} /usr/share/artica-postfix/exec.squidguard.php --build --force");
    build_progress("{restarting} {APP_C_ICAP}...", 80);
    system("/etc/init.d/c-icap restart");
    build_progress("Refresh local versions...", 90);
    system('/usr/share/artica-postfix/bin/process1 --force --verbose --' . time());
    $squid_version = x_squid_version();
    build_progress("{success} v.{$squid_version}...", 100);
    echo "Starting......: " . date("H:i:s") . " Done you can close the screen....\n";
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:56,代码来源:exec.squid.uncompress.php

示例10: startx

function startx()
{
    build_progress(50, "{refresh} CPUS");
    @unlink("/etc/artica-postfix/CPU_NUMBER");
    build_progress(60, "{refresh} CPUS");
    @unlink("/usr/share/artica-postfix/ressources/interface-cache/CPU_NUMBER");
    build_progress(70, "{refresh} CPUS");
    sleep(3);
    system("/usr/share/artica-postfix/bin/process1 --force --verbose --" . time());
    build_progress(100, "{refresh} {done}");
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:11,代码来源:exec.system.refresh.php

示例11: script_startfile

function script_startfile()
{
    $unix = new unix();
    $sock = new sockets();
    $GLOBALS["echobin"] = $unix->find_program("echo");
    $php = $unix->LOCATE_PHP5_BIN();
    $sh = array();
    $SquidWCCPEnabled = $sock->GET_INFO("SquidWCCPEnabled");
    $hasProxyTransparent = $sock->GET_INFO("hasProxyTransparent");
    $EnableArticaHotSpot = $sock->GET_INFO("EnableArticaHotSpot");
    if (!is_numeric($SquidWCCPEnabled)) {
        $SquidWCCPEnabled = 0;
    }
    if (!is_numeric($hasProxyTransparent)) {
        $hasProxyTransparent = 0;
    }
    if (!is_numeric($EnableArticaHotSpot)) {
        $EnableArticaHotSpot = 0;
    }
    $sh[] = "#!/bin/sh -e";
    $sh[] = "### BEGIN INIT INFO";
    $sh[] = "# Builded on " . date("Y-m-d H:i:s");
    $sh[] = "# Provides:          tproxy";
    $sh[] = "# Required-Start:    \$local_fs";
    $sh[] = "# Required-Stop:     \$local_fs";
    $sh[] = "# Should-Start:\t\t";
    $sh[] = "# Should-Stop:\t\t";
    $sh[] = "# Default-Start:     S";
    $sh[] = "# Default-Stop:      0 6";
    $sh[] = "# Short-Description: start and stop the tproxy";
    $sh[] = "# Description:       Artica tproxy service Raise transparent proxy";
    $sh[] = "### END INIT INFO";
    $sh[] = "case \"\$1\" in";
    $sh[] = "start)";
    $sh[] = "{$GLOBALS["echobin"]} \"TProxy: Removing Iptables rules\"";
    $sh[] = $php . " " . dirname(__FILE__) . "/exec.squid.transparent.delete.php >/dev/null || true";
    $sh[] = "{$GLOBALS["echobin"]} \"TProxy: hasProxyTransparent key ({$hasProxyTransparent})...\"";
    $sh[] = "{$GLOBALS["echobin"]} \"TProxy: SquidWCCPEnabled key ({$SquidWCCPEnabled})...\"";
    $sh[] = "{$GLOBALS["echobin"]} \"TProxy: EnableArticaHotSpot key ({$EnableArticaHotSpot})...\"";
    $sh[] = script_tproxy();
    $sh[] = script_endfile();
    @file_put_contents("/etc/init.d/tproxy", @implode("\n", $sh));
    @chmod("/etc/init.d/tproxy", 0755);
    build_progress("Installing default script...", 40);
    script_install();
    build_progress("Default script...{done}", 50);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:47,代码来源:exec.squid.tproxy.php

示例12: xinstall

function xinstall()
{
    $unix = new unix();
    $curl = new ccurl();
    $tmpfile = $unix->FILE_TEMP();
    $tmpdir = $unix->TEMP_DIR();
    build_progress("{downloading} v3.1.0-25", 15);
    $curl = new ccurl("http://articatech.net/download/UpdateUtility/updateutility-3.1.0-25.tar.gz");
    if (!$curl->GetFile($tmpfile)) {
        @unlink($tmpfile);
        build_progress("{downloading} {failed}", 110);
        return;
    }
    $tar = $unix->find_program("tar");
    $rm = $unix->find_program("rm");
    @mkdir("{$tmpdir}/updateutility", 0755);
    build_progress("{uncompress}", 20);
    shell_exec("{$tar} -xf {$tmpfile} -C {$tmpdir}/updateutility/");
    build_progress("{find_source_directory}", 25);
    $dirs = $unix->dirdir("{$tmpdir}/updateutility");
    $SOURCE_DIRECTORY = null;
    while (list($num, $ligne) = each($dirs)) {
        build_progress("{scanning} {$ligne}", 25);
        if (is_file("{$ligne}/UpdateUtility-Console")) {
            $SOURCE_DIRECTORY = $ligne;
            break;
        }
    }
    if ($SOURCE_DIRECTORY == null) {
        echo "Unable to find source directory\n";
        build_progress("{installing} {failed}", 110);
        shell_exec("{$rm} -rf {$tmpdir}/updateutility");
        return;
    }
    echo "Using directory {$SOURCE_DIRECTORY}\n";
    build_progress("{installing}...", 80);
    $cp = $unix->find_program("cp");
    @mkdir("/etc/UpdateUtility", 0755, true);
    shell_exec("{$cp} -rfv {$SOURCE_DIRECTORY}/* /etc/UpdateUtility/");
    shell_exec("{$rm} -rf {$tmpdir}/updateutility");
    if (!is_file("/etc/UpdateUtility/UpdateUtility-Console")) {
        echo "/etc/UpdateUtility/UpdateUtility-Console no such binary\n";
        build_progress("{installing} {failed}", 110);
    }
    build_progress("{installing} {success}", 100);
}
开发者ID:articatech,项目名称:artica,代码行数:46,代码来源:exec.updateutility.install.php

示例13: compile_progress

function compile_progress()
{
    $unix = new unix();
    build_progress(10, "{build_init_script}");
    initScriptDebian();
    etc_default();
    build_progress(15, "{configure}");
    ParseMimeDefangFilter();
    build_progress(50, "{restarting_artica_status}");
    system("/etc/init.d/artica-status restart --force");
    build_progress(50, "{stopping_service}");
    system("/etc/init.d/mimedefang stop");
    build_progress(80, "{starting_service}");
    system("/etc/init.d/mimedefang start");
    build_progress(90, "{reconfigure_mta}");
    $php = $unix->LOCATE_PHP5_BIN();
    system("{$php} /usr/share/artica-postfix/exec.postfix.maincf.php --milters");
    build_progress(100, "{done}");
}
开发者ID:articatech,项目名称:artica,代码行数:19,代码来源:exec.mimedefang.php

示例14: Start_sync

function Start_sync()
{
    build_progress("{restarting}: Saslauthd", 20);
    system('/etc/init.d/saslauthd restart');
    sleep(2);
    build_progress("{restarting}: Cyrus-Imap", 50);
    system('/etc/init.d/cyrus-imapd restart');
    sleep(2);
    build_progress("{restarting}: Postfix", 80);
    system('/etc/init.d/postfix restart');
    sleep(2);
    build_progress("{listing_mailboxes}", 90);
    $cyrus = new cyrus();
    $mbx = $cyrus->ListMailboxes($cn);
    while (list($num, $box) = each($mbx)) {
        echo "Found Mailbox \"{$num}\"\n";
    }
    sleep(10);
    build_progress("{done}", 100);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:20,代码来源:exec.cyrus.sync.php

示例15: xrun

function xrun()
{
    $unix = new unix();
    build_progress("{enable_service}", 15);
    $vpn = new openvpn();
    $vpn->main_array["GLOBAL"]["ENABLE_SERVER"] = 1;
    @file_put_contents("/etc/artica-postfix/settings/Daemons/EnableOPenVPNServerMode", 1);
    $vpn->Save(true);
    build_progress("{building_configuration}", 50);
    $php = $unix->LOCATE_PHP5_BIN();
    system("{$php} /usr/share/artica-postfix/exec.openvpn.php --server-conf");
    system("{$php} /usr/share/artica-postfix/exec.initslapd.php --openvpn-server");
    build_progress("{restart_service}", 90);
    system("/etc/init.d/openvpn-server restart");
    $pid = PID_NUM();
    if ($unix->process_exists($pid)) {
        build_progress("{done}", 100);
    } else {
        build_progress("{failed}", 100);
    }
}
开发者ID:articatech,项目名称:artica,代码行数:21,代码来源:exec.openvpn.enable.php


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