Fix issue of plugins autoload at bootstrap.

This commit is contained in:
Benoît Burnichon
2015-04-08 11:32:18 +02:00
parent 2eac08a0cc
commit 801eb39447
2 changed files with 11 additions and 3 deletions

View File

@@ -330,7 +330,9 @@ class Application extends SilexApplication
public function loadPlugins()
{
call_user_func(function ($app) {
if (file_exists($app['plugin.path'] . '/services.php')) {
require $app['plugin.path'] . '/services.php';
}
}, $this);
}
@@ -385,7 +387,10 @@ class Application extends SilexApplication
$this->extend('twig', function (\Twig_Environment $twig, $app) {
$twig->setCache($app['cache.path'].'/twig');
$paths = [];
if (file_exists($app['plugin.path'] . '/twig-paths.php')) {
$paths = require $app['plugin.path'] . '/twig-paths.php';
}
if ($app['browser']->isTablet() || $app['browser']->isMobile()) {
$paths[] = $app['root.path'] . '/config/templates/mobile';

View File

@@ -1,3 +1,6 @@
<?php
return require __DIR__ . '/../plugins/autoload.php';
require __DIR__ . '/../vendor/autoload.php';
if (file_exists(__DIR__ . '/../plugins/autoload.php')) {
require __DIR__ . '/../plugins/autoload.php';
}