2015-08-23 22:38:18 +02:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
// Red pconfig utility
|
|
|
|
|
|
|
|
require_once('include/cli_startup.php');
|
|
|
|
require_once('include/zot.php');
|
|
|
|
|
|
|
|
cli_startup();
|
|
|
|
|
|
|
|
if($argc > 4) {
|
|
|
|
set_pconfig($argv[1],$argv[2],$argv[3],$argv[4]);
|
|
|
|
build_sync_packet($argv[1]);
|
|
|
|
echo "pconfig[{$argv[1]}][{$argv[2]}][{$argv[3]}] = " . get_pconfig($argv[1],$argv[2],$argv[3]) . "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
if($argc == 4) {
|
|
|
|
echo "pconfig[{$argv[1]}][{$argv[2]}][{$argv[3]}] = " . get_pconfig($argv[1],$argv[2],$argv[3]) . "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
if($argc == 3) {
|
|
|
|
load_pconfig($argv[1],$argv[2]);
|
2016-04-17 16:29:18 +02:00
|
|
|
foreach(App::$config[$argv[1]][$argv[2]] as $k => $x) {
|
2015-08-23 22:38:18 +02:00
|
|
|
echo "pconfig[{$argv[1]}][{$argv[2]}][{$k}] = " . $x . "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if($argc == 2) {
|
|
|
|
$r = q("select * from pconfig where uid = " . intval($argv[1]));
|
|
|
|
if($r) {
|
|
|
|
foreach($r as $rr) {
|
|
|
|
echo "pconfig[{$rr['uid']}][{$rr['cat']}][{$rr['k']}] = " . $rr['v'] . "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|