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


PHP pg_close函数代码示例

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


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

示例1: all_reset

function all_reset($baseDir)
{
    //Очищаем временную папку temp
    if (file_exists($baseDir . 'tempFiles')) {
        foreach (glob($baseDir . 'tempFiles/*') as $file) {
            unlink($file);
        }
    }
    //Очищаем временную папку для граббера
    if (file_exists($baseDir . 'tempGrab')) {
        foreach (glob($baseDir . 'tempGrab/*') as $file) {
            unlink($file);
        }
    }
    //Очищаем временную папку для куков
    if (file_exists($baseDir . 'cookies')) {
        foreach (glob($baseDir . 'cookies/*') as $file) {
            unlink($file);
        }
    }
    //Приводим все ключи "в обработке" к состоянию "в ожидании"
    $dbconn = pg_connect(DB_CONN_STR) or die('Не могу подключиться к БД: ' . pg_last_error());
    //Сбросить "занятые" аккаунты
    $query = 'UPDATE accounts SET busy=0 ' . "WHERE busy=1";
    pg_query($query) or die('Ошибка запроса: ' . pg_last_error());
    //Сбросить "занятые" прокси
    $query = 'UPDATE proxys SET busy=0 ' . "WHERE busy=1";
    pg_query($query) or die('Ошибка запроса: ' . pg_last_error());
    pg_close($dbconn);
}
开发者ID:hxhxd,项目名称:ggkprun,代码行数:30,代码来源:startDaemon.php

