diff --git a/bundles/SystemInfoBundle/README.md b/bundles/SystemInfoBundle/README.md index d998868..a9f1175 100644 --- a/bundles/SystemInfoBundle/README.md +++ b/bundles/SystemInfoBundle/README.md @@ -14,14 +14,3 @@ Zend OPcache information, showing statistics, settings and cached files, and pro for the cache information. You can check via Admin UI `Tools` / `System Info & Tools` / `PHP OPcache Status` menu. - -### System Requirements Check -A tool that gives you an overview of required and optional system requirements for running Pimcore Application. - -You can check via Admin UI `Tools` / `System Info & Tools` / `System-Requirements Check` menu. - -Or via following CLI command: - -```bash -bin/console pimcore:system:requirements:check -``` \ No newline at end of file diff --git a/bundles/SystemInfoBundle/config/services.yaml b/bundles/SystemInfoBundle/config/services.yaml index 33ef936..e962d9c 100644 --- a/bundles/SystemInfoBundle/config/services.yaml +++ b/bundles/SystemInfoBundle/config/services.yaml @@ -9,8 +9,3 @@ services: resource: '../src/Controller' public: true tags: [ 'controller.service_arguments' ] - - # auto-register all commands as services - Pimcore\Bundle\SystemInfoBundle\Command\: - resource: '../src/Command' - tags: [ 'console.command' ] \ No newline at end of file diff --git a/bundles/SystemInfoBundle/public/css/icons.css b/bundles/SystemInfoBundle/public/css/icons.css index dee2ae0..703145c 100644 --- a/bundles/SystemInfoBundle/public/css/icons.css +++ b/bundles/SystemInfoBundle/public/css/icons.css @@ -14,10 +14,6 @@ background: url(/bundles/pimcoreadmin/img/flat-color-icons/php.svg) center center no-repeat !important; } -.pimcore_icon_systemrequirements { - background: url(/bundles/pimcoreadmin/img/flat-color-icons/factory.svg) center center no-repeat !important; -} - .pimcore_icon_reports { background: url(/bundles/pimcoreadmin/img/flat-color-icons/pie_chart.svg) center center no-repeat !important; } \ No newline at end of file diff --git a/bundles/SystemInfoBundle/public/js/startup.js b/bundles/SystemInfoBundle/public/js/startup.js index 4355d45..91118f5 100644 --- a/bundles/SystemInfoBundle/public/js/startup.js +++ b/bundles/SystemInfoBundle/public/js/startup.js @@ -16,6 +16,7 @@ pimcore.bundle.system_info.startup = Class.create({ }, addSystemInfoMenu: function (menu) { + let that = this; const items = []; const user = pimcore.globalmanager.get('user'); const perspectiveConfig = pimcore.globalmanager.get("perspective"); @@ -28,7 +29,7 @@ pimcore.bundle.system_info.startup = Class.create({ text: t('bundle_systemInfo_php_info'), iconCls: 'pimcore_nav_icon_php', itemId: 'pimcore_menu_extras_system_info_php_info', - handler: this.showPhpInfo, + handler: that.showPhpInfo, priority: 10, }); } @@ -38,20 +39,10 @@ pimcore.bundle.system_info.startup = Class.create({ text: t('bundle_systemInfo_php_opcache_status'), iconCls: 'pimcore_nav_icon_reports', itemId: 'pimcore_menu_extras_system_info_php_opcache_status', - handler: this.showOpcacheStatus, + handler: that.showOpcacheStatus, priority: 20, }); } - - if (perspectiveConfig.inToolbar('extras.systemtools.requirements')) { - menu.extras.items[index].menu.items.push({ - text: t('bundle_systemInfo_system_requirements_check'), - iconCls: 'pimcore_nav_icon_systemrequirements', - itemId: 'pimcore_menu_extras_system_info_system_requirements_check', - handler: this.showSystemRequirementsCheck, - priority: 30, - }); - } } }); } @@ -66,11 +57,6 @@ pimcore.bundle.system_info.startup = Class.create({ showOpcacheStatus: function () { pimcore.helpers.openGenericIframeWindow("opcachestatus", Routing.generate('pimcore_bundle_systeminfo_opcache_index'), "pimcore_icon_reports", "PHP OPcache Status"); }, - - showSystemRequirementsCheck: function () { - pimcore.helpers.openGenericIframeWindow("systemrequirementscheck", Routing.generate('pimcore_bundle_systeminfo_settings_installcheck'), "pimcore_icon_systemrequirements", "System-Requirements Check"); - }, - }); var bundle_system_info = new pimcore.bundle.system_info.startup(); \ No newline at end of file diff --git a/bundles/SystemInfoBundle/src/Command/RequirementsCheckCommand.php b/bundles/SystemInfoBundle/src/Command/RequirementsCheckCommand.php deleted file mode 100644 index 2a9b5b4..0000000 --- a/bundles/SystemInfoBundle/src/Command/RequirementsCheckCommand.php +++ /dev/null @@ -1,116 +0,0 @@ -setName('pimcore:system:requirements:check') - ->setAliases(['system:requirements:check']) - ->setDescription('Check system requirements') - ->addOption('min-level', 'l', InputOption::VALUE_OPTIONAL, "Minimum status level to report: 'warning' or 'error'"); - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output): int - { - switch ($input->getOption('min-level')) { - case 'warning': - case 'warnings': - $this->levelsToDisplay = [Requirements\Check::STATE_WARNING, Requirements\Check::STATE_ERROR]; - - break; - case 'error': - case 'errors': - $this->levelsToDisplay = [Requirements\Check::STATE_ERROR]; - - break; - default: - $this->levelsToDisplay = [Requirements\Check::STATE_OK, Requirements\Check::STATE_WARNING, Requirements\Check::STATE_ERROR]; - - break; - } - - $allChecks = Requirements::checkAll(Db::get()); - - $this->display($allChecks['checksPHP'], 'PHP'); - $this->display($allChecks['checksMySQL'], 'MySQL'); - $this->display($allChecks['checksFS'], 'Filesystem'); - $this->display($allChecks['checksApps'], 'CLI Tools & Applications'); - - return 0; - } - - /** - * @param Requirements\Check[] $checks - */ - protected function display(array $checks, string $title = ''): void - { - $checksTab = []; - - foreach ($checks as $check) { - if (in_array($check->getState(), $this->levelsToDisplay)) { - $checksTab[] = [$check->getName(), $this->displayState($check->getState())]; - } - } - - if (!empty($checksTab)) { - $this->io->table(["$title", ''], $checksTab); - } - } - - protected function displayState(int $state): string - { - switch ($state) { - case Requirements\Check::STATE_OK: - $displayState = 'ok'; - - break; - case Requirements\Check::STATE_WARNING: - $displayState = 'warning'; - - break; - case Requirements\Check::STATE_ERROR: - default: - $displayState = 'error'; - - break; - } - - return $displayState; - } -} diff --git a/bundles/SystemInfoBundle/src/Controller/SettingsController.php b/bundles/SystemInfoBundle/src/Controller/SettingsController.php index d9c019d..f3fdb31 100644 --- a/bundles/SystemInfoBundle/src/Controller/SettingsController.php +++ b/bundles/SystemInfoBundle/src/Controller/SettingsController.php @@ -56,25 +56,4 @@ public function phpinfoAction(Request $request, ?Profiler $profiler): Response return new Response($content); } - - /** - * @Route("/install-check", name="pimcore_bundle_systeminfo_settings_installcheck", methods={"GET", "POST"}) - * - * @param Request $request - * @param Connection $db - * @param Profiler|null $profiler - * - * @return Response - */ - public function checkAction(Request $request, Connection $db, ?Profiler $profiler): Response - { - if ($profiler) { - $profiler->disable(); - } - - $viewParams = Requirements::checkAll($db); - $viewParams['headless'] = $request->query->getBoolean('headless') || $request->request->getBoolean('headless'); - - return $this->render('@PimcoreSystemInfo/admin/install/check.html.twig', $viewParams); - } } diff --git a/bundles/SystemInfoBundle/templates/admin/install/check.html.twig b/bundles/SystemInfoBundle/templates/admin/install/check.html.twig deleted file mode 100644 index 19a0ce7..0000000 --- a/bundles/SystemInfoBundle/templates/admin/install/check.html.twig +++ /dev/null @@ -1,141 +0,0 @@ -{% if not headless -%} - - - - - - - -{%- endif %} - -{% macro check(check) %} - {% set icon = 'high_priority' %} - {% if check.state == constant('\Pimcore\\Tool\\Requirements\\Check::STATE_OK') %} - {% set icon = 'ok' %} - {% elseif check.state == constant('\Pimcore\\Tool\\Requirements\\Check::STATE_WARNING') %} - {% set icon = 'overlay-error' %} - {% endif %} - - - - {% if check.link is not empty %} - {{ check.name }} - {% else %} - {{ check.name }} - {% endif %} - - - - -{% endmacro %} - -{% import _self as s %} - - - - - - - - - -
-

PHP

- - - {% for check in checksPHP %} - {{ s.check(check) }} - {% endfor %} - -
-
-

MySQL

- - - {% for check in checksMySQL %} - {{ s.check(check) }} - {% endfor %} - -
-
-

Filesystem

- - - {% for check in checksFS %} - {{ s.check(check) }} - {% endfor %} - -
- -
-
- -

CLI Tools & Applications

- - - {% for check in checksApps %} - {{ s.check(check) }} - {% endfor %} - -
-
- -
-

- Explanation: -

-

- Everything ok - Recommended but not required - Required -

-
- -{% if not headless -%} - - -{%- endif %} diff --git a/bundles/SystemInfoBundle/translations/admin.en.yaml b/bundles/SystemInfoBundle/translations/admin.en.yaml index 7512279..958a39e 100644 --- a/bundles/SystemInfoBundle/translations/admin.en.yaml +++ b/bundles/SystemInfoBundle/translations/admin.en.yaml @@ -1,3 +1,2 @@ bundle_systemInfo_php_opcache_status: PHP OPcache status -bundle_systemInfo_system_requirements_check: System-Requirements Check bundle_systemInfo_php_info: PHP Info \ No newline at end of file