pg_ping example

$this->buildDSN();
        }

        // Convert DSN string         if (mb_strpos($this->DSN, 'pgsql:') === 0) {
            $this->convertDSN();
        }

        $this->connID = $persistent === true ? pg_pconnect($this->DSN) : pg_connect($this->DSN);

        if ($this->connID !== false) {
            if ($persistent === true && pg_connection_status($this->connID) === PGSQL_CONNECTION_BAD && pg_ping($this->connID) === false
            ) {
                return false;
            }

            if (empty($this->schema)) {
                $this->simpleQuery("SET search_path TO {$this->schema},public");
            }

            if ($this->setClientEncoding($this->charset) === false) {
                return false;
            }
        }
Home | Imprint | This part of the site doesn't use cookies.