cvs: php-master-web /include functions.inc /manage mirrors.php /scripts mirror-test
| From: | Philip Olson | Date: | Tue, 07 Apr 2009 17:10:25 +0000 |
| Subject: | cvs: php-master-web /include functions.inc /manage mirrors.php /scripts mirror-test | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-4335@lists.php.net to get a copy of this message | ||
philip Tue Apr 7 17:10:25 2009 UTC
Modified files:
/php-master-web/include functions.inc
/php-master-web/manage mirrors.php
/php-master-web/scripts mirror-test
Log:
Implemented new sqlite check to include checking of every possible sqlite version
but for now keep using our current sqlite2 only behaviour
http://cvs.php.net/viewvc.cgi/php-master-web/include/functions.inc?r1=1.14&r2=1.15&diff_format=u
Index: php-master-web/include/functions.inc
diff -u php-master-web/include/functions.inc:1.14 php-master-web/include/functions.inc:1.15
--- php-master-web/include/functions.inc:1.14 Tue Sep 12 11:20:30 2006
+++ php-master-web/include/functions.inc Tue Apr 7 17:10:25 2009
@@ -1,5 +1,5 @@
<?php
-// $Id: functions.inc,v 1.14 2006/09/12 11:20:30 goba Exp $
+// $Id: functions.inc,v 1.15 2009/04/07 17:10:25 philip Exp $
// -----------------------------------------------------------------------------------
@@ -143,3 +143,40 @@
echo "<option value=\"{$row['id']}\"", $cc ==
$row['id'] ? " selected" : "",
">{$row['name']}</option>";
}
}
+
+function is_sqlite_type_available($avails, $check) {
+
+ // All possible sqlite types associated with our assigned bitwise values
+ $all = array('sqlite' => 1, 'sqlite3' => 2, 'pdo_sqlite' =>
4, 'pdo_sqlite2' => 8);
+
+ if (!$avails || empty($all[$check])) {
+ return false;
+ }
+
+ $avail = (int) $all[$check];
+ $avails = (int) $avails;
+
+ if (($avails & $avail) === $avail) {
+ return true;
+ }
+ return false;
+}
+
+function decipher_available_sqlites($avails) {
+
+ $all = array(1 => 'sqlite', 2 => 'sqlite3', 4 =>
'pdo_sqlite', 8 => 'pdo_sqlite2');
+ $mine = array();
+ $avails = (int) $avails;
+
+ if (($avails & 15) === 15) {
+ return $all;
+ }
+
+ foreach ($all as $bit => $name) {
+ if (($avails & $bit) === $bit) {
+ $mine[$num] = $name;
+ }
+ }
+
+ return $mine;
+}
http://cvs.php.net/viewvc.cgi/php-master-web/manage/mirrors.php?r1=1.104&r2=1.105&diff_format=u
Index: php-master-web/manage/mirrors.php
diff -u php-master-web/manage/mirrors.php:1.104 php-master-web/manage/mirrors.php:1.105
--- php-master-web/manage/mirrors.php:1.104 Wed Feb 4 21:47:51 2009
+++ php-master-web/manage/mirrors.php Tue Apr 7 17:10:25 2009
@@ -217,7 +217,7 @@
-->
<tr>
<th align="right">SQLite available:</th>
- <td><?php echo $row['has_search'] ? "Yes" : "No";
?></td>
+ <td><?php echo implode(' : ',
decipher_available_sqlites($row['has_search'])); ?></td>
</tr>
<tr>
<th align="right">Local Stats:</th>
@@ -353,8 +353,10 @@
*/
if ($row['has_search']) {
- $searchcell = "SQLite";
- $stats['has_search']++;
+ $searchcell = "SQLite 2";
+ if (is_sqlite_type_available($row['has_search'], 'sqlite')) {
+ $stats['has_search']++;
+ }
} else {
$searchcell = " ";
}
http://cvs.php.net/viewvc.cgi/php-master-web/scripts/mirror-test?r1=1.105&r2=1.106&diff_format=u
Index: php-master-web/scripts/mirror-test
diff -u php-master-web/scripts/mirror-test:1.105 php-master-web/scripts/mirror-test:1.106
--- php-master-web/scripts/mirror-test:1.105 Mon Dec 8 08:43:21 2008
+++ php-master-web/scripts/mirror-test Tue Apr 7 17:10:25 2009
@@ -151,9 +151,9 @@
$hosts[$index]['has_search'] = $info[3];
}*/
// Abuse the "has_search" SQL field to check for SQLite availability
- if (in_array($info[3], array('0', '1'))) {
- $hosts[$index]['has_search'] = $info[3];
- }
+ // Currently only sqlite is used (ext/sqlite) but the future may change this
+ $hosts[$index]['has_search'] = (int) $info[3];
+
// Update stats availability info
if (in_array($info[4], array('0', '1'))) {
$hosts[$index]['has_stats'] = $info[4];