Esempio n. 1
0
function sf2AutoLoad()
{
    $loader = new UniversalClassLoader();
    $loader->registerNamespaces(array('Sf2Plugins' => __DIR__ . '/src'));
    $loader->registerPrefixes(array('Twig_Extensions_' => __DIR__ . '/lib/Twig-extensions/lib', 'Twig_' => __DIR__ . '/lib/Twig/lib'));
    $loader->register();
}
 /**
  * @dataProvider getLoadClassNamespaceCollisionTests
  */
 public function testLoadClassNamespaceCollision($namespaces, $className, $message)
 {
     $loader = new UniversalClassLoader();
     $loader->registerNamespaces($namespaces);
     $loader->loadClass($className);
     $this->assertTrue(class_exists($className), $message);
 }
Esempio n. 3
0
 /**
  * Constructor
  *
  * @param KernelInterface $kernel
  */
 public function __construct(KernelInterface $kernel)
 {
     // register email address proxy class loader
     $loader = new UniversalClassLoader();
     $loader->registerNamespaces([self::ENTITY_PROXY_NAMESPACE => $kernel->getCacheDir() . DIRECTORY_SEPARATOR . self::CACHED_ENTITIES_DIR_NAME]);
     $loader->register();
 }
Esempio n. 4
0
 /**
  * An array of file paths retrieved from {@see files()}.
  *
  * @param  array  $files A list of file paths.
  * @return array         A list of classes.
  */
 public static function classes(array $files)
 {
     $loader = new UniversalClassLoader();
     // Support PSR-0 autoloading with a composer.json file
     // @todo: Add support for Composer's classmap autoloading.
     if (file_exists(VANITY_PROJECT_WORKING_DIR . '/vendor/composer/autoload_namespaces.php')) {
         // Register namespaces with the class loader
         $loader->registerNamespaces(include VANITY_PROJECT_WORKING_DIR . '/vendor/composer/autoload_namespaces.php');
     } elseif (file_exists(VANITY_PROJECT_WORKING_DIR . '/composer.json')) {
         // Register namespaces with the class loader
         $composer = json_decode(file_get_contents(VANITY_PROJECT_WORKING_DIR . '/composer.json'), true);
         if (isset($composer['autoload']) && isset($composer['autoload']['psr-0'])) {
             $loader->registerNamespaces($composer['autoload']['psr-0']);
         }
     }
     $loader->register();
     $class_list = array();
     // Collect all current classes, interfaces and traits
     if (SystemStore::get('_.php54')) {
         $before = array_merge(get_declared_classes(), get_declared_interfaces(), get_declared_traits());
     } else {
         $before = array_merge(get_declared_classes(), get_declared_interfaces());
     }
     foreach ($files as $file) {
         include_once $file;
     }
     // Handle traits if this version of PHP supports them.
     if (SystemStore::get('_.php54')) {
         $after = array_merge(get_declared_classes(), get_declared_interfaces(), get_declared_traits());
     } else {
         $after = array_merge(get_declared_classes(), get_declared_interfaces());
     }
     // We should be able to document ourselves
     if (defined('VANITY_AM_I')) {
         $after = array_filter($after, function ($class) {
             return substr($class, 0, 7) !== 'Vanity\\';
         });
     }
     $class_list = array_values(array_unique(array_diff($after, $before)));
     sort($class_list);
     return $class_list;
 }
Esempio n. 5
0
 /**
  * Check for composer in Namespace
  * and include via phar if possible
  */
 public static function checkComposer($pathToComposer = null)
 {
     if (!class_exists("Composer\\Factory")) {
         if (false === ($pathToComposer = self::whichComposer($pathToComposer))) {
             throw new \RuntimeException("Could not find composer.phar");
         }
         \Phar::loadPhar($pathToComposer, 'composer.phar');
         $loader = new UniversalClassLoader();
         $namespaces = (include "phar://composer.phar/vendor/composer/autoload_namespaces.php");
         $loader->registerNamespaces(array_merge(array('Composer' => "phar://composer.phar/src/"), $namespaces));
         $loader->register(true);
     }
 }
