/**
  * @dataProvider getLoadClassFromFallbackTests
  */
 public function testLoadClassFromFallback($className, $testClassName, $message)
 {
     $loader = new UniversalClassLoader();
     $loader->registerNamespace('Namespaced', __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures');
     $loader->registerPrefix('Pearlike_', __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures');
     $loader->registerNamespaceFallbacks(array(__DIR__ . DIRECTORY_SEPARATOR . 'Fixtures/fallback'));
     $loader->registerPrefixFallbacks(array(__DIR__ . DIRECTORY_SEPARATOR . 'Fixtures/fallback'));
     $loader->loadClass($testClassName);
     $this->assertTrue(class_exists($className), $message);
 }
예제 #2
0
    'Symfony'          => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
    'Sensio'           => __DIR__.'/../vendor/bundles',
    'JMS'              => __DIR__.'/../vendor/bundles',
    'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
    'Doctrine\\DBAL\\Migrations'         => __DIR__.'/../vendor/doctrine-migrations/lib',
    'Doctrine\\DBAL'   => __DIR__.'/../vendor/doctrine-dbal/lib',
    'Doctrine'         => __DIR__.'/../vendor/doctrine/lib',
    'Monolog'          => __DIR__.'/../vendor/monolog/src',
    'Assetic'          => __DIR__.'/../vendor/assetic/src',
    'Metadata'         => __DIR__.'/../vendor/metadata/src',
    'TaskBoxx'          => __DIR__.'/../src',
    'Bundle'           => __DIR__.'/../src',
    'Knplabs'           => __DIR__.'/../src/Bundle',
));
$loader->registerPrefixes(array(
    'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
    'Twig_'            => __DIR__.'/../vendor/twig/lib',
));
$loader->registerPrefixFallbacks(array(
    __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs',
));
$loader->registerNamespaceFallbacks(array(
    __DIR__.'/../src',
));
$loader->register();

// Swiftmailer needs a special autoloader to allow
// the lazy loading of the init file (which is expensive)
require_once __DIR__.'/../vendor/swiftmailer/lib/classes/Swift.php';
Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/lib/swift_init.php');
예제 #3
0
파일: autoload.php 프로젝트: niutech/SOA
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;
set_time_limit(0);
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => array(__DIR__ . '/../vendor/symfony/src', __DIR__ . '/../vendor/bundles'), 'Sensio' => __DIR__ . '/../vendor/bundles', 'JMS' => __DIR__ . '/../vendor/bundles', 'Doctrine\\Common' => __DIR__ . '/../vendor/doctrine-common/lib', 'Doctrine\\DBAL' => __DIR__ . '/../vendor/doctrine-dbal/lib', 'Doctrine' => __DIR__ . '/../vendor/doctrine/lib', 'Monolog' => __DIR__ . '/../vendor/monolog/src', 'Assetic' => __DIR__ . '/../vendor/assetic/src', 'Metadata' => __DIR__ . '/../vendor/metadata/src'));
$loader->registerPrefixes(array('Twig_Extensions_' => __DIR__ . '/../vendor/twig-extensions/lib', 'Twig_' => __DIR__ . '/../vendor/twig/lib', 'Zend_' => __DIR__ . '/../vendor/zend/lib'));
// intl
if (!function_exists('intl_get_error_code')) {
    require_once __DIR__ . '/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
    $loader->registerPrefixFallbacks(array(__DIR__ . '/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
}
//ZF include
set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/../vendor/zend/lib');
$loader->registerPrefixFallbacks(explode(PATH_SEPARATOR, get_include_path()));
$loader->registerNamespaceFallbacks(array(__DIR__ . '/../src'));
$loader->register();
AnnotationRegistry::registerLoader(function ($class) use($loader) {
    $loader->loadClass($class);
    return class_exists($class, false);
});
AnnotationRegistry::registerFile(__DIR__ . '/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
// Swiftmailer needs a special autoloader to allow
// the lazy loading of the init file (which is expensive)
require_once __DIR__ . '/../vendor/swiftmailer/lib/classes/Swift.php';
Swift::registerAutoload(__DIR__ . '/../vendor/swiftmailer/lib/swift_init.php');
예제 #4
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;
define('ROOTDIR', __DIR__ . '/../../../..');
define('LIBDIR', __DIR__);
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => array(ROOTDIR . '/vendor/symfony/src', ROOTDIR . '/vendor/bundles'), 'RedpillLinpro' => ROOTDIR . '/vendor/bundles', 'Doctrine\\Common' => ROOTDIR . '/vendor/doctrine-common/lib', 'Doctrine\\DBAL' => ROOTDIR . '/vendor/doctrine-dbal/lib', 'Doctrine' => ROOTDIR . '/vendor/doctrine/lib', 'al13_debug' => ROOTDIR . '/vendor'));
// intl
if (!function_exists('intl_get_error_code')) {
    require_once ROOTDIR . '/vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
    $loader->registerPrefixFallbacks(array(ROOTDIR . '/vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
}
$loader->register();
AnnotationRegistry::registerLoader(function ($class) use($loader) {
    $loader->loadClass($class);
    return class_exists($class, false);
});
AnnotationRegistry::registerFile(ROOTDIR . '/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
require_once ROOTDIR . '/vendor/Vgid/Client.php';
require_once ROOTDIR . '/vendor/al13_debug/config/bootstrap.php';
dbc('Doctrine\\Common\\Annotations\\AnnotationReader');
dbc('ReflectionClass');
dbp('_entitymanager');
dbp('_gamineservice');