/Tests/autoload.php.dist
http://github.com/FriendsOfSymfony/FOSFacebookBundle · Unknown · 35 lines · 30 code · 5 blank · 0 comment · 0 complexity · 7b32266433874ea5f617c37d7bdeb966 MD5 · raw file
- <?php
- /*
- * This file is part of the FOSFacebookBundle package.
- *
- * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- $vendorDir = __DIR__.'/../vendor';
- require_once $vendorDir.'/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
- use Symfony\Component\ClassLoader\UniversalClassLoader;
- $loader = new UniversalClassLoader();
- $loader->registerNamespaces(array(
- 'Symfony' => array($vendorDir.'/symfony/src'),
- ));
- $loader->registerPrefixes(array(
- 'Twig_' => $vendorDir.'/twig/lib',
- ));
- $loader->register();
- spl_autoload_register(function($class) {
- if (0 === strpos($class, 'FOS\\FacebookBundle\\')) {
- $path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
- if (!stream_resolve_include_path($path)) {
- return false;
- }
- require_once $path;
- return true;
- }
- });