app/autoload.php
author ymh <ymh.work@gmail.com>
Wed, 22 Feb 2012 15:52:30 +0100
changeset 71 b01e36991488
parent 58 624e5900f5a4
permissions -rwxr-xr-x
add headers for public repository release
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
71
b01e36991488 add headers for public repository release
ymh <ymh.work@gmail.com>
parents: 58
diff changeset
     2
/*
b01e36991488 add headers for public repository release
ymh <ymh.work@gmail.com>
parents: 58
diff changeset
     3
 * This file is part of the WikiTagBundle package.
b01e36991488 add headers for public repository release
ymh <ymh.work@gmail.com>
parents: 58
diff changeset
     4
 *
b01e36991488 add headers for public repository release
ymh <ymh.work@gmail.com>
parents: 58
diff changeset
     5
 * (c) IRI <http://www.iri.centrepompidou.fr/>
b01e36991488 add headers for public repository release
ymh <ymh.work@gmail.com>
parents: 58
diff changeset
     6
 *
b01e36991488 add headers for public repository release
ymh <ymh.work@gmail.com>
parents: 58
diff changeset
     7
 * For the full copyright and license information, please view the LICENSE
b01e36991488 add headers for public repository release
ymh <ymh.work@gmail.com>
parents: 58
diff changeset
     8
 * file that was distributed with this source code.
b01e36991488 add headers for public repository release
ymh <ymh.work@gmail.com>
parents: 58
diff changeset
     9
 */
b01e36991488 add headers for public repository release
ymh <ymh.work@gmail.com>
parents: 58
diff changeset
    10
0
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
use Symfony\Component\ClassLoader\UniversalClassLoader;
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
use Doctrine\Common\Annotations\AnnotationRegistry;
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
$loader = new UniversalClassLoader();
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
$loader->registerNamespaces(array(
58
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    17
    'Symfony'                        => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    18
    'Sensio'                         => __DIR__.'/../vendor/bundles',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    19
    'JMS'                            => __DIR__.'/../vendor/bundles',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    20
	'Doctrine\\Common\\DataFixtures' => __DIR__.'/../vendor/doctrine-fixtures/lib',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    21
    'Doctrine\\Common'               => __DIR__.'/../vendor/doctrine-common/lib',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    22
	'Doctrine\\DBAL\\Migrations'     => __DIR__.'/../vendor/doctrine-migrations/lib',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    23
    'Doctrine\\DBAL'                 => __DIR__.'/../vendor/doctrine-dbal/lib',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    24
    'Doctrine'                       => __DIR__.'/../vendor/doctrine/lib',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    25
    'Monolog'                        => __DIR__.'/../vendor/monolog/src',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    26
    'Assetic'                        => __DIR__.'/../vendor/assetic/src',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    27
    'Metadata'                       => __DIR__.'/../vendor/metadata/src',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    28
    'FOS'                            => __DIR__.'/../vendor/bundles',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    29
	'Pagerfanta'  			         => __DIR__.'/../vendor/bundles',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    30
	'Mandango\Mondator'              => __DIR__.'/../vendor/mondator/src',
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents: 39
diff changeset
    31
	'IRI\Bundle\WikiTagBundle'       => __DIR__.'/../vendor/bundles',
0
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
));
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
$loader->registerPrefixes(array(
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
    'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
    'Twig_'            => __DIR__.'/../vendor/twig/lib',
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
));
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
// intl
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
if (!function_exists('intl_get_error_code')) {
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
    require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
    $loader->registerPrefixFallbacks(array(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
}
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
$loader->registerNamespaceFallbacks(array(
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
    __DIR__.'/../src',
24
57ff6d39f88c first full dynamic version of the bundle
ymh <ymh.work@gmail.com>
parents: 18
diff changeset
    47
    __DIR__.'/cache/dev/wikitag',
57ff6d39f88c first full dynamic version of the bundle
ymh <ymh.work@gmail.com>
parents: 18
diff changeset
    48
    __DIR__.'/cache/prod/wikitag',
57ff6d39f88c first full dynamic version of the bundle
ymh <ymh.work@gmail.com>
parents: 18
diff changeset
    49
    __DIR__.'/cache/test/wikitag',
32
f166042d4421 add event on tag changed
ymh <ymh.work@gmail.com>
parents: 24
diff changeset
    50
    __DIR__.'/cache/task/wikitag',
0
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
));
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
$loader->register();
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
AnnotationRegistry::registerLoader(function($class) use ($loader) {
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
    $loader->loadClass($class);
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
    return class_exists($class, false);
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
});
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
// Swiftmailer needs a special autoloader to allow
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
// the lazy loading of the init file (which is expensive)
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
require_once __DIR__.'/../vendor/swiftmailer/lib/classes/Swift.php';
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/lib/swift_init.php');
7f95f8617b0b first commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64