Esempio n. 6
0
 /**
  * Initialise.
  *
  * Runs at plugin init time.
  *
  * @return void
  */
 public function initialize(GenericEvent $event)
 {
     // register namespace
     // Because the standard kernel classloader already has Doctrine registered as a namespace
     // we have to add a new loader onto the spl stack.
     $autoloader = new UniversalClassLoader();
     $autoloader->register();
     $autoloader->registerNamespaces(array('DoctrineProxy' => 'ztemp/doctrinemodels'));
     $container = $event->getDispatcher()->getContainer();
     $config = $GLOBALS['ZConfig']['DBInfo']['databases']['default'];
     $dbConfig = array('host' => $config['host'], 'user' => $config['user'], 'password' => $config['password'], 'dbname' => $config['dbname'], 'driver' => 'pdo_' . $config['dbdriver']);
     $r = new \ReflectionClass('Doctrine\\Common\\Cache\\' . $container['dbcache.type'] . 'Cache');
     $dbCache = $r->newInstance();
     $ORMConfig = new \Doctrine\ORM\Configuration();
     $container->set('doctrine.configuration', $ORMConfig);
     $ORMConfig->setMetadataCacheImpl($dbCache);
     // create proxy cache dir
     \CacheUtil::createLocalDir('doctrinemodels');
     // setup annotations base
     include_once \ZLOADER_PATH . '/../vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php';
     // setup annotation reader
     $reader = new \Doctrine\Common\Annotations\AnnotationReader();
     $cacheReader = new \Doctrine\Common\Annotations\CachedReader($reader, new \Doctrine\Common\Cache\ArrayCache());
     $container->set('doctrine.annotationreader', $cacheReader);
     // setup annotation driver
     $annotationDriver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($cacheReader);
     $container->set('doctrine.annotationdriver', $annotationDriver);
     // setup driver chains
     $driverChain = new \Doctrine\ORM\Mapping\Driver\DriverChain();
     $container->set('doctrine.driverchain', $driverChain);
     // configure Doctrine ORM
     $ORMConfig->setMetadataDriverImpl($annotationDriver);
     $ORMConfig->setQueryCacheImpl($dbCache);
     $ORMConfig->setProxyDir(\CacheUtil::getLocalDir('doctrinemodels'));
     $ORMConfig->setProxyNamespace('DoctrineProxy');
     if (isset($container['log.enabled']) && $container['log.enabled']) {
         $ORMConfig->setSQLLogger(new \Zikula\Core\Doctrine\Logger\ZikulaSqlLogger());
     }
     // setup doctrine eventmanager
     $dispatcher = new \Doctrine\Common\EventManager();
     $container->set('doctrine.eventmanager', $dispatcher);
     // setup MySQL specific listener (storage engine and encoding)
     if ($config['dbdriver'] == 'mysql') {
         $mysqlSessionInit = new \Doctrine\DBAL\Event\Listeners\MysqlSessionInit($config['charset']);
         $dispatcher->addEventSubscriber($mysqlSessionInit);
     }
     // setup the doctrine entitymanager
     $entityManager = \Doctrine\ORM\EntityManager::create($dbConfig, $ORMConfig, $dispatcher);
     $container->set('doctrine.entitymanager', $entityManager);
 }
Esempio n. 7
0
 public function __construct()
 {
     $this->rootDir = sys_get_temp_dir() . '/sf2_' . rand(1, 9999);
     if (!is_dir($this->rootDir)) {
         if (false === @mkdir($this->rootDir)) {
             exit(sprintf('Unable to create a temporary directory (%s)', $this->rootDir));
         }
     } elseif (!is_writable($this->rootDir)) {
         exit(sprintf('Unable to write in a temporary directory (%s)', $this->rootDir));
     }
     parent::__construct('env', true);
     $loader = new UniversalClassLoader();
     $loader->registerNamespaces(array('TestBundle' => __DIR__ . '/Fixtures/', 'TestApplication' => __DIR__ . '/Fixtures/'));
     $loader->register();
 }
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => __DIR__ . '/../vendor/symfony/src', 'Sensio' => __DIR__ . '/../src', 'Doctrine\\Common\\DataFixtures' => __DIR__ . '/../vendor/doctrine-data-fixtures/lib', 'Doctrine\\Common' => __DIR__ . '/../vendor/doctrine-common/lib', 'Doctrine\\DBAL\\Migrations' => __DIR__ . '/../vendor/doctrine-migrations/lib', 'Doctrine\\MongoDB' => __DIR__ . '/../vendor/doctrine-mongodb/lib', 'Doctrine\\ODM\\MongoDB' => __DIR__ . '/../vendor/doctrine-mongodb-odm/lib', 'Doctrine\\DBAL' => __DIR__ . '/../vendor/doctrine-dbal/lib', 'Doctrine' => __DIR__ . '/../vendor/doctrine/lib', 'Zend' => __DIR__ . '/../vendor/zend/library'));
$loader->registerPrefixes(array('Twig_Extensions_' => __DIR__ . '/../vendor/twig-extensions/lib', 'Twig_' => __DIR__ . '/../vendor/twig/lib', 'Swift_' => __DIR__ . '/../vendor/swiftmailer/lib/classes'));
$loader->register();
<?php

