1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Edited sqlite check to include checking of every possible sqlite version

This commit is contained in:
Philip Olson
2009-04-07 17:05:40 +00:00
parent 473c175c11
commit 302014466f
2 changed files with 27 additions and 1 deletions

View File

@@ -303,6 +303,31 @@ function fetch_header($url, $header) {
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

View File

@@ -18,7 +18,8 @@ $filename = $_SERVER['DOCUMENT_ROOT'] . '/distributions/' . $RELEASES[5][$PHP_5_
$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();