namespace Friendica\Core;
+use Dice\Dice;
use Friendica;
/**
protected $helpOptions = [];
protected $customHelpOptions = ['h', 'help', '?'];
+ /**
+ * @var Dice The DI library
+ */
+ protected $dice;
+
protected function getHelp()
{
$help = <<<HELP
archivecontact Archive a contact when you know that it isn't existing anymore
help Show help about a command, e.g (bin/console help config)
autoinstall Starts automatic installation of friendica based on values from htconfig.php
+ lock Edit site locks
maintenance Set maintenance mode for this node
newpassword Set a new password for a given user
php2po Generate a messages.po file from a strings.php file
'globalcommunitysilence' => Friendica\Console\GlobalCommunitySilence::class,
'archivecontact' => Friendica\Console\ArchiveContact::class,
'autoinstall' => Friendica\Console\AutomaticInstallation::class,
+ 'lock' => Friendica\Console\Lock::class,
'maintenance' => Friendica\Console\Maintenance::class,
'newpassword' => Friendica\Console\NewPassword::class,
'php2po' => Friendica\Console\PhpToPo::class,
'storage' => Friendica\Console\Storage::class,
];
+ /**
+ * CliInput Friendica constructor.
+ *
+ * @param Dice $dice The DI library
+ * @param array $argv
+ */
+ public function __construct(Dice $dice, array $argv = null)
+ {
+ parent::__construct($argv);
+
+ $this->dice = $dice;
+ }
+
protected function doExecute()
{
if ($this->getOption('v')) {
$className = $this->subConsoles[$command];
+ Friendica\DI::init($this->dice);
+
/** @var Console $subconsole */
- $subconsole = new $className($subargs);
+ $subconsole = $this->dice->create($className, [$subargs]);
foreach ($this->options as $name => $value) {
$subconsole->setOption($name, $value);