summaryrefslogtreecommitdiff
path: root/ext/spl/examples/ini_groups.php
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-12-04 19:39:46 +0000
committerMarcus Boerger <helly@php.net>2003-12-04 19:39:46 +0000
commitf679b5c935f713854a14f00370d4d832a4850b56 (patch)
tree2be7a10dbb7a38db90411d8c67f7c799023ca3ad /ext/spl/examples/ini_groups.php
parent2216eb4511c20fd0315c7217d90027b32255b2f4 (diff)
downloadphp-git-f679b5c935f713854a14f00370d4d832a4850b56.tar.gz
Update documentation
Diffstat (limited to 'ext/spl/examples/ini_groups.php')
-rwxr-xr-xext/spl/examples/ini_groups.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/ext/spl/examples/ini_groups.php b/ext/spl/examples/ini_groups.php
index 1909e87c2d..7ebdaed7f9 100755
--- a/ext/spl/examples/ini_groups.php
+++ b/ext/spl/examples/ini_groups.php
@@ -1,17 +1,29 @@
<?php
-/* List groups within an ini file
+/** List groups within an ini file
*
- * Usage: php dba_dump <file> [<regex>]
+ * Usage: php dba_dump.php <file> [<regex>]
*
* Show all groups in the ini file specified by <file>.
* The regular expression <regex> is used to filter the result.
*
* Note: configure with --enable-dba
*
- * (c) Marcus Boerger
+ * (c) Marcus Boerger, 2003
*/
+if ($argc < 2) {
+ echo <<<EOF
+Usage: php dba_dump.php <file> [<regex>]
+
+Show all groups in the ini file specified by <file>.
+The regular expression <regex> is used to filter the result.
+
+
+EOF;
+ exit(1);
+}
+
require_once("dba_reader.inc");
require_once("key_filter.inc");
@@ -58,6 +70,7 @@ $it = new ini_groups($argv[1]);
if ($argc>2) {
$it = new key_filter($it, $argv[2]);
}
+
foreach($it as $group) {
echo "$group\n";
}