nlopess Thu Sep 6 18:47:22 2007 UTC
Modified files:
/phpdoc/scripts/iniupdate cvs-versions.php generate_changelog.php
Log:
kill warnings & notices
fix some WS
remove php 4.0.7 from the version list as it wasnt released
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/iniupdate/cvs-versions.php?r1=1.9&r2=1.10&diff_format=u
Index: phpdoc/scripts/iniupdate/cvs-versions.php
diff -u phpdoc/scripts/iniupdate/cvs-versions.php:1.9
phpdoc/scripts/iniupdate/cvs-versions.php:1.10
--- phpdoc/scripts/iniupdate/cvs-versions.php:1.9 Wed Sep 5 17:20:46 2007
+++ phpdoc/scripts/iniupdate/cvs-versions.php Thu Sep 6 18:47:22 2007
@@ -65,9 +65,19 @@
return $tags;
}
+// if run alone, it means debug mode and thus no slow network access
+if (basename(__FILE__) == $_SERVER['PHP_SELF']) {
+ $skip_download = true;
+}
+
// fetch all version tags
-$tags = get_php_release_tags();
+$tags = get_php_release_tags();
+
+// PHP 4.0.7 wasn't released, although it was tagged in CVS
+$key = array_search('PHP_4_0_7', $tags);
+if ($key !== false) unset($tags[$key]);
+
$lasttag = 'PHP_4_0_0';
foreach (array_merge($tags, array('php_head')) as $tag) {
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/iniupdate/generate_changelog.php?r1=1.5&r2=1.6&diff_format=u
Index: phpdoc/scripts/iniupdate/generate_changelog.php
diff -u phpdoc/scripts/iniupdate/generate_changelog.php:1.5
phpdoc/scripts/iniupdate/generate_changelog.php:1.6
--- phpdoc/scripts/iniupdate/generate_changelog.php:1.5 Sun Dec 25 21:01:16 2005
+++ phpdoc/scripts/iniupdate/generate_changelog.php Thu Sep 6 18:47:22 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 |
@@ -17,10 +17,17 @@
+----------------------------------------------------------------------+
*/
+
+// if run alone, it means debug mode and thus no slow network access
+if (empty($included)) {
+ $skip_download = true;
+}
+
require_once './cvs-versions.php';
/** converts a tag like php_5_0_0 into a version like 5.0.0 */
-function tag2version($tag) {
+function tag2version($tag)
+{
global $cvs_versions;
if (isset($cvs_versions[$tag]))
@@ -31,9 +38,9 @@
/** checks if an ini setting has changed its value in PHP 5 */
-function check_php4($array) {
-
- foreach($array as $key => $val) {
+function check_php4($array)
+{
+ foreach ($array as $key => $val) {
if (substr($key, 0, 5) != 'php_4') {
continue;
}
@@ -49,20 +56,20 @@
}
}
- if (isset($old) && $old != $array['php_5_0_0'] && $array['php_5_0_0']) {
+ if (isset($old) && !empty($array['php_5_0_0']) && $old !==
$array['php_5_0_0']) {
return "$old in PHP 4.";
}
}
/** return when the option become available */
-function available_since($array) {
-
- if ($array['php_4_0_0']) {
+function available_since($array)
+{
+ if (!empty($array['php_4_0_0'])) {
return '';
}
- foreach($array as $key => $val) {
+ foreach ($array as $key => $val) {
if ($val) {
return 'Available since PHP ' . tag2version($key) . '.';
}
@@ -72,12 +79,12 @@
/** check for changes between versions */
-function last_version($array) {
-
+function last_version($array)
+{
$php4 = check_php4($array);
$str = '';
- foreach($array as $key => $val) {
+ foreach ($array as $key => $val) {
if ($php4 && substr($key, 0, 5) == 'php_4') {
continue;
}
@@ -103,9 +110,9 @@
/** generate the changelog column */
-function generate_changelog($array) {
-
- array_shift($array);
+function generate_changelog($array)
+{
+ array_shift($array); // remove the 'name' column
return trim(last_version($array) . ' ' . available_since($array));
}
@@ -118,8 +125,8 @@
$q = sqlite_unbuffered_query($idx, 'SELECT * FROM changelog');
/* This hack is needed because sqlite 2 sort case-sensitive */
-while($row = sqlite_fetch_array($q, SQLITE_ASSOC)) {
- uksort($row, 'strnatcmp');
+while ($row = sqlite_fetch_array($q, SQLITE_ASSOC)) {
+ uksort($row, 'strnatcasecmp');
$info[$row['name']] = $row;
}
@@ -129,12 +136,14 @@
$changelog[$row['name']] = generate_changelog($row);
}
-if (!isset($included)) {
+// if in debug mode
+if (empty($included)) {
foreach ($changelog as $key => $val) {
echo "$key : $val\n";
}
}
sqlite_close($idx);
+unset($idx);
?>