From f9b1f0ab5e8791f70c683bf140e80e787c1572b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Thu, 12 Sep 2013 15:03:23 +0200 Subject: [PATCH] [*] Core: don't re-generate the class_index.php file if a class is not known to avoid misuse of class_exists() --- .../template/controllers/performance/helpers/form/form.tpl | 2 +- classes/Autoload.php | 3 +-- controllers/admin/AdminPerformanceController.php | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/performance/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/performance/helpers/form/form.tpl index 5e9db0548..efb117fa9 100644 --- a/admin-dev/themes/default/template/controllers/performance/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/performance/helpers/form/form.tpl @@ -41,7 +41,7 @@ {/if} {$smarty.block.parent} {if $input.type == 'radio' && $input.name == 'smarty_cache'} - {l s='Clear Smarty cache'} + {l s='Clear Smarty cache & Autoload cache'} {/if} {/block} diff --git a/classes/Autoload.php b/classes/Autoload.php index 91864a22d..a07c7f068 100644 --- a/classes/Autoload.php +++ b/classes/Autoload.php @@ -81,8 +81,7 @@ class Autoload return; // regenerate the class index if the requested class is not found in the index or if the requested file doesn't exists - if (!isset($this->index[$classname]) - || ($this->index[$classname] && !is_file($this->root_dir.$this->index[$classname])) + if ((isset($this->index[$classname]) && $this->index[$classname] && !is_file($this->root_dir.$this->index[$classname])) || (isset($this->index[$classname.'Core']) && $this->index[$classname.'Core'] && !is_file($this->root_dir.$this->index[$classname.'Core']))) $this->generateIndex(); diff --git a/controllers/admin/AdminPerformanceController.php b/controllers/admin/AdminPerformanceController.php index 798e1912d..acfbe4d20 100644 --- a/controllers/admin/AdminPerformanceController.php +++ b/controllers/admin/AdminPerformanceController.php @@ -796,6 +796,7 @@ class AdminPerformanceControllerCore extends AdminController { $redirectAdmin = true; Tools::clearSmartyCache(); + Autoload::getInstance()->generateIndex(); } if ($redirectAdmin && (!isset($this->errors) || !count($this->errors)))