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


PHP progress函数代码示例

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


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

示例1: install_key

function install_key($keyfile)
{
    $path = "/usr/share/artica-postfix/ressources/conf/upload/{$keyfile}";
    $license_bin = "/opt/kaspersky/kav4proxy/bin/kav4proxy-licensemanager";
    $time = time();
    $unix = new unix();
    $pidFile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $pid = $unix->get_pid_from_file($pidFile);
    if ($unix->process_exists($pid)) {
        if ($unix->PROCCESS_TIME_MIN($pid, 10) < 2) {
            progress("{failed} Already running", 110);
            echo "Already runinng PID {$pid}\n";
            return;
        }
    }
    echo "License....: {$path}\n";
    echo "Binary File: {$license_bin}\n";
    if (!is_file($path)) {
        echo "{$path} No such file..\n";
        progress("{failed} {$keyfile} No such file", 110);
        die;
    }
    if (!is_file($license_bin)) {
        echo "{$path} No such file..\n";
        progress("{failed} " . basename($license_bin) . " No such binary", 110);
        @unlink($path);
        die;
    }
    $sock = new sockets();
    $nohup = $unix->find_program("nohup");
    $sock->SET_INFO("kavicapserverEnabled", 1);
    @unlink("/etc/artica-postfix/kav4proxy-licensemanager");
    @unlink("/etc/artica-postfix/kav4proxy-licensemanager-i");
    progress("{removing_old_licenses}", 20);
    system("/opt/kaspersky/kav4proxy/bin/kav4proxy-licensemanager -d a");
    progress("{installing} {$keyfile}", 30);
    $cmd = "/opt/kaspersky/kav4proxy/bin/kav4proxy-licensemanager -c /etc/opt/kaspersky/kav4proxy.conf -a {$path}";
    system($cmd);
    @unlink($path);
    progress("{analyze_license} {$keyfile}", 50);
    shell_exec("/opt/kaspersky/kav4proxy/bin/kav4proxy-licensemanager -i >/etc/artica-postfix/kav4proxy-licensemanager-i 2>&1");
    progress("{stopping_service}", 60);
    echo "/etc/init.d/kav4proxy stop\n";
    system("/etc/init.d/kav4proxy stop");
    progress("{starting_service}", 60);
    echo "/etc/init.d/kav4proxy start\n";
    system("{$nohup} /etc/init.d/kav4proxy start >/dev/null 2>&1 &");
    system("{$nohup} /etc/init.d/artica-status restart --force >/dev/null 2>&1 &");
    progress("{launch_updates}", 70);
    $nohup = $unix->find_program("nohup");
    $php = $unix - LOCATE_PHP5_BIN();
    sleep(2);
    progress("{launch_updates}", 80);
    shell_exec("{$nohup} /usr/share/artica-postfix/exec.keepup2date.php --update --force >/dev/null 2>&1 &");
    sleep(3);
    progress("{success}", 100);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:57,代码来源:exec.kav4proxy.license-manager.php

示例2: disconnect

function disconnect()
{
    $unix = new unix();
    $sock = new sockets();
    progress("Unmout Stastistics Appliance", 20);
    $php = $unix->LOCATE_PHP5_BIN();
    $sock->SET_INFO("EnableSquidRemoteMySQL", 0);
    $sock->SET_INFO("EnableRemoteSyslogStatsAppliance", 0);
    $sock->SET_INFO("RemoteStatisticsApplianceSettings", base64_encode(serialize(array())));
    $sock->SET_INFO("WizardStatsAppliance", base64_encode(serialize(array())));
    $sock->SET_INFO("UseRemoteUfdbguardService", 0);
    progress("{reconfiguring} Proxy service", 30);
    system("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
    progress("{reconfiguring} Web filtering service", 40);
    system("{$php} /usr/share/artica-postfix/exec.squidguard.php --build --force");
    progress("{restarting} Service status", 50);
    system("/etc/init.d/artica-status restart --force");
    progress("{reconfiguring} {tasks}", 60);
    system("{$php} /usr/share/artica-postfix/exec.schedules.php");
    progress("{done}", 100);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:21,代码来源:exec.squid.stats-appliance.disconnect.php

示例3: install

function install()
{
    $filename = "kav4proxy_5.5-88.tar.gz";
    $uri = "http://articatech.net/download/kaspersky/{$filename}";
    $time = time();
    $unix = new unix();
    $pidFile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $pid = $unix->get_pid_from_file($pidFile);
    if ($unix->process_exists($pid)) {
        if ($unix->PROCCESS_TIME_MIN($pid, 10) < 2) {
            return;
        }
    }
    $cacheFile = "/usr/share/artica-postfix/ressources/logs/web/KAV4PROXYINST.status";
    @unlink($cacheFile);
    $rm = $unix->find_program("rm");
    $cp = $unix->find_program("cp");
    $TMPDIR = $unix->TEMP_DIR() . "/{$time}";
    $FINAL_TARGET_DIR = null;
    $TARGET_PATH = "{$TMPDIR}/{$filename}";
    progress("{downloading} 5.5.88 version", "Downloading {$filename}", 30);
    progress("{downloading} 5.5.88 version", "Temporary directory = {$TMPDIR}", 30);
    $curl = new ccurl("{$uri}");
    $debianbin = $unix->find_program("update-rc.d");
    $redhatbin = $unix->find_program("chkconfig");
    @mkdir($TMPDIR);
    if (!$curl->GetFile($TARGET_PATH)) {
        progress("{failed}", $curl->error, 100);
        shell_exec("{$rm} -rf {$TMPDIR}");
        return;
    }
    progress("{downloading} 5.5.88 version {success}", "success saving {$TARGET_PATH} ", 50);
    progress("{extracting} 5.5.88 version", "Extracting {$TARGET_PATH} ", 55);
    $tar = $unix->find_program("tar");
    exec("{$tar} xvf {$TARGET_PATH} -C /{$TMPDIR}/ 2>&1", $results);
    while (list($index, $line) = each($results)) {
        progress("{extracting} 5.5.88 version", $line, 60);
    }
    $dir = $unix->dirdir($TMPDIR);
    while (list($index, $line) = each($dir)) {
        progress("{search} {directory}", $line, 65);
        if (preg_match("#kav4proxy#", $line)) {
            progress("{search} {directory}", "Found directory {$line}", 65);
            $FINAL_TARGET_DIR = $line;
            break;
        }
    }
    if ($FINAL_TARGET_DIR == null) {
        progress("{extracting} 5.5.88 version {failed}", "Unable to find a suitable directory", 100);
        shell_exec("{$rm} -rf {$TMPDIR}");
        return;
    }
    progress("{installing} 5.5.88 version", "Copy the content of {$FINAL_TARGET_DIR}", 70);
    exec("{$cp} -rfdv  {$FINAL_TARGET_DIR}/* / 2>&1", $resultsA);
    while (list($index, $line) = each($resultsA)) {
        progress("{installing} 5.5.88 version", $line, 70);
    }
    progress("{installing} 5.5.88 version", "Removing the {$TMPDIR} directory", 71);
    shell_exec("{$rm} -rf {$TMPDIR}");
    if (!is_file("/opt/kaspersky/kav4proxy/bin/kav4proxy-licensemanager")) {
        progress("{installing} 5.5.88 version {failed}", "install from {$FINAL_TARGET_DIR} failed ", 100);
        return;
    }
    $ln = $unix->find_program("ln");
    $chown = $unix->find_program("chown");
    $chmod = $unix->find_program("chmod");
    progress("{installing} 5.5.88 version", "linking /etc/init.d/kav4proxy", 75);
    shell_exec("ln -s --force /opt/kaspersky/kav4proxy/lib/bin/kav4proxy /etc/init.d/kav4proxy");
    if (is_file($debianbin)) {
        shell_exec("{$debianbin} -f kav4proxy defaults >/dev/null 2>&1");
    }
    if (is_file($redhatbin)) {
        shell_exec("{$redhatbin} --add kav4proxy >/dev/null 2>&1");
    }
    progress("{installing} 5.5.88 version", "executing preinstall", 78);
    exec('/usr/share/artica-postfix/bin/install/kavgroup/kav4prox_predoinst.sh 2>&1', $results2);
    while (list($index, $line) = each($results2)) {
        progress("{installing} 5.5.88 version", $line, 78);
    }
    progress("{installing} 5.5.88 version", "Creating kluser user", 80);
    $unix->CreateUnixUser("kluser", "klusers");
    progress("{installing} 5.5.88 version", "Apply permissions", 85);
    @mkdir("/var/log/kaspersky/kav4proxy", 0755, true);
    @mkdir("/var/run/kav4proxy", 0755, true);
    shell_exec("{$chown} -R kluser:klusers /var/log/kaspersky/kav4proxy");
    shell_exec("{$chown} -R kluser:klusers /var/opt/kaspersky/kav4proxy");
    shell_exec("{$chown} -R kluser:klusers /var/run/kav4proxy");
    shell_exec("{$chown} -R kluser:klusers /var/opt/kaspersky/kav4proxy");
    shell_exec("{$chmod} 0755 /var/opt/kaspersky/kav4proxy");
    $f[] = "EULA_AGREED=yes";
    $f[] = "";
    @file_put_contents("/var/opt/kaspersky/kav4proxy/installer.dat", @implode("\n", $f));
    $f = array();
    $f[] = "CONFIGURE_ENTER_KEY_PATH=";
    $f[] = "KAVMS_SETUP_LICENSE_DOMAINS=*";
    $f[] = "CONFIGURE_KEEPUP2DATE_ASKPROXY=no";
    $f[] = "CONFIGURE_RUN_KEEPUP2DATE=no";
    $f[] = "CONFIGURE_WEBMIN_ASKCFGPATH=";
    $f[] = "KAV4PROXY_SETUP_TYPE=3";
    $f[] = "KAV4PROXY_SETUP_LISTENADDRESS=127.0.0.1:1344";
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:exec.kav4Proxy.install.php

示例4: msg

             }
             $itemid += 1;
         } else {
             $itemid = $fid + $num;
         }
     } else {
         if ($update) {
             $all ? msg('', '?moduleid=' . $moduleid . '&file=' . $file . '&action=index&all=1&one=' . $one) : dmsg('更新成功', $this_forward);
         } else {
             if ($one) {
                 dheader('?file=html&action=back&mid=' . $moduleid);
             }
             $all ? msg($MOD['name'] . '生成成功', $this_forward) : dmsg($MOD['name'] . '生成成功', $this_forward);
         }
     }
     msg('ID从' . $fid . '至' . ($itemid - 1) . $MOD['name'] . ($update ? '更新' : '生成') . '成功' . progress($sid, $fid, $tid), "?moduleid={$moduleid}&file={$file}&action={$action}&sid={$sid}&fid={$itemid}&tid={$tid}&num={$num}&update={$update}&all={$all}&one={$one}");
     break;
 case 'cate':
     $catid or msg('请选择分类');
     isset($num) or $num = 50;
     isset($fid) or $fid = 1;
     $total = max(ceil($CAT['item'] / $MOD['pagesize']), 1);
     if ($fpage && $tpage) {
         $fid = $fpage;
         $num = $tpage - $fpage + 1;
         tohtml('list', $module);
         dmsg('生成成功', $this_forward);
     }
     if ($fid <= $total) {
         tohtml('list', $module);
         msg('第' . $fid . '页至第' . ($fid + $num - 1) . '页生成成功', '?moduleid=' . $moduleid . '&file=' . $file . '&action=' . $action . '&catid=' . $catid . '&fid=' . ($fid + $num) . '&num=' . $num . '&fpage=' . $fpage . '&tpage=' . $tpage);
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:html.inc.php

示例5: Compile_rules

function Compile_rules($NoPersoRules = false)
{
    progress(5, "Cleaning rules");
    if ($GLOBALS["VERBOSE"]) {
        echo __FUNCTION__ . " line:" . __LINE__ . "\n";
    }
    iptables_delete_all();
    $sock = new sockets();
    if ($GLOBALS["VERBOSE"]) {
        echo __FUNCTION__ . " line:" . __LINE__ . "\n";
    }
    $PostFixLimitToNets = $sock->GET_INFO("PostFixLimitToNets");
    if (!is_numeric($PostFixLimitToNets)) {
        $PostFixLimitToNets = 0;
    }
    $EnablePostfixAutoBlockWhiteListed = $sock->GET_INFO("EnablePostfixAutoBlockWhiteListed");
    if (!is_numeric($EnablePostfixAutoBlockWhiteListed)) {
        $EnablePostfixAutoBlockWhiteListed = 0;
    }
    $GlobalIptablesEnabled = $sock->GET_INFO("GlobalIptablesEnabled");
    if (!is_numeric($GlobalIptablesEnabled)) {
        $GlobalIptablesEnabled = 1;
    }
    if ($GlobalIptablesEnabled != 1) {
        if ($GLOBALS["VERBOSE"]) {
            echo "GlobalIptablesEnabled <> 1, aborting...\n";
        }
        return;
    }
    if (!$NoPersoRules) {
        perso(true);
    }
    FW_PERSO_RULES();
    if ($GLOBALS["VERBOSE"]) {
        echo __FUNCTION__ . " line:" . __LINE__ . "\n";
    }
    if ($EnablePostfixAutoBlockWhiteListed == 1) {
        Compile_rules_whitelist();
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "FW_NGINX_RULES\n\n";
    }
    FW_NGINX_RULES(true);
    FW_SPAMHAUS_RULES(true);
    if ($PostFixLimitToNets == 1) {
        Compile_rules_postfix_limitToNets();
        return;
    }
    $unix = new unix();
    $iptables = $unix->find_program("iptables");
    $sock = new sockets();
    if ($GLOBALS["VERBOSE"]) {
        echo __FUNCTION__ . " line:" . __LINE__ . "\n";
    }
    $iptablesClass = new iptables_chains();
    if ($GLOBALS["VERBOSE"]) {
        echo __FUNCTION__ . " line:" . __LINE__ . "\n";
    }
    $InstantIptablesEventAll = $sock->GET_INFO("InstantIptablesEventAll");
    if (!is_numeric($InstantIptablesEventAll)) {
        $InstantIptablesEventAll = 1;
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "InstantIptablesEventAll={$InstantIptablesEventAll}\n";
    }
    if ($GLOBALS["EnablePostfixAutoBlock"] != 1) {
        progress(100, "Building rules done...");
        return;
    }
    events("Query iptables rules from mysql");
    progress(10, "Query rules");
    progress(25, "Building logging rules");
    $sql = "SELECT * FROM iptables WHERE disable=0 AND flux='INPUT' and log=1 AND allow=0 AND local_port=25";
    if ($GLOBALS["VERBOSE"]) {
        echo $sql . "\n";
    }
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, "artica_backup");
    $GLOBALS["IPTABLES_WHITELISTED"] = $iptablesClass->LoadWhiteLists();
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $ip = $ligne["serverip"];
        if ($iptablesClass->isWhiteListed($ip)) {
            if ($GLOBALS["VERBOSE"]) {
                echo "{$ip} is whitelisted\n";
            }
            continue;
        }
        events("LOG {$ligne["serverip"]} REJECT INBOUND PORT 25");
        progress(35, "Building logging rules for {$ip}");
        $cmd = "{$iptables} -A INPUT -s {$ip} -p tcp --destination-port 25 -j LOG --log-prefix \"SMTP DROP: \" -m comment --comment \"ArticaInstantPostfix\"";
        $commands[] = $cmd;
    }
    progress(40, "Building rules...");
    $c = 0;
    $sql = "SELECT * FROM iptables WHERE disable=0 AND flux='INPUT' AND allow=0 AND local_port=25";
    if ($GLOBALS["VERBOSE"]) {
        echo $sql . "\n";
    }
    $results = $q->QUERY_SQL($sql, "artica_backup");
    progress(55, "Building rules...");
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:exec.postfix.iptables.php

示例6: isset

     isset($sid) or $sid = $fid;
     if ($fid <= $tid) {
         $result = $db->query("SELECT itemid FROM {$DT_PRE}news WHERE itemid>={$fid} ORDER BY itemid LIMIT 0,{$num}");
         if ($db->affected_rows($result)) {
             while ($r = $db->fetch_array($result)) {
                 $itemid = $r['itemid'];
                 $do->update($itemid);
             }
             $itemid += 1;
         } else {
             $itemid = $fid + $num;
         }
     } else {
         dmsg('更新成功', "?moduleid={$moduleid}&file={$file}");
     }
     msg('ID从' . $fid . '至' . ($itemid - 1) . '更新成功' . progress($sid, $fid, $tid), "?moduleid={$moduleid}&file={$file}&action={$action}&sid={$sid}&fid={$itemid}&tid={$tid}&num={$num}");
     break;
 case 'recycle':
     $lists = $do->get_list('status=0' . $condition, $dorder[$order]);
     include tpl('news_recycle', $module);
     break;
 case 'check':
     if ($itemid && !$psize) {
         $do->check($itemid);
         dmsg('审核成功', $forward);
     } else {
         $lists = $do->get_list('status=2' . $condition, $dorder[$order]);
         include tpl('news_check', $module);
     }
     break;
 case 'reject':
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:news.inc.php

示例7: restore

function restore()
{
    $sock = new sockets();
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    if ($GLOBALS["VERBOSE"]) {
        echo "PID: {$pidfile}\n";
    }
    $pid = $unix->get_pid_from_file($pidfile);
    if ($unix->process_exists($pid)) {
        $TTL = $unix->PROCESS_TTL($pid);
        if ($TTL < 240) {
            return;
        }
        $kill = $unix->find_program("kill");
        unix_system_kill_force($pid);
    }
    @file_put_contents($pidfile, getmypid());
    $hostname = $unix->hostname_g();
    progress(10, "{mounting}");
    if (!restore_TestNas()) {
        system_admin_events("Mounting NAS filesystem report false", __FUNCTION__, __FILE__, __LINE__);
        progress(100, "{failed}");
        return;
    }
    $BackupArticaRestoreNASIpaddr = $sock->GET_INFO("BackupArticaRestoreNASIpaddr");
    $BackupArticaRestoreNASFolder = $sock->GET_INFO("BackupArticaRestoreNASFolder");
    $BackupArticaRestoreNASUser = $sock->GET_INFO("BackupArticaRestoreNASUser");
    $BackupArticaRestoreNASPassword = $sock->GET_INFO("BackupArticaRestoreNASPassword");
    $BackupArticaRestoreNASFolderSource = $sock->GET_INFO("BackupArticaRestoreNASFolderSource");
    $BackupArticaRestoreNetwork = $sock->GET_INFO("BackupArticaRestoreNetwork");
    $mountPoint = "/mnt/BackupArticaRestoreNAS";
    $BackupArticaRestoreNASFolderSource = str_replace("\\", "/", $BackupArticaRestoreNASFolderSource);
    $sourceDir = "{$mountPoint}/{$BackupArticaRestoreNASFolderSource}";
    $sourceDir = str_replace("//", "/", $sourceDir);
    if (!is_file("{$sourceDir}/BKVERSION.txt")) {
        progress(100, "{failed} BKVERSION.txt no such file");
        $mount = new mount("/var/log/artica-postfix/backup.debug");
        if ($mount->ismounted($mountPoint)) {
            $mount->umount($mountPoint);
        }
        return;
    }
    $time = trim(@file_get_contents("{$sourceDir}/BKVERSION.txt"));
    progress(15, "{backup} " . date("Y-m-d H:i:s"));
    progress(20, "{restoring_ldap_database}, {please_wait}...");
    Restore_ldap($sourceDir);
    progress(40, "{restoring_artica_settings}, {please_wait}...");
    restore_artica_settings($sourceDir);
    progress(50, "{restoring_artica_databases}, {please_wait}...");
    restore_artica_backup($sourceDir);
    progress(60, "{restoring_artica_databases}, {please_wait}...");
    restore_ocsweb($sourceDir);
    progress(80, "{restoring_artica_databases}, {please_wait}...");
    restore_squidlogs($sourceDir);
    progress(82, "{restoring} PowerDNS, {please_wait}...");
    restore_powerdns($sourceDir);
    progress(90, "{reconfigure_server}, {please_wait}...");
    $squidbin = $unix->LOCATE_SQUID_BIN();
    $php = $unix->LOCATE_PHP5_BIN();
    if (is_file($squidbin)) {
        shell_exec("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
    }
    progress(100, "{success}");
    $mount = new mount("/var/log/artica-postfix/backup.debug");
    if ($mount->ismounted($mountPoint)) {
        $mount->umount($mountPoint);
    }
    if ($BackupArticaRestoreNetwork == 1) {
        $unix->THREAD_COMMAND_SET("{$php} /usr/share/artica-postfix/exec.virtuals-ip.php --build");
    }
    return;
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:73,代码来源:exec.backup.artica.php

示例8: print_select_language

/** Prints "Language selection" screen*/
function print_select_language()
{
    progress(10);
    echo "<br><center>\n\t<font class=\"pn-title\">" . _VERSION_WARNING . "</font><br><br>\n<font class=\"pn-title\">" . _SELECT_LANGUAGE_1 . "</font></center>\n<form action=\"install.php\" method=\"post\"><center><table width=\"50%\" align=center><tr>\n<td align=center><font class=\"pn-normal\">" . _SELECT_LANGUAGE_2;
    lang_dropdown();
    echo "<input type=\"hidden\" name=\"op\" value=\"Set Language\">\n<input type=\"submit\" value=\"" . _BTN_SET_LANGUAGE . "\"></font></td></tr>\n</table></center></form>";
}
开发者ID:BackupTheBerlios,项目名称:microbuilder,代码行数:8,代码来源:gui.php

示例9: restore

function restore($filename, $storeid)
{
    $filename = trim($filename);
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".{$filename}.pid";
    $pid = @file_get_contents("{$pidfile}");
    if ($unix->process_exists($pid, basename(__FILE__))) {
        die;
    }
    @file_put_contents($pidfile, getmypid());
    $EnableSyslogDB = @file_get_contents("/etc/artica-postfix/settings/Daemons/EnableSyslogDB");
    if (!is_numeric($EnableSyslogDB)) {
        $EnableSyslogDB = 0;
    }
    @mkdir("/var/log/artica-postfix/squid-brut", 0777, true);
    @mkdir("/var/log/artica-postfix/squid-reverse", 0777, true);
    $GLOBALS["filename"] = $filename;
    $sock = new sockets();
    $TempDir = "/home/artica-extract-temp";
    @mkdir($TempDir, 0777);
    @chown($TempDir, "mysql");
    @chdir($TempDir, "mysql");
    $BackupMaxDaysDir = $sock->GET_INFO("BackupMaxDaysDir");
    $bzip2 = $unix->find_program("bzip2");
    $gunzip = $unix->find_program("gunzip");
    progress("Extract {$filename} from MySQL database into {$TempDir}", 4);
    if ($EnableSyslogDB == 1) {
        $q = new mysql_storelogs();
        $sql = "SELECT filecontent INTO DUMPFILE '{$TempDir}/{$filename}' FROM files_store WHERE ID = '{$storeid}'";
        $q->QUERY_SQL($sql);
    } else {
        $q = new mysql_syslog();
        $sql = "SELECT filedata INTO DUMPFILE '{$TempDir}/{$filename}' FROM store WHERE filename = '{$filename}'";
        $q->QUERY_SQL($sql);
    }
    if (!$q->ok) {
        progress("Failed!!! {$q->mysql_error}", 100);
        return;
    }
    $file_extension = file_extension($filename);
    progress("Extract {$filename} extension: {$file_extension}", 5);
    $newtFile = $filename . ".log";
    if ($file_extension == "bz2") {
        $cmdline = "bzip2 -d \"{$TempDir}/{$filename}\" -c >\"{$TempDir}/{$newtFile}.log\" 2>&1";
        exec($cmdline, $results);
    }
    if ($file_extension == "gz") {
        $cmdline = "gunzip -d \"{$TempDir}/{$filename}\" -c >\"{$TempDir}/{$newtFile}.log\" 2>&1";
    }
    if ($cmdline != null) {
        exec($cmdline, $results);
        progress("Extract done " . @implode(" ", $results), 7);
    } else {
        if (!@copy("{$TempDir}/{$filename}", "{$TempDir}/{$newtFile}.log")) {
            progress("Failed!!! Copy error", 100);
            return;
        }
    }
    @unlink("{$TempDir}/{$filename}");
    if (!is_file("{$TempDir}/{$newtFile}.log")) {
        progress("Failed!!! {$TempDir}/{$newtFile}.log error no such file", 100);
        return;
    }
    $linesNumber = $unix->COUNT_LINES_OF_FILE("{$TempDir}/{$newtFile}.log");
    progress("Open {$TempDir}/{$newtFile}.log {$linesNumber}", 10);
    $handle = @fopen("{$TempDir}/{$newtFile}.log", "r");
    if (!$handle) {
        progress("Failed!!! {$TempDir}/{$newtFile}.log open failed", 100);
        return;
    }
    $c = 0;
    $d = 0;
    $TTEV = 0;
    while (!feof($handle)) {
        $c++;
        $buffer = trim(fgets($handle, 4096));
        if (!preg_match("#MAC:.*?\\[([0-9]+)\\/(.*?)\\/([0-9]+).*?:([0-9]+):([0-9]+):([0-9]+)\\s+(.*?)\\]\\s+\"#", $buffer, $re)) {
            continue;
        }
        $dteStr = "{$re[1]}/{$re[2]}/{$re[3]}:{$re[4]}:{$re[5]}:{$re[6]} {$re[7]}";
        $ttime = strtotime($dteStr);
        $newDate = date("Y-m-d H", $ttime) . "h";
        $datelog = date("Y-m-d-h", $ttime);
        $MD5Buffer = md5($buffer);
        $TTEV++;
        @mkdir("/var/log/artica-postfix/squid-brut/{$datelog}", 0777, true);
        @file_put_contents("/var/log/artica-postfix/squid-brut/{$datelog}/{$MD5Buffer}", $buffer);
        if ($c > 10) {
            $d = $d + $c;
            $pp = $d / $linesNumber;
            $pp = $pp * 100;
            $pp = round($pp, 1);
            if ($pp > 10) {
                if ($pp > 100) {
                    $pp = 99;
                }
                progress("Processing {$d}/{$linesNumber} - {$newDate} ", $pp);
                $c = 0;
            }
        }
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:exec.squid.restoresrc.php

示例10: visited_sites

function visited_sites()
{
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/squid.visited_sites_rescan.pid";
    $pid = @file_get_contents($pidfile);
    if ($pid < 100) {
        $pid = null;
    }
    $t = time();
    if ($unix->process_exists($pid, basename(__FILE__))) {
        $time = $unix->PROCCESS_TIME_MIN($pid);
        if ($GLOBALS["VERBOSE"]) {
            echo "Already executed pid {$pid} since {$time}mn\n";
        }
        die;
    }
    $mypid = getmypid();
    @file_put_contents($pidfile, $mypid);
    stats_admin_events(2, "Starting table visited_sites", "", __FILE__, __LINE__);
    progress("Starting table visited_sites", 5);
    $q = new mysql_squid_builder();
    $sql = "SELECT sitename FROM visited_sites WHERE LENGTH(category)=0";
    $results = $q->QUERY_SQL($sql);
    $num_rows = mysql_num_rows($results);
    $took = $unix->distanceOfTimeInWords($t, time());
    stats_admin_events(2, "Query done {$num_rows} websites to scan", "took:{$took}", __FILE__, __LINE__);
    if ($num_rows == 0) {
        progress(null, 100);
        return;
    }
    progress("Query done {$num_rows} websites to scan", 10);
    $c = 0;
    $t = 0;
    $d = 0;
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $sitenameOrg = $ligne["sitename"];
        $sitename = strtolower(trim($sitenameOrg));
        if (badCharacters($sitename)) {
            $q->categorize_reaffected($sitename);
            $sitenameOrg = mysql_escape_string2($sitenameOrg);
            $q->QUERY_SQL("UPDATE visited_sites SET category='reaffected' WHERE `sitename`='{$sitenameOrg}'");
            if (!$q->ok) {
                progress("Fatal", 100);
                die;
            }
            $d++;
            $c++;
            continue;
        }
        if (strpos($sitename, ".") == 0) {
            $q->categorize_reaffected($sitename);
            $sitenameOrg = mysql_escape_string2($sitenameOrg);
            $q->QUERY_SQL("UPDATE visited_sites SET category='reaffected' WHERE `sitename`='{$sitenameOrg}'");
            if (!$q->ok) {
                progress("Fatal", 100);
                die;
            }
            $d++;
            $c++;
            continue;
        }
        if (preg_match("#[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\$#", $sitename)) {
            $sitename = gethostbyaddr($sitename);
            if (preg_match("#[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\$#", $sitename)) {
                $c++;
                continue;
            }
        }
        $ipaddr = gethostbyname($sitename);
        if (!preg_match("#[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\$#", $ipaddr)) {
            $q->categorize_reaffected($sitenameOrg);
            $q->QUERY_SQL("UPDATE visited_sites SET category='reaffected' WHERE `sitename`='{$sitenameOrg}'");
            if (!$q->ok) {
                progress("Fatal", 100);
                die;
            }
            $d++;
            $c++;
            continue;
        }
        $cat = $q->GET_CATEGORIES($sitename);
        if ($cat != null) {
            $d++;
            $q->QUERY_SQL("UPDATE visited_sites SET category='{$cat}' WHERE `sitename`='{$sitenameOrg}'");
            if (!$q->ok) {
                progress("Fatal", 100);
                die;
            }
        }
        $c++;
        if ($c > 50) {
            $t = $t + $c;
            $purc = $t / $num_rows;
            $purc = round($purc, 2) * 100;
            $c = 0;
            if ($purc > 10) {
                progress("{$sitename} {$t}/{$num_rows}", $purc);
            }
        }
    }
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:exec.squid.visited.sites.php

示例11: usersMenus

	include_once('ressources/class.artica.inc');
	include_once('ressources/class.ini.inc');
	include_once('ressources/class.squid.inc');
	include_once('ressources/class.system.network.inc');
	
	
	$user=new usersMenus();
	if($user->AsWebStatisticsAdministrator==false){
		$tpl=new templates();
		echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
		die();exit();
	}	
	
	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_GET["summarize"])){summarize();exit;}
	if(isset($_GET["progress"])){progress();exit;}
js();

function js(){
	$t=time();
	$tpl=new templates();
	$title=$tpl->_ENGINE_parse_body("{category_database_update}");
	$page=CurrentPageName();
	
	$html="
		function start$t(){
			YahooWinS('550','$page?popup=yes&t=$t','$title');
		
		}
		
		
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:29,代码来源:squid.blacklist.upd.php

示例12: creatureGrid

}
.progress-0 {background-image: none;}
.progress-10 {background-position: -675px 0;}
.progress-20 {background-position: -600px 0;}
.progress-30 {background-position: -525px 0;}
.progress-40 {background-position: -450px 0;}
.progress-50 {background-position: -375px 0;}
.progress-60 {background-position: -300px 0;}
.progress-70 {background-position: -225px 0;}
.progress-80 {background-position: -150px 0;}
.progress-90 {background-position: -75px 0;}
.progress-100 {background-position: 0 0;}
</style>
<?php 
creatureGrid($creature_results);
?>
<br>
<?php 
// Detailed view
$i = 0;
foreach ($creature_results as $r) {
    $underscore = str_replace(' ', '_', $r['name']);
    echo "<div class='div center' id='{$underscore}'>";
    cards($r);
    echo '<br>';
    progress($r['progress'], $r);
    echo '</div>';
    $i++;
}
disqus('Ancient Beast - Bestiary');
include '../footer.php';
开发者ID:mchelen,项目名称:AncientBeast,代码行数:31,代码来源:index.php

示例13: dmsg

                 $db->query("UPDATE {$DT_PRE}know_expert SET passport='{$passport}' WHERE username='{$username}'");
                 $db->query("UPDATE {$DT_PRE}know_vote SET passport='{$passport}' WHERE username='{$username}'");
                 $db->query("UPDATE {$DT_PRE}club SET passport='{$passport}' WHERE username='{$username}'");
                 $db->query("UPDATE {$DT_PRE}club_fans SET passport='{$passport}' WHERE username='{$username}'");
                 $db->query("UPDATE {$DT_PRE}club_group SET passport='{$passport}' WHERE username='{$username}'");
                 $db->query("UPDATE {$DT_PRE}club_reply SET passport='{$passport}' WHERE username='{$username}'");
                 $db->query("UPDATE {$DT_PRE}club SET replyer='{$passport}' WHERE replyuser='{$username}'");
             }
             $userid += 1;
         } else {
             $userid = $fid + $num;
         }
     } else {
         dmsg('更新成功', $this_forward);
     }
     msg('ID从' . $fid . '至' . ($userid - 1) . '昵称更新成功' . progress($sid, $fid, $tid), "?moduleid={$moduleid}&file={$file}&action={$action}&sid={$sid}&fid={$userid}&tid={$tid}&num={$num}&all={$all}&one={$one}");
     break;
 case 'cate':
     $catid or msg('请选择分类');
     isset($num) or $num = 50;
     isset($fid) or $fid = 1;
     $total = max(ceil($CAT['item'] / $MOD['pagesize']), 1);
     if ($fpage && $tpage) {
         $fid = $fpage;
         $num = $tpage - $fpage + 1;
         tohtml('list', $module);
         dmsg('生成成功', $this_forward);
     }
     if ($fid <= $total) {
         tohtml('list', $module);
         msg('第' . $fid . '页至第' . ($fid + $num - 1) . '页生成成功', '?moduleid=' . $moduleid . '&file=' . $file . '&action=' . $action . '&catid=' . $catid . '&fid=' . ($fid + $num) . '&num=' . $num . '&fpage=' . $fpage . '&tpage=' . $tpage);
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:html.inc.php

示例14: download

function download()
{
    progress("Downloading index file", 10);
    $curl = new ccurl("http://www.articatech.net/auto.update.php");
    $curl->NoHTTP_POST = true;
    if (!$curl->get()) {
        progress("Failed download index file", 110);
        return null;
    }
    $ini = new Bs_IniHandler();
    $ini->loadString($curl->data);
    $owncloudversion = $ini->_params["NEXT"]["owncloud"];
    if ($owncloudversion == null) {
        progress("Failed corrupted index file", 110);
        return null;
    }
    progress("Owncloud version {$owncloudversion}", 15);
    return "http://www.articatech.net/download/owncloud-{$owncloudversion}.tar.gz";
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:19,代码来源:compile-owncloud.php

示例15: isset

     }
     isset($num) or $num = 2;
     isset($sid) or $sid = $fid;
     isset($itemid) or $itemid = 1;
     if ($fid <= $tid) {
         $result = $db->query("SELECT * FROM {$table} WHERE pid>={$fid} AND username='{$username}' ORDER BY pid LIMIT 0,{$num} ");
         if ($db->affected_rows($result)) {
             while ($r = $db->fetch_array($result)) {
                 $itemid = $r['pid'];
                 delete_upload($r['fileurl'], 0);
             }
             $itemid += 1;
         } else {
             $itemid = $fid + $num;
         }
         msg('ID从' . $fid . '至' . ($itemid - 1) . '删除成功' . progress($sid, $fid, $tid), "?file={$file}&action={$action}&username={$username}&id={$id}&sid={$sid}&fid={$itemid}&tid={$tid}&num={$num}");
     } else {
         dmsg('删除成功', "?file={$file}");
     }
 } else {
     if ($u) {
         $id = $u['userid'] % 10;
     } else {
         for ($i = 0; $i < 10; $i++) {
             $t = $db->get_one("SELECT itemid FROM {$DT_PRE}upload_{$i} WHERE username='{$username}'");
             if ($t) {
                 $id = $i;
                 break;
             }
         }
         if ($id == -1) {
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:upload.inc.php


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