diff options
author | Remi Collet <fedora@famillecollet.com> | 2012-10-06 15:51:28 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2012-10-06 15:51:28 +0200 |
commit | 084de53fba62a64b631940b15e061d6086110a5b (patch) | |
tree | 9e7981cb502d6e6139673b165d0b29ac3d55e214 /bootstrap.php | |
parent | 6dafe37b2ed8d895cd9f74ab954a75c539882123 (diff) |
php-symfony2-DependencyInjection 2.1.2
Diffstat (limited to 'bootstrap.php')
-rw-r--r-- | bootstrap.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bootstrap.php b/bootstrap.php new file mode 100644 index 0000000..fefa0b3 --- /dev/null +++ b/bootstrap.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +spl_autoload_register(function ($class) { + if (0 === strpos(ltrim($class, '/'), 'Symfony\Component')) { + $file = substr(str_replace('\\', '/', $class), strlen('Symfony\Component')).'.php'; + if (file_exists(__DIR__.'/../..'.$file)) { + # Run from source tree + require_once __DIR__.'/../..'.$file; + } else { + # Run from install dir + require_once 'Symfony/Component'.$file; + } + } +}); |