$script_started = microtime(true);
- $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
-
if (!init_plugins()) return;
header("Content-Type: text/json; charset=utf-8");
header("Content-Type: text/json");
print json_encode(array("error" => array("code" => 7)));
- // We close the connection to database.
- db_close();
?>
function connect($host, $user, $pass, $db, $port) {
$this->link = mysql_connect($host, $user, $pass);
+
if ($this->link) {
$result = mysql_select_db($db, $this->link);
if (!$result) {
<?php
-function db_connect($host, $user, $pass, $db) {
- return Db::get()->connect($host, $user, $pass, $db, 0);
-}
-
function db_escape_string( $s, $strip_tags = true) {
return Db::get()->escape_string($s, $strip_tags);
}
return Db::get()->fetch_result($result, $row, $param);
}
-function db_close() {
- return Db::get()->close();
-}
-
function db_affected_rows( $result) {
return Db::get()->affected_rows($result);
}
function ttrss_error_handler($errno, $errstr, $file, $line, $context) {
global $logger;
- if (error_reporting() == 0) return false;
+ if (error_reporting() == 0 || !$errno) return false;
if (!$logger) $logger = new Logger_SQL();
$line = $error["line"];
$errstr = $error["message"];
+ if (!$errno) return false;
+
$context = debug_backtrace();
$file = substr(str_replace(dirname(dirname(__FILE__)), "", $file), 1);
$mobile = new Mobile_Detect();
- $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
-
if (!init_plugins()) return;
global $pluginhost;
</div>
</div>
-<?php db_close(); ?>
-
</body>
</html>
require_once "db.php";
require_once "db-prefs.php";
- $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
-
if (!init_plugins()) return;
$op = $_REQUEST['op'];
}
}
- db_close();
-
?>
require_once "config.php";
require_once "db-prefs.php";
- $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
-
if (!init_plugins()) return;
login_sequence();
</div>
-<?php db_close(); ?>
-
</body>
</html>
$script_started = microtime(true);
- $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
-
if (!init_plugins()) return;
if (ENABLE_GZIP_OUTPUT && function_exists("ob_gzhandler")) {
header("Content-Type: text/plain");
print json_encode(array("error" => array("code" => 7)));
- // We close the connection to database.
- db_close();
?>
$action = $_REQUEST["action"];
- $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
-
if (!init_plugins()) return;
if ($_REQUEST["format"] == "feed") {
$schema_version = get_schema_version();
- db_close();
-
if ($schema_version != SCHEMA_VERSION) {
die("Schema version is wrong, please upgrade the database.\n");
}
/* Check if schema version changed */
- init_plugins();
$test_schema_version = get_schema_version();
if ($test_schema_version != $schema_version) {
}
}
- db_close();
-
// We are in a fork.
// We wait a little before exiting to avoid to be faster than our parent process.
sleep(1);