Skip to content

Commit 10542f7

Browse files
committed
Merge pull request #11 from LExpress/cli-autoload
Use composer autoload file when available
2 parents 53213f3 + 61879ac commit 10542f7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/command/cli.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
/*
44
* This file is part of the symfony package.
55
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6-
*
6+
*
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*/
1010

11-
require_once(dirname(__FILE__).'/../autoload/sfCoreAutoload.class.php');
12-
sfCoreAutoload::register();
11+
// Try autoloading using composer if available.
12+
if (!file_exists($autoload = dirname(__FILE__).'/../../../../autoload.php'))
13+
{
14+
$autoload = dirname(__FILE__).'/../../autoload.php';
15+
}
16+
require_once $autoload;
1317

1418
try
1519
{

0 commit comments

Comments
 (0)