blob: baa786a031f27796a2e14fa39b0a7eba85be4c91 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/usr/bin/env php
<?php
// Red pconfig utility
require_once('include/cli_startup.php');
cli_startup();
if($argc > 4) {
set_pconfig($argv[1],$argv[2],$argv[3],$argv[4]);
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]);
foreach($a->config[$argv[1]][$argv[2]] as $k => $x) {
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";
}
}
}
|