You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
862 B

23 years ago
21 years ago
23 years ago
23 years ago
23 years ago
23 years ago
22 years ago
23 years ago
22 years ago
23 years ago
23 years ago
  1. <?php
  2. /** @file ini_groups.php
  3. * @brief Program List groups within an ini file
  4. * @ingroup Examples
  5. * @author Marcus Boerger
  6. * @date 2003 - 2005
  7. *
  8. * Usage: php dba_dump.php \<file\> [\<regex\>]
  9. *
  10. * Show all groups in the ini file specified by \<file\>.
  11. * The regular expression \<regex\> is used to filter the result.
  12. *
  13. * Note: configure with --enable-dba
  14. */
  15. if ($argc < 2) {
  16. echo <<<EOF
  17. Usage: php dba_dump.php <file> [<regex>]
  18. Show all groups in the ini file specified by <file>.
  19. The regular expression <regex> is used to filter the result.
  20. EOF;
  21. exit(1);
  22. }
  23. if (!class_exists("KeyFilter", false)) require_once("keyfilter.inc");
  24. if (!class_exists("IniGroups", false)) require_once("inigroups.inc");
  25. $it = new IniGroups($argv[1]);
  26. if ($argc>2) {
  27. $it = new KeyFilter($it, $argv[2]);
  28. }
  29. foreach($it as $group) {
  30. echo "$group\n";
  31. }
  32. ?>