require_once __DIR__ . '/vendors/Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Palleas' => __DIR__ . '/src', 'Monolog' => __DIR__ . '/vendors/monolog/src'));
$loader->registerPrefixes(array('HipChat' => __DIR__ . '/vendors/hipchat-php'));
$loader->register();
return $loader;
Esempio n. 10
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
$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', 'Acme' => __DIR__ . '/../src', 'Ingewikkeld' => __DIR__ . '/../src', 'Zend' => __DIR__ . '/../vendor/zend', 'Buzz' => __DIR__ . '/../vendor/buzz'));
$loader->registerPrefixes(array('Twig_Extensions_' => __DIR__ . '/../vendor/twig-extensions/lib', 'Twig_' => __DIR__ . '/../vendor/twig/lib', 'Swift_' => __DIR__ . '/../vendor/swiftmailer/lib/classes'));
$loader->register();
$loader->registerPrefixFallback(array(__DIR__ . '/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
Esempio n. 11
0
 * file that was distributed with this source code.
 */
$argv = $_SERVER['argv'];
// allow the base path to be passed as the first argument, or default
if (isset($argv[1])) {
    $baseDir = $argv[1];
} else {
    if (!($baseDir = realpath(__DIR__ . '/..'))) {
        exit('Looks like you don\'t have a standard layout.');
    }
}
require_once $baseDir . '/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
use Symfony\Component\ClassLoader\UniversalClassLoader;
use Symfony\Component\ClassLoader\ClassCollectionLoader;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => $baseDir . '/vendor/symfony/symfony/src'));
$loader->register();
$file = $baseDir . '/app/bootstrap.php.cache';
if (file_exists($file)) {
    unlink($file);
}
ClassCollectionLoader::load(array('Symfony\\Component\\DependencyInjection\\ContainerAwareInterface', 'Symfony\\Component\\DependencyInjection\\ContainerInterface', 'Symfony\\Component\\DependencyInjection\\Container', 'Symfony\\Component\\HttpKernel\\HttpKernelInterface', 'Symfony\\Component\\HttpKernel\\KernelInterface', 'Symfony\\Component\\HttpKernel\\Kernel', 'Symfony\\Component\\ClassLoader\\ClassCollectionLoader', 'Symfony\\Component\\ClassLoader\\UniversalClassLoader', 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle', 'Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface', 'Symfony\\Component\\Config\\ConfigCache'), dirname($file), basename($file, '.php.cache'), false, false, '.php.cache');
file_put_contents($file, "<?php\n\nnamespace { require_once __DIR__.'/autoload.php'; }\n\n" . substr(file_get_contents($file), 5));
Esempio n. 12
0
<?php

require_once __DIR__ . '/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => __DIR__ . '/vendor', 'Zend' => __DIR__ . '/vendor/zend/library', 'Goutte' => __DIR__ . '/src'));
$loader->register();
Esempio n. 13
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
$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\\MongoDB' => __DIR__ . '/../vendor/doctrine-mongodb/lib', 'Doctrine\\ODM\\MongoDB' => __DIR__ . '/../vendor/doctrine-mongodb-odm/lib', 'Doctrine\\DBAL' => __DIR__ . '/../vendor/doctrine-dbal/lib', 'Doctrine' => __DIR__ . '/../vendor/doctrine/lib', 'Zend' => __DIR__ . '/../vendor/zend/src', 'Monolog' => __DIR__ . '/../vendor/monolog/src', 'Assetic' => __DIR__ . '/../vendor/assetic/src', 'Knplabs' => array(__DIR__ . '/../vendor/knplabs/src', __DIR__ . '/../vendor/bundles'), 'Knplabs\\Snappy' => __DIR__ . '/../vendor/knplabs/snappy/src', 'FOS' => __DIR__ . '/../vendor/fos/src', 'Acme' => __DIR__ . '/../src', 'RJC' => __DIR__ . '/../src'));
$loader->registerPrefixes(array('Twig_Extensions_' => __DIR__ . '/../vendor/twig-extensions/lib', 'Twig_' => __DIR__ . '/../vendor/twig/lib', 'Swift_' => __DIR__ . '/../vendor/swiftmailer/lib/classes'));
$loader->register();
$loader->registerPrefixFallback(array(__DIR__ . '/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
Esempio n. 14
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => array(__DIR__ . '/../vendor/symfony/src', __DIR__ . '/../vendor/bundles'), 'Sensio' => __DIR__ . '/../vendor/bundles', 'JMS' => __DIR__ . '/../vendor/bundles', 'Doctrine\\ODM\\MongoDB' => __DIR__ . '/../vendor/doctrine-mongodb-odm/lib', 'Doctrine\\MongoDB' => __DIR__ . '/../vendor/doctrine-mongodb/lib', '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', 'FOS' => __DIR__ . '/../vendor/bundles'));
$loader->registerPrefixes(array('Twig_Extensions_' => __DIR__ . '/../vendor/twig-extensions/lib', 'Twig_' => __DIR__ . '/../vendor/twig/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'));
}
$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');
AnnotationRegistry::registerFile(__DIR__ . '/../vendor/doctrine-mongodb-odm/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/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');
Esempio n. 15
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;

$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\\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();
Esempio n. 16
0
<?php

/*
 * This file is part of the Symfony framework.
 *
 * (c) Fabien Potencier <*****@*****.**>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */
require_once __DIR__ . '/../../../../ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Security\Acl\Dbal\Schema;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => __DIR__ . '/../../../../../..', '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'));
$loader->register();
$schema = new Schema(array('class_table_name' => 'acl_classes', 'entry_table_name' => 'acl_entries', 'oid_table_name' => 'acl_object_identities', 'oid_ancestors_table_name' => 'acl_object_identity_ancestors', 'sid_table_name' => 'acl_security_identities'));
$reflection = new ReflectionClass('Doctrine\\DBAL\\Platforms\\AbstractPlatform');
$finder = new Finder();
$finder->name('*Platform.php')->in(dirname($reflection->getFileName()));
foreach ($finder as $file) {
    require_once $file->getPathName();
    $className = 'Doctrine\\DBAL\\Platforms\\' . $file->getBasename('.php');
    $reflection = new ReflectionClass($className);
    if ($reflection->isAbstract()) {
        continue;
    }
    $platform = $reflection->newInstance();
    $targetFile = sprintf(__DIR__ . '/../schema/%s.sql', $platform->name);
    file_put_contents($targetFile, implode("\n\n", $schema->toSql($platform)));
Esempio n. 17
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Silex\Provider\DoctrineServiceProvider;
use Silex\Provider\ValidatorServiceProvider;
use model\User;
use procedure;
require_once 'vendor/silex.phar';
require_once __DIR__ . '/vendor/Symfony/Component/Classloader/UniversalClassLoader.php';
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Symfony' => __DIR__ . '/vendor', 'Doctrine\\Common' => __DIR__ . '/vendor/doctrine/common/lib', 'Doctrine\\DBAL\\Migrations' => __DIR__ . '/vendor/doctrine/dbal/lib', 'Doctrine\\DBAL' => __DIR__ . '/vendor/doctrine/dbal/lib', 'Doctrine' => __DIR__ . '/vendor/doctrine/orm/lib', 'DMS' => __DIR__ . '/vendor', 'model' => __DIR__, 'procedure' => __DIR__));
$loader->register();
$app = new Silex\Application();
require_once __DIR__ . '/configs/configs.php';
require_once __DIR__ . '/library/doctrine.php';
require_once __DIR__ . '/library/filter.php';
//app configuration
$app->register(new DoctrineServiceProvider(), array('db.options' => $dbOptions, 'db.dbal.class_path' => 'vendor/doctrine-dbal/lib', 'db.common.class_path' => 'vendor/doctrine-common/lib'));
$app->register(new Silex\Provider\ValidatorServiceProvider(), array('validator.class_path' => __DIR__ . '/vendor'));
//Rest functions
$app->get('/{entity}', function ($entity) use($app) {
    $query = "SELECT * FROM {$entity}";
    $data = $app['db']->fetchAll($query);
    if (count($data) == 0) {
        return new Response('Data not found', 404, array('Content-Type' => 'text/json'));
    }
    return new Response(json_encode($data));
});
$app->get('/{entity}/{id}', function ($entity, $id) use($em) {
 /**
  * Registers the extended entity namespace in the autoloader.
  *
  * @param string $cacheDir
  */
 public static function registerClassLoader($cacheDir)
 {
     $loader = new UniversalClassLoader();
     $loader->registerNamespaces(array('Extend\\' => $cacheDir . '/oro_entities'));
     $loader->register();
 }
Esempio n. 19
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;
$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', 'FOS' => __DIR__ . '/../vendor/bundles', 'GoogleChartGenerator' => __DIR__ . '/../vendor/GoogleChartGenerator/src'));
$loader->registerPrefixes(array('Twig_Extensions_' => __DIR__ . '/../vendor/twig-extensions/lib', 'Twig_' => __DIR__ . '/../vendor/twig/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'));
}
$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');
Esempio n. 20
0
<?php

/**
 * $Id: autoload.php 20886 2013-11-06 13:53:27Z phenxdesign $
 *  
 * @category Vendor
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision: 20886 $
 * @link     http://www.mediboard.org
 */
require_once __DIR__ . '/symfony/Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
// List of namespaces
$namespaces = array('Symfony' => __DIR__ . "/symfony", 'SVNClient' => __DIR__ . "/svnclient");
$loader = new UniversalClassLoader();
$loader->registerNamespaces($namespaces);
$loader->register();
Esempio n. 21
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;
$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\\DataFixtures' => __DIR__ . '/../vendor/doctrine-fixtures/lib', 'Doctrine\\Common' => __DIR__ . '/../vendor/doctrine-common/lib', 'Doctrine\\DBAL' => __DIR__ . '/../vendor/doctrine-dbal/lib', 'Doctrine' => __DIR__ . '/../vendor/doctrine/lib', 'Monolog' => __DIR__ . '/../vendor/monolog/src', 'Doctrine' => __DIR__ . '/../vendor/doctrine/lib', 'Assetic' => __DIR__ . '/../vendor/assetic/src', 'Metadata' => __DIR__ . '/../vendor/metadata/src', 'Stof' => __DIR__ . '/../vendor/bundles', 'Gedmo' => __DIR__ . '/../vendor/doctrine-extensions/lib', 'Sonata' => __DIR__ . '/../vendor/bundles', 'Exporter' => __DIR__ . '/../vendor/exporter/lib', 'Knp\\Bundle' => __DIR__ . '/../vendor/bundles', 'Knp\\Menu' => __DIR__ . '/../vendor/knp/menu/src', 'Application' => __DIR__, 'FOS' => __DIR__ . '/../vendor/bundles'));
$loader->registerPrefixes(array('Twig_Extensions_' => __DIR__ . '/../vendor/twig-extensions/lib', 'Twig_' => __DIR__ . '/../vendor/twig/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'));
}
$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');
<?php

require_once $_SERVER['SYMFONY'].'/Symfony/Component/ClassLoader/UniversalClassLoader.php';

use Symfony\Component\ClassLoader\UniversalClassLoader;

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
    'Symfony' => $_SERVER['SYMFONY'],
));
$loader->register();

