cvs: phpdoc /scripts/iniupdate ini-update.php insert_db.php make_db.php
| From: | Nuno Lopes | Date: | Sat, 29 Sep 2007 21:54:29 +0000 |
| Subject: | cvs: phpdoc /scripts/iniupdate ini-update.php insert_db.php make_db.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-102@lists.php.net to get a copy of this message | ||
nlopess Sat Sep 29 21:54:29 2007 UTC
Modified files:
/phpdoc/scripts/iniupdate ini-update.php insert_db.php make_db.php
Log:
incorporate already removed ini opts in the table
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/iniupdate/ini-update.php?r1=1.11&r2=1.12&diff_format=u
Index: phpdoc/scripts/iniupdate/ini-update.php
diff -u phpdoc/scripts/iniupdate/ini-update.php:1.11 phpdoc/scripts/iniupdate/ini-update.php:1.12
--- phpdoc/scripts/iniupdate/ini-update.php:1.11 Fri Sep 14 21:06:23 2007
+++ phpdoc/scripts/iniupdate/ini-update.php Sat Sep 29 21:54:29 2007
@@ -3,7 +3,7 @@
+----------------------------------------------------------------------+
| ini doc settings updater |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -125,6 +125,32 @@
}
}
+
+if (!$idx = sqlite_open('ini_changelog.sqlite', 0666, $error)) {
+ die("Couldn't open the DB: $error");
+}
+
+// fetch info from removed opts
+foreach ($changelog as $name => $entry) {
+ if (empty($array[$name])) {
+ $q = sqlite_unbuffered_query($idx, "SELECT defaultval, permissions FROM
last_seen_values WHERE name='$name'");
+ $array[$name] = sqlite_fetch_array($q, SQLITE_NUM);
+ }
+}
+
+sqlite_close($idx);
+unset($idx);
+
+
+// remove bogus ini opt values
+$bogus = array('pdo.global_value');
+foreach ($bogus as $x) {
+ unset($array[$x]);
+}
+
+uksort($array, 'strnatcasecmp');
+
+
/* Generate the XML code */
foreach($array as $entry => $arr) {
@@ -181,7 +207,7 @@
/* Print unmatched links */
-$deprecated = array('track_vars', 'debugger.host', 'debugger.port',
'debugger.enabled', 'sesam_oml', 'sesam_configfile',
'sesam_messagecatalog', 'gpc_order', 'allow_webdav_methods');
+$deprecated = array('debugger.host', 'debugger.port',
'debugger.enabled', 'sesam_oml', 'sesam_configfile',
'sesam_messagecatalog', 'allow_webdav_methods');
foreach ($deprecated as $val) {
unset($link_files[$val]);
}
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/iniupdate/insert_db.php?r1=1.11&r2=1.12&diff_format=u
Index: phpdoc/scripts/iniupdate/insert_db.php
diff -u phpdoc/scripts/iniupdate/insert_db.php:1.11 phpdoc/scripts/iniupdate/insert_db.php:1.12
--- phpdoc/scripts/iniupdate/insert_db.php:1.11 Fri Sep 28 19:27:29 2007
+++ phpdoc/scripts/iniupdate/insert_db.php Sat Sep 29 21:54:29 2007
@@ -33,6 +33,8 @@
$sql .= "INSERT INTO changelog (name, $tag) VALUES ('$key',
'{$data[1]}');";
}
+ $sql .= "REPLACE INTO last_seen_values (name, defaultval, permissions) VALUES
('$key', '".sqlite_escape_string($data[0])."',
'$data[1]');";
+
}
if ($sql) sqlite_query($idx, $sql);
@@ -74,6 +76,11 @@
foreach ($array as $key => $data) {
$sql .= "INSERT INTO pecl_changelog (package, version, name, value) VALUES
('".sqlite_escape_string($pkg)."', '$version', '$key',
'$data[1]');";
+
+ // prefer information from PHP sources
+ if (!sqlite_single_query($idx, "SELECT name FROM changelog WHERE
name='$key'")) {
+ $sql .= "REPLACE INTO last_seen_values (name, defaultval, permissions) VALUES
('$key', '".sqlite_escape_string($data[0])."',
'$data[1]');";
+ }
}
if ($sql) sqlite_query($idx, $sql);
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/iniupdate/make_db.php?r1=1.7&r2=1.8&diff_format=u
Index: phpdoc/scripts/iniupdate/make_db.php
diff -u phpdoc/scripts/iniupdate/make_db.php:1.7 phpdoc/scripts/iniupdate/make_db.php:1.8
--- phpdoc/scripts/iniupdate/make_db.php:1.7 Sun Sep 16 19:16:49 2007
+++ phpdoc/scripts/iniupdate/make_db.php Sat Sep 29 21:54:29 2007
@@ -33,8 +33,17 @@
);
';
-// the query may fail if the table already exists
+$sql2 = '
+CREATE TABLE last_seen_values (
+ name TEXT PRIMARY KEY,
+ defaultval TEXT,
+ permissions TEXT
+);
+';
+
+// the query may fail if the tables already exists
@sqlite_query($idx, $sql);
+@sqlite_query($idx, $sql2);
$sql = 'CREATE TABLE changelog (