summaryrefslogtreecommitdiffstats
path: root/phpspec-autoload.php
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-05-08 08:54:54 +0200
committerRemi Collet <remi@remirepo.net>2017-05-08 08:54:54 +0200
commit86c95fba1b0a5e9ae9d1124a5da5821d3a7b9bc9 (patch)
treedaba119cdbdcb46c55d1c0e9397c8ed366c7ec9a /phpspec-autoload.php
parent57f13599e83b77c6acd2a29e9dba933fa4e8abf1 (diff)
fix autoloader for Symfony 3
Diffstat (limited to 'phpspec-autoload.php')
-rw-r--r--phpspec-autoload.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/phpspec-autoload.php b/phpspec-autoload.php
index 13e657f..f8fae7e 100644
--- a/phpspec-autoload.php
+++ b/phpspec-autoload.php
@@ -4,8 +4,13 @@
require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('PhpSpec\\', __DIR__);
-$vendorDir = stream_resolve_include_path('Symfony/Component/Console/Application.php');
-\Fedora\Autoloader\Autoload::addPsr4('Symfony\\Component\\', dirname(dirname($vendorDir)));
+if ($f = stream_resolve_include_path('Symfony3/Component/Console/Application.php')) {
+ \Fedora\Autoloader\Autoload::addPsr4('Symfony\\Component\\', dirname(dirname($f)));
+} else if ($f = stream_resolve_include_path('Symfony/Component/Console/Application.php')) {
+ \Fedora\Autoloader\Autoload::addPsr4('Symfony\\Component\\', dirname(dirname($f)));
+} else {
+ die("Can't find Symfony Framework\n");
+}
/* spec tree in current dir, when exists */
if (is_dir(getcwd().'/spec')) {