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


PHP mysql::test_mysql_connection方法代码示例

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


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

示例1: StartBubble

function StartBubble()
{
    $q = new mysql();
    if (!$q->test_mysql_connection()) {
        echo "Starting......: " . date("H:i:s") . " Postfix Bubble Mysql is not ready aborting...\n";
        return;
    }
    $ip = new iptables_exec();
    $ip->buildrules();
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:10,代码来源:exec.postfix.multi.bubble.php

示例2: BuildPatterns

}
if ($argv[1] == "--patterns") {
    BuildPatterns();
    echo "\n";
    die;
}
if ($argv[1] == "--clean-db") {
    CleanDB();
    echo "\n";
    die;
}
//exec.dansguardian.compile.php --patterns
echo "\n";
echo "Starting......: Dansguardian reconfigure settings\n";
$q = new mysql();
if (!$q->test_mysql_connection()) {
    echo "Starting......: Dansguardian Mysql error\n";
    die;
}
$q->CheckTable_dansguardian();
LoadGlobal_exceptionsitelist();
$dans = new dansguardian();
$dans->SaveSettings();
$cmd = LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.web-community-filter.php --patterns{$GLOBALS["cmdlineadd"]}";
events("MAIN:: {$cmd}");
system($cmd);
HtmlTemplate();
BuildPersonalCategories();
bannedsitelist_userdefined();
weightedphraselist_userdefined();
BuildRules();
开发者ID:brucewu16899,项目名称:artica,代码行数:31,代码来源:exec.dansguardian.compile.php

示例3: metaevents_client_scan

