mirror of
https://github.com/flarum/framework.git
synced 2025-01-20 03:42:44 +08:00
Add first, basic version of info command
This will hopefully help in debugging some problems.
This commit is contained in:
parent
eef895c16f
commit
7e33690660
|
@ -36,6 +36,7 @@ class Server extends AbstractServer
|
|||
|
||||
$console->add($app->make('Flarum\Install\Console\InstallCommand'));
|
||||
$console->add($app->make('Flarum\Update\Console\MigrateCommand'));
|
||||
$console->add($app->make('Flarum\Debug\Console\InfoCommand'));
|
||||
$console->add($app->make('Flarum\Console\Command\GenerateExtensionCommand'));
|
||||
$console->add($app->make('Flarum\Console\Command\GenerateMigrationCommand'));
|
||||
|
||||
|
|
59
src/Debug/Console/InfoCommand.php
Normal file
59
src/Debug/Console/InfoCommand.php
Normal file
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Flarum\Debug\Console;
|
||||
|
||||
use Flarum\Console\Command\AbstractCommand;
|
||||
use Flarum\Extension\ExtensionManager;
|
||||
use Flarum\Foundation\Application;
|
||||
|
||||
class InfoCommand extends AbstractCommand
|
||||
{
|
||||
/**
|
||||
* @var ExtensionManager
|
||||
*/
|
||||
protected $extensions;
|
||||
|
||||
/**
|
||||
* @param ExtensionManager $extensions
|
||||
*/
|
||||
public function __construct(ExtensionManager $extensions)
|
||||
{
|
||||
$this->extensions = $extensions;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('info')
|
||||
->setDescription("Gather information about Flarum's core and installed extensions");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function fire()
|
||||
{
|
||||
$this->info('Flarum core '.Application::VERSION);
|
||||
|
||||
foreach ($this->extensions->getEnabledExtensions() as $extension) {
|
||||
/** @var \Flarum\Extension\Extension $extension */
|
||||
$name = $extension->getId();
|
||||
$version = $extension->getVersion();
|
||||
|
||||
$this->info("EXT $name $version");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user