ini_groups.php 862 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. ?>