Browse Source

Merge pull request #5702 from AD7six/3.0-move-plugins-php

Move the plugins.php file to the vendor folder
Mark Story 11 years ago
parent
commit
646ea2cdb9
1 changed files with 8 additions and 3 deletions
  1. 8 3
      src/Core/Plugin.php

+ 8 - 3
src/Core/Plugin.php

@@ -186,10 +186,15 @@ class Plugin
         if (Configure::check('plugins')) {
             return;
         }
-        try {
-            Configure::load('plugins');
-        } catch (\Exception $e) {
+
+        $vendorFile = dirname(dirname(dirname(dirname(__DIR__)))) . DS . 'cakephp-plugins.php';
+        if (!file_exists($vendorFile)) {
+            Configure::write(['plugins' => []]);
+            return;
         }
+
+        $config = require $vendorFile;
+        Configure::write($config);
     }
 
     /**