示例2: disconnect

 function disconnect()
 {
     if (!empty($this->db)) {
         pg_close($this->db);
         $this->db = null;
     }
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:7,代码来源:BucketDb_PgSQL.php

示例3: disconnect

 /**
  * @return PgSQL
  **/
 public function disconnect()
 {
     if ($this->isConnected()) {
         pg_close($this->link);
     }
     return $this;
 }
开发者ID:justthefish,项目名称:hesper,代码行数:10,代码来源:PgSQL.php

示例4: disconnect

 public function disconnect()
 {
     if ($this->connection) {
         pg_close($this->connection);
         $this->connection = NULL;
     }
 }
开发者ID:jasir,项目名称:dbal,代码行数:7,代码来源:PgsqlDriver.php

示例5: disconnect

 function disconnect()
 {
     if (pg_close($this->connection)) {
         return 1;
     }
     return 0;
 }
开发者ID:Return-To-The-Roots,项目名称:s2map-php,代码行数:7,代码来源:pgsql.php

示例6: __destruct

 function __destruct()
 {
     if ($this->is_connected()) {
         $this->query('ROLLBACK');
         pg_close($this->db);
     }
 }
开发者ID:BackupTheBerlios,项目名称:igoan,代码行数:7,代码来源:Igoandb.class.php

示例7: getDetails

function getDetails($ptdb, $id, $type, $langs, $offset)
{
    global $format, $callback;
    // request
    $wikipediarequest = "SELECT\n\t\t\t\t\t\t\t\tfoo.keys, foo.values\n\t\t\t\t\t\t\tFROM (\n\t\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t\t\tskeys(tags) AS keys,\n\t\t\t\t\t\t\t\t\tsvals(tags) AS values\n\t\t\t\t\t\t\t\tFROM " . $type . "s\n\t\t\t\t\t\t\t\tWHERE (id = " . $id . ")\n\t\t\t\t\t\t\t) AS foo\n\t\t\t\t\t\t\tWHERE substring(foo.keys from 1 for 9) = 'wikipedia';";
    $namerequest = "SELECT\n\t\t\t\t\t\t\t\tfoo.keys, foo.values\n\t\t\t\t\t\t\tFROM (\n\t\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t\t\tskeys(tags) AS keys,\n\t\t\t\t\t\t\t\t\tsvals(tags) AS values\n\t\t\t\t\t\t\t\tFROM " . $type . "s\n\t\t\t\t\t\t\t\tWHERE (id = " . $id . ")\n\t\t\t\t\t\t\t) AS foo\n\t\t\t\t\t\t\tWHERE substring(foo.keys from 1 for 4) = 'name';";
    // connnecting to database
    $connection = connectToDatabase($ptdb);
    // if there is no connection
    if (!$connection) {
        exit;
    }
    $wikipediaresponse = requestDetails($wikipediarequest, $connection);
    $nameresponse = requestDetails($namerequest, $connection);
    pg_close($connection);
    $response = tagTransform("../locales/departures.xml", getTags($ptdb, $id, $type), $type);
    if ($response) {
        if ($format == "text") {
            echo textDetailsOut($response, $nameresponse, $wikipediaresponse, $langs, $offset);
        } else {
            if ($format == "json") {
                echo jsonDetailsOut($response, $nameresponse, $wikipediaresponse, $langs, $offset, $id, $type, $callback);
            } else {
                echo xmlDetailsOut($response, $nameresponse, $wikipediaresponse, $langs, $offset, $id, $type);
            }
        }
        return true;
    } else {
        return false;
    }
}
开发者ID:dieterdreist,项目名称:OpenLinkMap,代码行数:31,代码来源:ptdetails.php

示例8: consulta

 public function consulta($aux)
 {
     $auxcon = $this->conectar();
     $resultado = pg_query($aux) or die('La consulta fallo: ' . pg_last_error());
     pg_close($auxcon);
     return $resultado;
 }
开发者ID:RFDO93,项目名称:proyecto,代码行数:7,代码来源:cls_conexion.php

示例9: wsoBruteForce

 function wsoBruteForce($ip, $port, $login, $pass)
 {
     $str = "host='" . $ip . "' port='" . $port . "' user='" . $login . "' password='" . $pass . "' dbname=postgres";
     $res = @pg_connect($str);
     @pg_close($res);
     return $res;
 }
开发者ID:santatic,项目名称:brute-dict,代码行数:7,代码来源:brute.php

示例10: execute

 /**
  *
  * @param type $query
  * @param type $type
  * @return type
  */
 public function execute($query, $type = null)
 {
     $result = array();
     switch ($this->db_engine) {
         case "pgsql":
             $resultado = pg_query($this->conn, $query);
             while ($row = pg_fetch_row($resultado)) {
                 $result[] = $row;
             }
             pg_close($this->conn);
             break;
         case "mssql":
             $resultado = odbc_exec($this->conn, $query);
             while ($row = odbc_fetch_array($resultado)) {
                 $result[] = $row;
             }
             break;
         case "mysql":
             $result = array();
             $resultado = mysql_query($query);
             if (gettype($resultado) == "boolean") {
                 $result = $resultado;
             } else {
                 while ($row = mysql_fetch_row($resultado)) {
                     $result[] = $row;
                 }
             }
             mysql_close($this->conn);
             break;
     }
     return $result;
 }
开发者ID:emildev35,项目名称:distribuidos,代码行数:38,代码来源:Conexion.php

示例11: close

 /**
  * {@inheritdoc}
  */
 public function close()
 {
     if ($this->dbHandle) {
         \pg_close($this->dbHandle);
         $this->dbHandle = null;
     }
 }
开发者ID:sugiphp,项目名称:database,代码行数:10,代码来源:PgSqlDriver.php

示例12: close_conn

 public static function close_conn()
 {
     if (self::$is_conn_set) {
         pg_close(self::$conn);
         self::$is_conn_set = false;
     }
 }
开发者ID:jls14,项目名称:SpireSessions,代码行数:7,代码来源:ConnDB.php

示例13: auth

function auth($bazaj, $uid, $puid)
{
    $uid_s = pg_escape_string($uid);
    $puid_s = pg_escape_string($puid);
    $res = pg_query($bazaj, "select username, password from users where username='{$uid_s}' and password='{$puid_s}'");
    if (!$res) {
        print "<h2>STOP: Internal system error. Please refresh this page.</h2>";
        exit;
    }
    if (pg_num_rows($res) != 1) {
        return "f";
    }
    $row = pg_fetch_row($res);
    $j_uid = $row[0];
    $j_puid = $row[1];
    if ($j_uid != $uid) {
        pg_close($bazaj);
        return "f";
    } else {
        if ($puid_s === $j_puid) {
            return "t";
        } else {
            return "f";
        }
    }
    return "f";
}
开发者ID:jeidee,项目名称:ejabberd-modules,代码行数:27,代码来源:func.php

示例14: getJSON

 public function getJSON()
 {
     $conn = getConnection();
     $taskid = array_key_exists("taskid", $_GET) ? $_GET["taskid"] : "";
     if (empty($taskid)) {
         $taskid = array_key_exists("taskid", $_POST) ? $_POST["taskid"] : "";
     }
     $year = array_key_exists("year", $_GET) ? $_GET["year"] : "";
     if (empty($year)) {
         $year = array_key_exists("year", $_POST) ? $_POST["year"] : "";
     }
     $quarter = array_key_exists("quarter", $_GET) ? $_GET["quarter"] : "";
     if (empty($quarter)) {
         $quarter = array_key_exists("quarter", $_POST) ? $_POST["quarter"] : "";
     }
     $yearquarter = $year * 10 + $quarter;
     $sql = "SELECT SUM(personnel_actual) AS personnel,\n\t\t\t       SUM(investments_actual) AS investments, \n\t\t\t       SUM(consumables_actual) AS consumables, \n\t\t\t       SUM(services_actual) AS services, \n\t\t\t       SUM(transport_actual) AS transport,\n\t\t\t       SUM(admin) AS admin\n\t\t\tFROM budget \n\t\t\tWHERE task_id = " . (empty($taskid) ? 0 : $taskid) . " \n\t\t\t  AND (year * 10) + quarter < " . $yearquarter . "\n\t\t\t  AND status = 3";
     $output = array();
     $output["taskid"] = $taskid;
     $result = pg_query($conn, $sql);
     if ($result && pg_num_rows($result) > 0) {
         $row = pg_fetch_array($result);
         $output["personnel"] = $row["personnel"];
         $output["investments"] = $row["investments"];
         $output["consumables"] = $row["consumables"];
         $output["services"] = $row["services"];
         $output["transport"] = $row["transport"];
         $output["admin"] = $row["admin"];
     }
     return json_encode($output);
     pg_close($conn);
     return $output;
 }
开发者ID:sasscaloadc,项目名称:budget,代码行数:33,代码来源:load_expenses.php

示例15: getDetails

function getDetails($db, $id, $type, $langs, $offset)
{
    global $format;
    global $callback;
    // request
    $request = "SELECT\n\t\t\t\ttags->'addr:street' AS \"street\",\n\t\t\t\ttags->'addr:housenumber' AS \"housenumber\",\n\t\t\t\ttags->'addr:country' AS \"country\",\n\t\t\t\ttags->'addr:postcode' AS \"postcode\",\n\t\t\t\ttags->'addr:city' AS \"city\",\n\t\t\t\ttags->'addr:housename' AS \"housename\",\n\t\t\t\ttags->'addr:suburb' AS \"suburb\",\n\t\t\t\ttags->'addr:province' AS \"province\",\n\t\t\t\ttags->'addr:unit' AS \"unit\",\n\t\t\t\ttags->'addr:floor' AS \"floor\",\n\t\t\t\ttags->'addr:door' AS \"door\",\n\t\t\t\ttags->'wikipedia' AS \"wikipedia\",\n\t\t\t\ttags->'phone' AS \"phone1\",\n\t\t\t\ttags->'contact:phone' AS \"phone2\",\n\t\t\t\ttags->'addr:phone' AS \"phone3\",\n\t\t\t\ttags->'phone:mobile' AS \"mobilephone1\",\n\t\t\t\ttags->'contact:mobile' AS \"mobilephone2\",\n\t\t\t\ttags->'fax' AS \"fax1\",\n\t\t\t\ttags->'contact:fax' AS \"fax2\",\n\t\t\t\ttags->'addr:fax' AS \"fax3\",\n\t\t\t\ttags->'website' AS \"website1\",\n\t\t\t\ttags->'url' AS \"website2\",\n\t\t\t\ttags->'url:official' AS \"website3\",\n\t\t\t\ttags->'contact:website' AS \"website4\",\n\t\t\t\ttags->'operator' AS \"operator\",\n\t\t\t\ttags->'email' AS \"email1\",\n\t\t\t\ttags->'contact:email' AS \"email2\",\n\t\t\t\ttags->'addr:email' AS \"email3\",\n\t\t\t\ttags->'opening_hours' AS \"openinghours\",\n\t\t\t\ttags->'service_times' AS \"servicetimes\",\n\t\t\t\ttags->'fee' AS \"fee\",\n\t\t\t\ttags->'toll' AS \"toll\",\n\t\t\t\ttags->'ref' AS \"ref\",\n\t\t\t\ttags->'capacity' AS \"capacity\",\n\t\t\t\ttags->'internet_access' AS \"internet_access\",\n\t\t\t\ttags->'image' AS \"image\",\n\t\t\t\ttags->'image:panorama' AS \"panorama\",\n\t\t\t\ttags->'description' AS \"description\",\n\t\t\t\ttags->'stars' AS \"stars\",\n\t\t\t\ttags->'cuisine' AS \"cuisine\",\n\t\t\t\ttags->'smoking' AS \"smoking\",\n\t\t\t\ttags->'biergarten' AS \"biergarten\",\n\t\t\t\ttags->'beer_garden' AS \"beer_garden\",\n\t\t\t\ttags->'brewery' AS \"beer\",\n\t\t\t\ttags->'microbrewery' AS \"microbrewery\",\n\t\t\t\ttags->'fuel:diesel' AS \"diesel\",\n\t\t\t\ttags->'fuel:GTL_diesel' AS \"gtldiesel\",\n\t\t\t\ttags->'fuel:HGV_diesel' AS \"hgvdiesel\",\n\t\t\t\ttags->'fuel:biodiesel' AS \"biodiesel\",\n\t\t\t\ttags->'fuel_octane_91' AS \"octane91\",\n\t\t\t\ttags->'fuel:octane_95' AS \"octane95\",\n\t\t\t\ttags->'fuel:octane_98' AS \"octane98\",\n\t\t\t\ttags->'fuel:octane_100' AS \"octane100\",\n\t\t\t\ttags->'fuel:octane_98_leaded' AS \"octane98l\",\n\t\t\t\ttags->'fuel:1_25' AS \"fuel25\",\n\t\t\t\ttags->'fuel:1_50' AS \"fuel50\",\n\t\t\t\ttags->'fuel:alcohol' AS \"alcohol\",\n\t\t\t\ttags->'fuel:ethanol' AS \"ethanol\",\n\t\t\t\ttags->'fuel:methanol' AS \"methanol\",\n\t\t\t\ttags->'fuel:svo' AS \"svo\",\n\t\t\t\ttags->'fuel:e85' AS \"e85\",\n\t\t\t\ttags->'fuel:biogas' AS \"biogas\",\n\t\t\t\ttags->'fuel:lpg' AS \"lpg\",\n\t\t\t\ttags->'fuel:cng' AS \"cng\",\n\t\t\t\ttags->'fuel:LH2' AS \"lh2\",\n\t\t\t\ttags->'fuel:electricity' AS \"electro\",\n\t\t\t\ttags->'fuel:adblue' AS \"adblue\",\n\t\t\t\ttags->'car_wash' AS \"carwash\",\n\t\t\t\ttags->'car_repair' AS \"carrepair\",\n\t\t\t\ttags->'shop' AS \"shop\",\n\t\t\t\ttags->'kiosk' AS \"kiosk\",\n\t\t\t\ttags->'ele' AS \"ele\",\n\t\t\t\ttags->'population' AS \"population\",\n\t\t\t\ttags->'iata' AS \"iata\",\n\t\t\t\ttags->'icao' AS \"icao\",\n\t\t\t\ttags->'disused' AS \"disused\",\n\t\t\t\ttags->'wheelchair' AS \"wheelchair\",\n\t\t\t\ttags->'wheelchair:toilets' AS \"wheelchair:toilets\",\n\t\t\t\ttags->'wheelchair:rooms' AS \"wheelchair:rooms\",\n\t\t\t\ttags->'wheelchair:access' AS \"wheelchair:access\",\n\t\t\t\ttags->'wheelchair:places' AS \"wheelchair:places\"\n\t\t\tFROM " . $type . "s WHERE (id = " . $id . ");";
    $wikipediarequest = "SELECT\n\t\t\t\t\t\t\t\tfoo.keys, foo.values\n\t\t\t\t\t\t\tFROM (\n\t\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t\t\tskeys(tags) AS keys,\n\t\t\t\t\t\t\t\t\tsvals(tags) AS values\n\t\t\t\t\t\t\t\tFROM " . $type . "s\n\t\t\t\t\t\t\t\tWHERE (id = " . $id . ")\n\t\t\t\t\t\t\t) AS foo\n\t\t\t\t\t\t\tWHERE substring(foo.keys from 1 for 9) = 'wikipedia';";
    $namerequest = "SELECT\n\t\t\t\t\t\t\t\tfoo.keys, foo.values\n\t\t\t\t\t\t\tFROM (\n\t\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t\t\tskeys(tags) AS keys,\n\t\t\t\t\t\t\t\t\tsvals(tags) AS values\n\t\t\t\t\t\t\t\tFROM " . $type . "s\n\t\t\t\t\t\t\t\tWHERE (id = " . $id . ")\n\t\t\t\t\t\t\t) AS foo\n\t\t\t\t\t\t\tWHERE substring(foo.keys from 1 for 4) = 'name';";
    // connnecting to database
    $connection = connectToDatabase($db);
    // if there is no connection
    if (!$connection) {
        exit;
    }
    $response = requestDetails($request, $connection);
    $wikipediaresponse = requestDetails($wikipediarequest, $connection);
    $nameresponse = requestDetails($namerequest, $connection);
    pg_close($connection);
    if ($response) {
        if ($format == "text") {
            echo textMoredetailsOut($response[0], $nameresponse, $wikipediaresponse, $langs, $offset);
        } else {
            if ($format == "json") {
                echo jsonMoredetailsOut($response[0], $nameresponse, $wikipediaresponse, $langs, $offset, $id, $type, $callback);
            } else {
                echo xmlMoredetailsOut($response[0], $nameresponse, $wikipediaresponse, $langs, $offset, $id, $type);
            }
        }
        return true;
    } else {
        return false;
    }
}
开发者ID:dieterdreist,项目名称:OpenLinkMap,代码行数:33,代码来源:extdetails.php


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