spl_autoload_register(function($class)
{
    if (0 === strpos($class, 'WhiteOctober\AdminBundle\\')) {
        $path = implode('/', array_slice(explode('\\', $class), 2)).'.php';
        require_once __DIR__.'/../'.$path;
        return true;
    }
});
Esempio n. 23
0
<?php

/*
 * This file is part of the logspy package.
 *
 * (c) Joan Valduvieco <*****@*****.**>
 * (c) Jordi Llonch <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
require_once __DIR__ . '/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
// register classes with namespaces
$loader->registerNamespaces(array('LogSpy' => __DIR__ . "/src/", 'Symfony' => __DIR__ . "/vendor/"));
$loader->registerPrefixes(array('Pimple' => __DIR__ . '/vendor/pimple/lib'));
$loader->register();
Esempio n. 24
0
//
// Autocomplete JSONP provider for Charme messages receiver autocompletion
//
include_once "config.php";
header('Access-Control-Allow-Origin: ' . $CHARME_SETTINGS["ACCEPTED_CLIENT_URL"]);
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
// if POST, GET, OPTIONS then $_POST will be empty.
header('Access-Control-Max-Age: 1000');
header('Access-Control-Allow-Headers: Content-Type');
header('Content-type: application/json');
header('Access-Control-Allow-Credentials: true');
session_start();
require_once 'lib/App/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('App' => __DIR__ . '/lib'));
$loader->register();
$col = \App\DB\Get::Collection();
$sel = array("owner" => $_SESSION["charme_userid"], 'key.obj.username' => new MongoRegex('/' . $_GET["q"] . '/i'));
// q is the search query for the autocomplete.
$ar = iterator_to_array($col->keydirectory->find($sel), true);
$keys = array();
$jsonArr = array();
// Filter out duplicates
foreach ($ar as $key => $value) {
    if (!in_array($value["userId"], $keys)) {
        $userId = $value["key"]["obj"]["publicKeyUserId"];
        if ($userId != $_SESSION["charme_userid"]) {
            $keys[] = $userId;
            $jsonArr[] = array("name" => $value["key"]["obj"]["username"], "id" => $userId);
        }
Esempio n. 25
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Assetic' => __DIR__ . '/../vendor/assetic/src', 'Doctrine\\Common' => __DIR__ . '/../vendor/doctrine/common/lib', 'Doctrine\\MongoDB' => __DIR__ . '/../vendor/doctrine/mongodb/lib', 'Doctrine\\ODM\\MongoDB' => __DIR__ . '/../vendor/doctrine/mongodb-odm/lib', 'FOS' => __DIR__ . '/../src', 'Application' => __DIR__ . '/../src', 'Vespolina' => __DIR__ . '/../src', 'Symfony' => __DIR__ . '/../vendor/symfony/src', 'vendor' => __DIR__ . '/../src', 'Zend\\Log' => __DIR__ . '/../vendor/zend-log'));
$loader->registerPrefixes(array('Twig_Extensions_' => __DIR__ . '/../vendor/twig-extensions/lib', 'Twig_' => __DIR__ . '/../vendor/twig/lib', 'Swift_' => __DIR__ . '/../vendor/swiftmailer/lib/classes'));
$loader->register();
Esempio n. 26
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;
$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', 'Cypress' => __DIR__ . '/../vendor/bundles', 'CompassElephant' => __DIR__ . '/../vendor/compass-elephant/src', 'Liip' => __DIR__ . '/../vendor/bundles', 'Knp\\Bundle' => __DIR__ . '/../vendor/bundles', 'Knp\\Menu' => __DIR__ . '/../vendor/KnpMenu/src', 'AntiMattr' => __DIR__ . '/../vendor/bundles'));
$loader->registerPrefixes(array('Twig_Extensions_' => __DIR__ . '/../vendor/twig-extensions/lib', 'Twig_' => __DIR__ . '/../vendor/twig/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'));
}
$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');
Esempio n. 27
0
<?php

require_once $_SERVER['SYMFONY'] . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Sensio\\Bundle\\FrameworkExtraBundle' => __DIR__ . '/../../../..', 'Symfony' => $_SERVER['SYMFONY']));
$loader->register();
Esempio n. 28
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;
$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', 'Behat\\Gherkin' => __DIR__ . '/../vendor/behat/gherkin/src', 'Behat\\Behat' => __DIR__ . '/../vendor/behat/behat/src', 'Behat\\BehatBundle' => __DIR__ . '/../vendor/bundles', 'Behat\\Mink' => __DIR__ . '/../vendor/behat/mink/src', 'Behat\\MinkBundle' => __DIR__ . '/../vendor/bundles'));
$loader->registerPrefixes(array('Twig_Extensions_' => __DIR__ . '/../vendor/twig-extensions/lib', 'Twig_' => __DIR__ . '/../vendor/twig/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'));
}
$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');
Esempio n. 29
0
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;
require_once __DIR__ . '/../vendor/symfony/lib/Symfony/Component/ClassLoader/UniversalClassLoader.php';
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('BattleNet' => __DIR__ . '/../lib', 'BattleNet\\Tests' => __DIR__ . '/../tests', 'Doctrine\\Common' => __DIR__ . '/../vendor/doctrine-common/lib'));
$loader->register();
Esempio n. 30
0
<?php

error_reporting(E_ALL | E_STRICT);
$stRoot = realpath(dirname(__DIR__));
require_once $stRoot . '/vendor/autoload.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array('Stalxed\\System' => $stRoot . '/library/', 'StalxedTest\\System' => $stRoot . '/tests/unit/'));
$loader->register();
unset($stRoot);