cvs: docweb /include lib_url_entities.inc.php /scripts checkent.php /www checkent.php

From: Date: Sat, 22 Jan 2005 20:44:57 +0000
Subject: cvs: docweb /include lib_url_entities.inc.php /scripts checkent.php /www checkent.php
Groups: php.doc.web 
Request: Send a blank email to doc-web+get-534@lists.php.net to get a copy of this message
sean Sat Jan 22 15:44:57 2005 EDT Modified files: /docweb/include lib_url_entities.inc.php /docweb/scripts checkent.php /docweb/www checkent.php Log: sqlite_open cleanup http://cvs.php.net/diff.php/docweb/include/lib_url_entities.inc.php?r1=1.4&r2=1.5&ty=u Index: docweb/include/lib_url_entities.inc.php diff -u docweb/include/lib_url_entities.inc.php:1.4 docweb/include/lib_url_entities.inc.php:1.5 --- docweb/include/lib_url_entities.inc.php:1.4 Sat Jan 22 15:34:49 2005 +++ docweb/include/lib_url_entities.inc.php Sat Jan 22 15:44:56 2005 @@ -19,7 +19,7 @@ | Mehdi Achour <didou@php.net> | | Sean Coates <sean@php.net> | +----------------------------------------------------------------------+ -$Id: lib_url_entities.inc.php,v 1.4 2005/01/22 20:34:49 sean Exp $ +$Id: lib_url_entities.inc.php,v 1.5 2005/01/22 20:44:56 sean Exp $ */ // user agent @@ -90,10 +90,7 @@ */ function url_ent_sqlite_open() { - if (!($sqlite = sqlite_open(URL_ENT_SQLITE_FILE, 0666))) { - echo "Error creating database.\n"; - } - return $sqlite; + return @sqlite_open(URL_ENT_SQLITE_FILE, 0666); } /** @@ -255,7 +252,10 @@ function url_store_result($sqlite, $num, $name, $url, $result) { if (!$sqlite) { - $sqlite = url_ent_sqlite_open(); + if (!$sqlite = url_ent_sqlite_open()) { + echo "Error opening database.\n"; + exit(1); + } } $return_val = isset($result[1][1]) ? $result[1][1] : ''; $sql = " http://cvs.php.net/diff.php/docweb/scripts/checkent.php?r1=1.16&r2=1.17&ty=u Index: docweb/scripts/checkent.php diff -u docweb/scripts/checkent.php:1.16 docweb/scripts/checkent.php:1.17 --- docweb/scripts/checkent.php:1.16 Sat Jan 22 12:09:03 2005 +++ docweb/scripts/checkent.php Sat Jan 22 15:44:57 2005 @@ -19,7 +19,7 @@ | Mehdi Achour <didou@php.net> | | Sean Coates <sean@php.net> | +----------------------------------------------------------------------+ -$Id: checkent.php,v 1.16 2005/01/22 17:09:03 sean Exp $ +$Id: checkent.php,v 1.17 2005/01/22 20:44:57 sean Exp $ */ set_time_limit(0); @@ -59,7 +59,12 @@ echo "Error removing old database.\n"; die(); } -$sqlite = url_ent_sqlite_open(); + +if (!$sqlite = url_ent_sqlite_open()) +{ + echo "Error opening database.\n"; + die(); +} // Table creation $sqlCreateMeta = " http://cvs.php.net/diff.php/docweb/www/checkent.php?r1=1.2&r2=1.3&ty=u Index: docweb/www/checkent.php diff -u docweb/www/checkent.php:1.2 docweb/www/checkent.php:1.3 --- docweb/www/checkent.php:1.2 Sat Jan 22 01:56:59 2005 +++ docweb/www/checkent.php Sat Jan 22 15:44:57 2005 @@ -17,14 +17,15 @@ | Mehdi Achour <didou@php.net> | | Sean Coates <sean@php.net> | +----------------------------------------------------------------------+ -$Id: checkent.php,v 1.2 2005/01/22 06:56:59 sean Exp $ +$Id: checkent.php,v 1.3 2005/01/22 20:44:57 sean Exp $ */ require_once '../include/init.inc.php'; + +$entType = SITE; require_once '../include/lib_url_entities.inc.php'; -$dbFile = SQLITE_DIR . "checkent_" . SITE . ".sqlite"; -if (!($sqlite = @sqlite_open($dbFile))) { +if (!$sqlite = url_ent_sqlite_open()) { echo site_header('docweb.common.header.checkent'); echo '<p>checkent not found!</p>'; // @@@ template this echo site_footer();

« previous php.doc.web (#534) next »