function metaevents_client_scan($uuid)
{
    $unix = new unix();
    $sock = new sockets();
    $q = new mysql();
    if (!$q->test_mysql_connection()) {
        return;
    }
    $ArticaMetaStorage = $sock->GET_INFO("ArticaMetaStorage");
    if ($ArticaMetaStorage == null) {
        $ArticaMetaStorage = "/home/artica-meta";
    }
    $destdir = "{$ArticaMetaStorage}/{$uuid}/META_EVENTS";
    $files = $unix->DirFiles($destdir);
    if (!$q->FIELD_EXISTS("meta_admin_mysql", "zmd5", "artica_events")) {
        meta_events("Patching meta_admin_mysql");
        $meta = new mysql_meta();
        $q->QUERY_SQL("DROP TABLE `meta_admin_mysql`", "artica_events");
        $meta->create_table_meta_admin_mysql();
    }
    while (list($filename, $ARRAY) = each($files)) {
        $sourcefile = "{$destdir}/{$filename}";
        $destfile = "{$destdir}/{$filename}.sql";
        meta_events("{$uuid}: Uncompress {$sourcefile}...");
        $unix->uncompress($sourcefile, $destfile);
        if (!is_file($destfile)) {
            continue;
        }
        $q->QUERY_SQL(@file_get_contents($destfile), "artica_events");
        if (!$q->ok) {
            meta_events("{$uuid}:{$q->mysql_error}");
            @unlink($destfile);
            continue;
        }
        @unlink($sourcefile);
        @unlink($destfile);
    }
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:38,代码来源:exec.artica-meta-server.php

示例4: vsftpd_admin_mysql_check

function vsftpd_admin_mysql_check($nopid = false)
{
    $f = array();
    $unix = new unix();
    if ($nopid) {
        $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
        $pid = @file_get_contents($pidfile);
        if ($unix->process_exists($pid)) {
            writelogs("Already running pid {$pid}", __FUNCTION__, __FILE__, __LINE__);
            return;
        }
        $t = 0;
    }
    $sock = new sockets();
    $users = new usersMenus();
    $hostname = $unix->hostname_g();
    $BaseWorkDir = "{$GLOBALS["ARTICALOGDIR"]}/vsftpd_admin_mysql";
    if (!is_dir($BaseWorkDir)) {
        return;
    }
    if (!($handle = opendir($BaseWorkDir))) {
        echo "Failed open {$BaseWorkDir}\n";
        return;
    }
    $hostname = $unix->hostname_g();
    $q = new mysql();
    if (!$q->test_mysql_connection()) {
        return;
    }
    $sql = "CREATE TABLE IF NOT EXISTS `artica_events`.`vsftpd_admin_mysql` (\n\t\t`ID` int(11) NOT NULL AUTO_INCREMENT,\n\t\t`zDate` TIMESTAMP NOT NULL ,\n\t\t`content` MEDIUMTEXT NOT NULL ,\n\t\t`hostname` VARCHAR( 255 ),\n\t\t`subject` VARCHAR( 255 ) NOT NULL ,\n\t\t`function` VARCHAR( 60 ) NOT NULL ,\n\t\t`filename` VARCHAR( 50 ) NOT NULL ,\n\t\t`line` INT( 10 ) NOT NULL ,\n\t\t`severity` smallint( 1 ) NOT NULL ,\n\t\t`TASKID` BIGINT UNSIGNED ,\n\t\tPRIMARY KEY (`ID`),\n\t\t  KEY `zDate` (`zDate`),\n\t\t  KEY `subject` (`subject`),\n\t\t  KEY `hostname` (`hostname`),\n\t\t  KEY `function` (`function`),\n\t\t  KEY `filename` (`filename`),\n\t\t  KEY `severity` (`severity`)\n\t\t) ENGINE=MYISAM;";
    $q->QUERY_SQL($sql, "artica_events");
    if (!$q->ok) {
        echo $q->mysql_error . "\n";
        return;
    }
    while (false !== ($filename = readdir($handle))) {
        if ($filename == ".") {
            continue;
        }
        if ($filename == "..") {
            continue;
        }
        $targetFile = "{$BaseWorkDir}/{$filename}";
        if ($unix->file_time_min($targetFile) > 240) {
            @unlink($targetFile);
            continue;
        }
        $array = unserialize(@file_get_contents($targetFile));
        if (!is_array($array)) {
            @unlink($targetFile);
            continue;
        }
        if (!is_numeric($array["TASKID"])) {
            $array["TASKID"] = 0;
        }
        $content = mysql_escape_string2($array["text"]);
        $subject = mysql_escape_string2($array["subject"]);
        $zdate = $array["zdate"];
        $function = $array["function"];
        $file = $array["file"];
        $line = $array["line"];
        $TASKID = $array["TASKID"];
        $severity = $array["severity"];
        $q->QUERY_SQL("INSERT IGNORE INTO `vsftpd_admin_mysql`\n\t\t\t\t(`zDate`,`content`,`subject`,`function`,`filename`,`line`,`severity`,`hostname`) VALUES\n\t\t\t\t('{$zdate}','{$content}','{$subject}','{$function}','{$file}','{$line}','{$severity}','{$hostname}')", "artica_events");
        if (!$q->ok) {
            return;
        }
        @unlink($targetFile);
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:70,代码来源:exec.syslog-engine.php

示例5: mysql_status

function mysql_status()
{
    $q = new mysql();
    if (!$q->test_mysql_connection()) {
        echo " ********* FAILED **************\n";
        echo $q->mysql_error . "\n";
        echo "\n\nType Enter key to exit.\n";
        $answer = trim(strtolower(fgets(STDIN)));
        menu();
    }
    echo "Connecting to MySQL server success\n";
    echo "MySQL Paramaters:\n*******************************\n";
    echo "MySQL username..: {$q->mysql_admin}\n";
    echo "MySQL Password..: {$q->mysql_password}\n";
    echo "MySQL server....: {$q->mysql_server}\n";
    echo "MySQL Port......: {$q->mysql_port}\n";
    echo "MySQL SocketName: {$q->SocketName}\n";
    echo "\n\nType Enter key to continue.\n";
    $answer = trim(strtolower(fgets(STDIN)));
    $GLOBALS["VERBOSE"] = true;
    $q->BuildTables();
    $GLOBALS["VERBOSE"] = false;
    echo "\n\nType Enter key to exit.\n";
    $answer = trim(strtolower(fgets(STDIN)));
    menu();
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:26,代码来源:exec.users.mysql-menu.php


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