<?php
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
namespace Friendica\Core\Console;
use Asika\SimpleConsole\CommandArgsException;
-use dba;
+use Friendica\App;
use Friendica\Core;
-
-require_once 'include/dba.php';
-require_once 'include/text.php';
+use RuntimeException;
/**
* @brief tool to access the system config from the CLI
* set to the value of the last parameter. (e.g. "system loglevel 0" will
* disable logging)
*
- * @author Tobias Diekershoff
- * @author Hypolite Petovan <mrpetovan@gmail.com>
+ * @author Tobias Diekershoff <tobias.diekershoff@gmx.net>
+ * @author Hypolite Petovan <hypolite@mrpetovan.com>
*/
class Config extends \Asika\SimpleConsole\Console
{
protected function doExecute()
{
- $a = get_app();
+ $a = \Friendica\BaseObject::getApp();
if ($this->getOption('v')) {
$this->out('Executable: ' . $this->executable);
throw new CommandArgsException('Too many arguments');
}
- if (!($a->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) {
+ if (!($a->mode & App::MODE_DBCONFIGAVAILABLE)) {
$this->out('Database isn\'t ready or populated yet, showing file config only');
}
$value = $this->getArgument(2);
if (is_array(Core\Config::get($cat, $key))) {
- throw new \RuntimeException("$cat.$key is an array and can't be set using this command.");
+ throw new RuntimeException("$cat.$key is an array and can't be set using this command.");
}
$result = Core\Config::set($cat, $key, $value);
if (count($this->args) == 0) {
Core\Config::load();
- if (Core\Config::get('system', 'config_adapter') == 'jit' && $a->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE) {
+ if (Core\Config::get('system', 'config_adapter') == 'jit' && $a->mode & App::MODE_DBCONFIGAVAILABLE) {
$this->out('Warning: The JIT (Just In Time) Config adapter doesn\'t support loading the entire configuration, showing file config only');
}