diff --git a/src/flextype/core/Console/Commands/AboutCommand.php b/src/flextype/core/Console/Commands/AboutCommand.php new file mode 100644 index 00000000..1fc71971 --- /dev/null +++ b/src/flextype/core/Console/Commands/AboutCommand.php @@ -0,0 +1,71 @@ +setName('about'); + $this->setDescription('Get information about Flextype'); + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $output->write( + renderToString( + + hr('[b]Flextype[/b]', 'my-1') . + div('[b][color=success]Version[/color][/b]: ' . registry()->get('flextype.manifest.version'), '') . + div('[b][color=success]Author[/color][/b]', '') . + div('[b][color=success] Name[/color][/b]: ' . registry()->get('flextype.manifest.author.name'), '') . + div('[b][color=success] Email[/color][/b]: ' . registry()->get('flextype.manifest.author.email'), '') . + div('[b][color=success] Url[/color][/b]: ' . anchor(registry()->get('flextype.manifest.author.url'))->href(registry()->get('flextype.manifest.author.url')), 'clearfix') . breakline() . + + hr('[b]Plugins[/b]', 'my-1') . + div('[b][color=success]Enabled[/color][/b]: ' . implode(', ', array_keys(registry()->get('plugins'))), '') . + + hr('[b]Constants[/b]', 'my-1') . + div('[b][color=success]PROJECT_NAME[/color][/b]: ' . PROJECT_NAME, '') . + div('[b][color=success]ROOT_DIR[/color][/b]: ' . ROOT_DIR, '') . + div('[b][color=success]PATH_PROJECT[/color][/b]: ' . PATH_PROJECT, '') . + div('[b][color=success]PATH_TMP[/color][/b]: ' . PATH_TMP, '') . + div('[b][color=success]FLEXTYPE_MINIMUM_PHP[/color][/b]: ' . FLEXTYPE_MINIMUM_PHP, '') . + + hr('[b]PHP Information[/b]', 'my-1') . + div('[b][color=success]PHP Version[/color][/b]: ' . phpversion(), '') . + div('[b][color=success]PHP Modules[/color][/b]: ' . implode(', ', get_loaded_extensions()), '') + + . PHP_EOL + + ) + ); + + return Command::SUCCESS; + } +} \ No newline at end of file diff --git a/src/flextype/core/Console/FlextypeConsole.php b/src/flextype/core/Console/FlextypeConsole.php index 7d84198a..003aab32 100644 --- a/src/flextype/core/Console/FlextypeConsole.php +++ b/src/flextype/core/Console/FlextypeConsole.php @@ -17,6 +17,7 @@ declare(strict_types=1); namespace Flextype\Console; use Symfony\Component\Console\Application as ConsoleApplication; +use Flextype\Console\Commands\AboutCommand; use Flextype\Console\Commands\Entries\EntriesCreateCommand; use Flextype\Console\Commands\Entries\EntriesFetchCommand; use Flextype\Console\Commands\Entries\EntriesUpdateCommand; @@ -53,6 +54,7 @@ class FlextypeConsole extends ConsoleApplication public function run(InputInterface $input = null, OutputInterface $output = null) { // Add Console Commands + console()->add(new AboutCommand()); console()->add(new EntriesCreateCommand()); console()->add(new EntriesDeleteCommand()); console()->add(new EntriesUpdateCommand()); diff --git a/src/flextype/flextype.yaml b/src/flextype/flextype.yaml index 2b32482b..182ad2be 100644 --- a/src/flextype/flextype.yaml +++ b/src/flextype/flextype.yaml @@ -4,7 +4,7 @@ description: Hybrid Content Management System with the freedom of a headless CMS author: name: Sergey Romanenko email: awilum@msn.com - url: https://awilum.github.io/flextype + url: https://awilum.github.io homepage: https://github.com/flextype bugs: https://github.com/flextype/issues license: MIT