Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
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.

34 lines
659 B

  1. #!/usr/bin/env php
  2. <?php
  3. // Red config utility
  4. require_once('include/cli_startup.php');
  5. cli_startup();
  6. if($argc > 3) {
  7. set_config($argv[1],$argv[2],$argv[3]);
  8. echo "config[{$argv[1]}][{$argv[2]}] = " . get_config($argv[1],$argv[2]) . "\n";
  9. }
  10. if($argc == 3) {
  11. echo "config[{$argv[1]}][{$argv[2]}] = " . get_config($argv[1],$argv[2]) . "\n";
  12. }
  13. if($argc == 2) {
  14. load_config($argv[1]);
  15. foreach($a->config[$argv[1]] as $k => $x) {
  16. echo "config[{$argv[1]}][{$k}] = " . $x . "\n";
  17. }
  18. }
  19. if($argc == 1) {
  20. $r = q("select * from config where 1");
  21. if($r) {
  22. foreach($r as $rr) {
  23. echo "config[{$rr['cat']}][{$rr['k']}] = " . $rr['v'] . "\n";
  24. }
  25. }
  26. }