aboutsummaryrefslogtreecommitdiffstats
path: root/util/service_class
diff options
context:
space:
mode:
Diffstat (limited to 'util/service_class')
-rwxr-xr-xutil/service_class34
1 files changed, 18 insertions, 16 deletions
diff --git a/util/service_class b/util/service_class
index b8a1f2386..afad4c709 100755
--- a/util/service_class
+++ b/util/service_class
@@ -7,10 +7,12 @@ require_once('include/cli_startup.php');
cli_startup();
+use Zotlabs\Lib\Config;
+
if($argc > 3) {
- $d = get_config('service_class', $argv[1]);
+ $d = Config::Get('service_class', $argv[1]);
$d[$argv[2]] = $argv[3];
- set_config('service_class', $argv[1], $d);
+ Config::Set('service_class', $argv[1], $d);
echo 'Updated service class "' . $argv[1] . '" service "' . $argv[2] . '" to ' . $argv[3] . "\n";
}
@@ -24,7 +26,7 @@ if($argc == 3) {
);
if(!$r)
die('could not find channel');
-
+
$acct = intval($r[0]['channel_account_id']);
} else {
exit();
@@ -34,28 +36,28 @@ if($argc == 3) {
);
if(!$r)
die('could not find account');
-
+
$c = q('SELECT channel_address FROM channel WHERE channel_account_id=%d',
intval($acct)
);
-
+
echo "Account $acct: ";
-
+
foreach($c as $chan)
echo $chan['channel_address'] . ', ';
-
+
echo "\n\033[1mProperty Old\t\tNew\033[0m\n";
-
+
if(empty($r[0]['account_service_class'])) {
$oclass = 'None';
$old = false;
} else {
$oclass = $r[0]['account_service_class'];
- $old = get_config('service_class', $oclass);
+ $old = Config::Get('service_class', $oclass);
}
echo "service_class $oclass\t\t\033[1m" . $argv[2] . "\033[0m\n";
-
- $new = get_config('service_class', $argv[2]);
+
+ $new = Config::Get('service_class', $argv[2]);
foreach(array('photo_upload_limit','total_items','total_pages','total_identities','total_channels','total_feeds','attach_upload_limit','minimum_feedcheck_minutes','chatrooms','chatters_inroom','access_tokens') as $prop) {
echo $prop . str_repeat(' ',26 - strlen($prop)) . (($old && $old[$prop]) ? $old[$prop] : 'unlimited') . "\t\t\033[1m" . (($new && $new[$prop]) ? $new[$prop] : 'unlimited') . "\033[0m\n";
}
@@ -67,7 +69,7 @@ if($argc == 3) {
}
if($r == 'n')
die('no update done');
-
+
$r = q("UPDATE account SET account_service_class='%s' WHERE account_id=%d",
dbesc($argv[2]),
intval($acct)
@@ -77,11 +79,11 @@ if($argc == 3) {
} else {
echo "failed\n";
}
-}
+}
if($argc == 2) {
- $d = get_config('service_class', $argv[1]);
+ $d = Config::Get('service_class', $argv[1]);
echo $argv[1] . ":\n";
foreach($d as $k => $v) {
echo "$k = $v\n";
@@ -89,7 +91,7 @@ if($argc == 2) {
}
if($argc == 1) {
- load_config('service_class');
+ Config::Load('service_class');
if(is_array(App::$config['service_class']) && App::$config['service_class']) {
foreach(App::$config['service_class'] as $class=>$props) {
echo "$class:\n";
@@ -106,4 +108,4 @@ if($argc == 1) {
}
}
}
-} \ No newline at end of file
+}