mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Remove get_app() in favor of DI::app()
This commit is contained in:
parent
5d20cd7e16
commit
f0eea6f875
26 changed files with 110 additions and 97 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Friendica\Console;
|
||||
|
||||
use Friendica\App;
|
||||
|
||||
/**
|
||||
* When I installed docblox, I had the experience that it does not generate any output at all.
|
||||
* This script may be used to find that kind of problems with the documentation build process.
|
||||
|
@ -29,6 +31,16 @@ class DocBloxErrorChecker extends \Asika\SimpleConsole\Console
|
|||
|
||||
protected $helpOptions = ['h', 'help', '?'];
|
||||
|
||||
/** @var App */
|
||||
private $app;
|
||||
|
||||
public function __construct(App $app, array $argv = null)
|
||||
{
|
||||
parent::__construct($argv);
|
||||
|
||||
$this->app = $app;
|
||||
}
|
||||
|
||||
protected function getHelp()
|
||||
{
|
||||
$help = <<<HELP
|
||||
|
@ -59,7 +71,7 @@ HELP;
|
|||
throw new \RuntimeException('DocBlox isn\'t available.');
|
||||
}
|
||||
|
||||
$dir = \get_app()->getBasePath();
|
||||
$dir = $this->app->getBasePath();
|
||||
|
||||
//stack for dirs to search
|
||||
$dirstack = [];
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace Friendica\Console;
|
||||
|
||||
use Friendica\App;
|
||||
|
||||
/**
|
||||
* Read a strings.php file and create messages.po in the same directory
|
||||
*
|
||||
|
@ -15,6 +17,16 @@ class PhpToPo extends \Asika\SimpleConsole\Console
|
|||
private $normBaseMsgIds = [];
|
||||
const NORM_REGEXP = "|[\\\]|";
|
||||
|
||||
/** @var App */
|
||||
private $app;
|
||||
|
||||
public function __construct(App $app, array $argv = null)
|
||||
{
|
||||
parent::__construct($argv);
|
||||
|
||||
$this->app = $app;
|
||||
}
|
||||
|
||||
protected function getHelp()
|
||||
{
|
||||
$help = <<<HELP
|
||||
|
@ -51,7 +63,7 @@ HELP;
|
|||
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
||||
}
|
||||
|
||||
$a = \get_app();
|
||||
$a = $this->app;
|
||||
|
||||
$phpfile = realpath($this->getArgument(0));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue