dba_dump.php 923 B

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