cvs: phpweb / mirror-info.php /include site.inc
| From: | Philip Olson | Date: | Tue, 07 Apr 2009 17:05:40 +0000 |
| Subject: | cvs: phpweb / mirror-info.php /include site.inc | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-4334@lists.php.net to get a copy of this message | ||
philip Tue Apr 7 17:05:40 2009 UTC
Modified files:
/phpweb mirror-info.php
/phpweb/include site.inc
Log:
Edited sqlite check to include checking of every possible sqlite version
http://cvs.php.net/viewvc.cgi/phpweb/mirror-info.php?r1=1.27&r2=1.28&diff_format=u
Index: phpweb/mirror-info.php
diff -u phpweb/mirror-info.php:1.27 phpweb/mirror-info.php:1.28
--- phpweb/mirror-info.php:1.27 Fri Dec 5 09:01:39 2008
+++ phpweb/mirror-info.php Tue Apr 7 17:05:40 2009
@@ -1,5 +1,5 @@
<?php
-// $Id: mirror-info.php,v 1.27 2008/12/05 09:01:39 bjori Exp $
+// $Id: mirror-info.php,v 1.28 2009/04/07 17:05:40 philip Exp $
// Define $MYSITE and $LAST_UPDATED variables
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
@@ -18,7 +18,8 @@
$md5_ok = (int) (file_exists($filename) && md5_file($filename) ==
$PHP_5_MD5["tar.bz2"]);
// Does this mirror have sqlite?
-$sqlite = (int) function_exists("sqlite_open");
+// Gets all available sqlite versions for possible future sqlite wrapper
+$sqlite = get_available_sqlites();
if (isset($_GET["token"]) && md5($_GET["token"]) ===
"19a3ec370affe2d899755f005e5cd90e") {
$retval = run_self_tests();
http://cvs.php.net/viewvc.cgi/phpweb/include/site.inc?r1=1.263&r2=1.264&diff_format=u
Index: phpweb/include/site.inc
diff -u phpweb/include/site.inc:1.263 phpweb/include/site.inc:1.264
--- phpweb/include/site.inc:1.263 Tue Feb 3 17:01:57 2009
+++ phpweb/include/site.inc Tue Apr 7 17:05:40 2009
@@ -1,6 +1,6 @@
<?php // -*- C++ -*-
-// $Id: site.inc,v 1.263 2009/02/03 17:01:57 bjori Exp $
+// $Id: site.inc,v 1.264 2009/04/07 17:05:40 philip Exp $
// Define $MIRRORS array, and some constants
include $_SERVER['DOCUMENT_ROOT'] . '/include/mirrors.inc';
@@ -303,6 +303,31 @@
return isset($headers[$header]) ? $headers[$header] : null;
}
+function get_available_sqlites() {
+
+ $allsqlites = array(1 => 'sqlite', 2 => 'sqlite3', 4 =>
'pdo_sqlite', 8 => 'pdo_sqlite2');
+ $avail = 0;
+
+ if (function_exists('sqlite_open')) {
+ $avail += 1;
+ }
+ if (class_exists('sqlite3')) {
+ $avail += 2;
+ }
+ if (method_exists('PDO', 'getavailabledrivers')) {
+ foreach (PDO::getavailabledrivers() as $driver) {
+ switch ($driver) {
+ case 'sqlite':
+ $avail += 4;
+ break;
+ case 'sqlite2':
+ $avail += 8;
+ break;
+ }
+ }
+ }
+ return $avail;
+}
// Guess the current site from what Apache tells us.
// This should be the main name of the mirror (in case