From 292811ae137dfde0c84e69ddcfa618b2aab1d732 Mon Sep 17 00:00:00 2001 From: Adrien LAMOTTE Date: Tue, 17 Apr 2018 19:37:18 +0200 Subject: [PATCH 1/2] Try change dependencies --- .gitignore | 3 +++ composer.json | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3a9875b..37c0d4b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ /vendor/ composer.lock +/nbproject/private/ +nbproject/project.properties +nbproject/project.xml diff --git a/composer.json b/composer.json index 663b34d..4b0988f 100644 --- a/composer.json +++ b/composer.json @@ -16,11 +16,11 @@ ], "require": { "php": "^5.5|^7.0", - "symfony/console": "~2.7|~3.0|~4.0", - "symfony/dependency-injection": "~2.7|~3.0|~4.0", - "symfony/event-dispatcher": "~2.7|~3.0|~4.0", - "symfony/framework-bundle": "~2.7|~3.0|~4.0", - "symfony/http-kernel": "~2.7|~3.0|~4.0" + "symfony/console": "~2.7|~4.0", + "symfony/dependency-injection": "~2.7|~4.0", + "symfony/event-dispatcher": "~2.7|~4.0", + "symfony/framework-bundle": "~2.7|~4.0", + "symfony/http-kernel": "~2.7|~4.0" }, "require-dev": { "doctrine/doctrine-fixtures-bundle": "^2.2", From 37766816d9240a83f524fe85a60a8d5a55daad22 Mon Sep 17 00:00:00 2001 From: Adrien LAMOTTE Date: Wed, 18 Apr 2018 21:50:49 +0200 Subject: [PATCH 2/2] Update for Symfony 4 --- Console/ApplicationFactory.php | 2 +- Controller/ConsoleController.php | 12 +++++++----- DataCollector/DataCollector.php | 4 ++++ Executer/CommandExecuter.php | 2 +- Resources/config/services.yml | 13 ++++++++----- Resources/views/Console/console.html.twig | 6 +++--- Resources/views/Toolbar/toolbar.html.twig | 4 ++-- 7 files changed, 26 insertions(+), 17 deletions(-) diff --git a/Console/ApplicationFactory.php b/Console/ApplicationFactory.php index a2562f8..4df8828 100644 --- a/Console/ApplicationFactory.php +++ b/Console/ApplicationFactory.php @@ -43,7 +43,7 @@ private function registerCommandsToApplication(Application $application, KernelI } /** - * @return Bundle[] + * @return BundleInterface[] */ private function getBundlesFromKernel(KernelInterface $kernel) { diff --git a/Controller/ConsoleController.php b/Controller/ConsoleController.php index 58c2647..1df6470 100644 --- a/Controller/ConsoleController.php +++ b/Controller/ConsoleController.php @@ -13,14 +13,16 @@ use CoreSphere\ConsoleBundle\Contract\Executer\CommandExecuterInterface; use Symfony\Bundle\FrameworkBundle\Console\Application; +use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; +use Symfony\Bundle\TwigBundle\TwigEngine; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Templating\EngineInterface; +use Twig_Environment; class ConsoleController { /** - * @var EngineInterface + * @var Twig_Environment */ private $templating; @@ -40,7 +42,7 @@ class ConsoleController private $environment; public function __construct( - EngineInterface $templating, + Twig_Environment $templating, CommandExecuterInterface $commandExecuter, Application $application, $environment @@ -54,7 +56,7 @@ public function __construct( public function consoleAction() { return new Response( - $this->templating->render('CoreSphereConsoleBundle:Console:console.html.twig', [ + $this->templating->render('@CoreSphereConsole/Console/console.html.twig', [ 'working_dir' => getcwd(), 'environment' => $this->environment, 'commands' => $this->application->all(), @@ -78,7 +80,7 @@ public function execAction(Request $request) return new Response( $this->templating->render( - 'CoreSphereConsoleBundle:Console:result.json.twig', + '@CoreSphereConsole/Console/result.json.twig', ['commands' => $executedCommandsOutput] ) ); diff --git a/DataCollector/DataCollector.php b/DataCollector/DataCollector.php index 6b3e020..cd41c59 100644 --- a/DataCollector/DataCollector.php +++ b/DataCollector/DataCollector.php @@ -31,4 +31,8 @@ public function getName() { return 'coresphere_console'; } + + public function reset(){ + + } } diff --git a/Executer/CommandExecuter.php b/Executer/CommandExecuter.php index 484589b..af3a553 100644 --- a/Executer/CommandExecuter.php +++ b/Executer/CommandExecuter.php @@ -72,7 +72,7 @@ private function getApplication(InputInterface $input) } /** - * @return KernelInterface + * @return */ private function getKernel(InputInterface $input) { diff --git a/Resources/config/services.yml b/Resources/config/services.yml index ce66174..8ac7b07 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -1,11 +1,14 @@ services: + coresphere_console.controller: class: CoreSphere\ConsoleBundle\Controller\ConsoleController + public: true + tags: ['controller.service_arguments'] arguments: - - "@templating" - - "@coresphere_console.executer" - - "@coresphere_console.application" - - "%kernel.environment%" + $templating: "@twig" + $commandExecuter: "@coresphere_console.executer" + $application: "@coresphere_console.application" + $environment: "%kernel.environment%" coresphere_console.executer: class: CoreSphere\ConsoleBundle\Executer\CommandExecuter @@ -22,7 +25,7 @@ services: coresphere_console.toolbar: class: CoreSphere\ConsoleBundle\DataCollector\DataCollector tags: - - { name: data_collector, template: "CoreSphereConsoleBundle:Toolbar:toolbar", id: "coresphere_console" } + - { name: data_collector, template: "@CoreSphereConsole/Toolbar/toolbar.html.twig", id: "coresphere_console" } # console application coresphere_console.application.factory: diff --git a/Resources/views/Console/console.html.twig b/Resources/views/Console/console.html.twig index 851af8e..b0099cf 100644 --- a/Resources/views/Console/console.html.twig +++ b/Resources/views/Console/console.html.twig @@ -1,4 +1,4 @@ -{% extends 'CoreSphereConsoleBundle::base.html.twig' %} +{% extends '@CoreSphereConsole/base.html.twig' %} {% block title %}{{ 'coresphere_console.headline.index'|trans }}{% endblock %} @@ -8,8 +8,8 @@ {% endblock %} {% block body %} - {% include 'CoreSphereConsoleBundle:Console:terminal.html.twig' %} - {% include 'CoreSphereConsoleBundle:Console:htmlTemplates.html.twig' %} + {% include '@CoreSphereConsole/Console/terminal.html.twig' %} + {% include '@CoreSphereConsole/Console/htmlTemplates.html.twig' %} {% endblock %} {% block javascripts %} diff --git a/Resources/views/Toolbar/toolbar.html.twig b/Resources/views/Toolbar/toolbar.html.twig index 96b3bf1..fdf576f 100644 --- a/Resources/views/Toolbar/toolbar.html.twig +++ b/Resources/views/Toolbar/toolbar.html.twig @@ -1,4 +1,4 @@ -{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} +{% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} {% set icon %} @@ -11,5 +11,5 @@ UNOFjKO13ggwECDAAAMNHZ7ErsJjAAAAAElFTkSuQmCC"/> {% endset %} {% set text %}Console{% endset %} - {% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': false } %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': false } %} {% endblock %}