<?php $loader = (require_once __DIR__ . "/../vendor/autoload.php"); $loader->add('LiteCQRS\\', __DIR__); Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
<?php $vendorDir = __DIR__ . '/../vendor'; $bundleDir = __DIR__ . '/../vendor/bundles'; require $vendorDir . '/symfony/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php'; $loader = new Symfony\Component\ClassLoader\ApcUniversalClassLoader('lichess.cl.'); $loader->registerNamespaces(array('Symfony' => array($vendorDir . '/symfony/src', $bundleDir), 'Doctrine\\MongoDB' => $vendorDir . '/doctrine-mongodb/lib', 'Doctrine\\ODM\\MongoDB' => $vendorDir . '/doctrine-mongodb-odm/lib', 'Doctrine\\Common\\DataFixtures' => $vendorDir . '/doctrine-data-fixtures/lib', 'Doctrine\\Common' => $vendorDir . '/doctrine-common/lib', 'Zend' => $vendorDir . '/zend-subtrees', 'Monolog' => $vendorDir . '/monolog/src', 'Assetic' => $vendorDir . '/assetic/src', 'Pagerfanta' => $vendorDir . '/pagerfanta/src', 'Gedmo' => $vendorDir . '/doctrine-extensions/lib', 'EasyCSV' => $vendorDir . '/easy-csv/lib', 'Buzz' => $vendorDir . '/buzz/lib', 'Ornicar' => $bundleDir, 'Sensio' => $bundleDir, 'WhiteOctober' => $bundleDir, 'FOS' => $bundleDir, 'Herzult' => $bundleDir, 'Bundle' => $bundleDir, 'FOQ' => $bundleDir)); $loader->registerPrefixes(array('Twig_' => $vendorDir . '/twig/lib', 'Elastica_' => $vendorDir . '/elastica/lib')); $loader->registerPrefixFallbacks(array(__DIR__ . '/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs')); $loader->registerNamespaceFallbacks(array(__DIR__ . '/../src')); $loader->register(); // doctrine annotations Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(function ($class) use($loader) { $loader->loadClass($class); return class_exists($class, false); }); Doctrine\Common\Annotations\AnnotationRegistry::registerFile(__DIR__ . '/../vendor/doctrine-mongodb-odm/lib/Doctrine/ODM/MongoDB/Mapping/Annotations/DoctrineAnnotations.php');
<?php require_once __DIR__ . '/../vendor/autoload.php'; Doctrine\Common\Annotations\AnnotationRegistry::registerLoader('class_exists'); use Hateoas\Serializer\XmlHalSerializer; use Hateoas\Representation\Factory\PagerfantaFactory; use Hateoas\UrlGenerator\SymfonyUrlGenerator; use Hautelook\TemplatedUriRouter\Routing\Generator\Rfc6570Generator; use Propilex\Model\Document; use Propilex\Model\DocumentQuery; use Propilex\Model\Repository\PropelDocumentRepository; use Propilex\View\Error; use Propilex\View\FormErrors; use Propilex\View\ViewHandler; use Propilex\Hateoas\CuriesConfigurationExtension; use Propilex\Hateoas\TransExpressionFunction; use Propilex\Hateoas\VndErrorRepresentation; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Validator\Mapping\ClassMetadataFactory; use Symfony\Component\Validator\Mapping\Loader\YamlFileLoader; $app = new Silex\Application(); // Providers $app->register(new Silex\Provider\ValidatorServiceProvider()); $app->register(new Silex\Provider\UrlGeneratorServiceProvider()); $app->register(new Propel\Silex\PropelServiceProvider(), array('propel.config_file' => __DIR__ . '/config/propel/propilex.php', 'propel.model_path' => __DIR__ . '/../src/Propilex/Model')); // Configure the validator service $app['validator.mapping.class_metadata_factory'] = new ClassMetadataFactory(new YamlFileLoader(__DIR__ . '/config/validation.yml')); // Configure Hateoas serializer $app['serializer'] = $app->share(function () use($app) { $jmsSerializerBuilder = JMS\Serializer\SerializerBuilder::create()->setMetadataDirs(array('' => __DIR__ . '/config/serializer', 'Propilex' => __DIR__ . '/config/serializer'))->setDebug($app['debug'])->setCacheDir(__DIR__ . '/cache/serializer');
public function getClosures() { return ['__anonymous__3f09_123574_1415963578543' => ['constructor' => [1 => function (ContainerInterface $container) { if (trim($_SERVER['REQUEST_URI'], '/') == trim(ROOT_URL, '/')) { return "#about"; } else { return ROOT_URL . "#about"; } }]], '__anonymous__3f09_325259_1415963587939' => ['constructor' => [1 => function (ContainerInterface $container) { if (trim($_SERVER['REQUEST_URI'], '/') == trim(ROOT_URL, '/')) { return "#team"; } else { return ROOT_URL . "#team"; } }]], '__anonymous__3f09_447968_1415963567295' => ['constructor' => [1 => function (ContainerInterface $container) { if (trim($_SERVER['REQUEST_URI'], '/') == trim(ROOT_URL, '/')) { return "#feedback"; } else { return ROOT_URL . "#feedback"; } }]], '__anonymous__3f09_796349_1416051015274' => ['constructor' => [1 => function (ContainerInterface $container) { if (trim($_SERVER['REQUEST_URI'], '/') == trim(ROOT_URL, '/')) { return "#api"; } else { return ROOT_URL . "#api"; } }]], '__anonymous__3f09_867472_1415899120049' => ['constructor' => [1 => function (ContainerInterface $container) { if (trim($_SERVER['REQUEST_URI'], '/') == trim(ROOT_URL, '/')) { return "#search"; } else { return ROOT_URL . "#search"; } }]], 'annotationReader' => function (ContainerInterface $container) { // Using composer autoloader $loader = (require ROOT_PATH . 'vendor/autoload.php'); Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(array($loader, 'loadClass')); // Creating a new AnnotationReader $reader = new Doctrine\Common\Annotations\AnnotationReader(); return new Doctrine\Common\Annotations\CachedReader($reader, new Doctrine\Common\Cache\ArrayCache()); }, 'colorLogger' => ['constructor' => [0 => function (ContainerInterface $container) { return array('colors' => array('debug' => "[0;35m", 'error' => "[1;31m", 'section' => "[1;37m", 'subsection' => "[1;33m", 'ok' => "[1;32m")); }]], 'elasticSearchClient' => ['constructor' => [0 => function (ContainerInterface $container) { return ['hosts' => [ELASTICSEARCH_HOST . ':' . ELASTICSEARCH_PORT]]; }]], 'mongoClient' => function (ContainerInterface $container) { return new \MongoClient(MONGODB_CONNECTIONSTRING); }, 'mongoItemsCollection' => function (ContainerInterface $container) { return $container->get('mongoPackanalystDb')->items; }, 'mongoPackagesCollection' => function (ContainerInterface $container) { return $container->get('mongoPackanalystDb')->packages; }, 'mongoPackanalystDb' => function (ContainerInterface $container) { return $container->get('mongoClient')->packanalyst; }]; }
<?php /* * Copyright 2011 Johannes M. Schmitt <*****@*****.**> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ include_once dirname(__DIR__) . '/vendor/autoload.php'; Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(function ($class) { if (0 === strpos(ltrim($class, '/'), 'JMS\\SerializerBundle\\Annotation')) { if (file_exists($file = dirname(__DIR__) . '/' . substr(str_replace('\\', '/', $class), strlen('JMS\\SerializerBundle\\')) . '.php')) { require_once $file; } } return class_exists($class, false); });
public function initialize() { date_default_timezone_set('Europe/Prague'); Nette\Bridges\Framework\TracyBridge::initialize(); $this->getService('events.manager')->createEvent(array('Nette\\DI\\Container', 'onInitialize'))->dispatch($this); Tracy\Debugger::$email = '*****@*****.**'; Tracy\Debugger::$editor = 'sublime'; Tracy\Debugger::$browser = 'chromium-browser'; Tracy\Debugger::$strictMode = TRUE; Nette\Caching\Storages\FileStorage::$useDirectories = TRUE; $this->getByType("Nette\\Http\\Session")->exists() && $this->getByType("Nette\\Http\\Session")->start(); header('X-Frame-Options: SAMEORIGIN'); $this->getService('systemModule.initializer'); $this->getService('usersModule.initializer'); $this->getService('securityModule.initializer'); header('X-Powered-By: Nette Framework'); header('Content-Type: text/html; charset=utf-8'); Nette\Utils\SafeStream::register(); Nette\Reflection\AnnotationsParser::setCacheStorage($this->getByType("Nette\\Caching\\IStorage")); Nette\Reflection\AnnotationsParser::$autoRefresh = FALSE; Doctrine\Common\Annotations\AnnotationRegistry::registerLoader("class_exists"); Kdyby\Doctrine\Diagnostics\Panel::registerBluescreen($this); Kdyby\Doctrine\Proxy\ProxyAutoloader::create('/home/fuca/Projects/www/sportsclub/tests/tmp/proxies', 'Kdyby\\GeneratedProxy')->register(); Nette\Diagnostics\Debugger::getBlueScreen()->collapsePaths[] = '/home/fuca/Projects/www/sportsclub/vendor/kdyby/doctrine/src/Kdyby/Doctrine'; Nette\Diagnostics\Debugger::getBlueScreen()->collapsePaths[] = '/home/fuca/Projects/www/sportsclub/vendor/doctrine'; Nette\Diagnostics\Debugger::getBlueScreen()->collapsePaths[] = '/home/fuca/Projects/www/sportsclub/tests/tmp/proxies'; Kdyby\Translation\Diagnostics\Panel::registerBluescreen(); \Tracy\Debugger::setLogger($this->getService('monolog.adapter')); }
public function initialize() { Doctrine\Common\Annotations\AnnotationRegistry::registerLoader("class_exists"); date_default_timezone_set('Europe/Prague'); Nette\Reflection\AnnotationsParser::setCacheStorage($this->getByType("Nette\\Caching\\IStorage")); Nette\Reflection\AnnotationsParser::$autoRefresh = FALSE; $this->getService('events.manager')->createEvent(array('Nette\\DI\\Container', 'onInitialize'))->dispatch($this); Kdyby\Doctrine\Diagnostics\Panel::registerBluescreen($this); Tracy\Debugger::getBlueScreen()->collapsePaths[] = '/home/richmond/vhosts/nette-test/sandbox/vendor/kdyby/doctrine/src/Kdyby/Doctrine'; Tracy\Debugger::getBlueScreen()->collapsePaths[] = '/home/richmond/vhosts/nette-test/sandbox/vendor/doctrine'; Tracy\Debugger::getBlueScreen()->collapsePaths[] = '/home/richmond/vhosts/nette-test/sandbox/app/../temp/proxies'; }
| Next, we need to bind some important interfaces into the container so | we will be able to resolve them when needed. The kernels serve the | incoming requests to this application from both the web and CLI. | */ $app->singleton(Illuminate\Contracts\Http\Kernel::class, KevinDierkx\Muse\Http\Kernel::class); $app->singleton(Illuminate\Contracts\Console\Kernel::class, KevinDierkx\Muse\Console\Kernel::class); $app->singleton(Illuminate\Contracts\Debug\ExceptionHandler::class, KevinDierkx\Muse\Exceptions\Handler::class); /* |-------------------------------------------------------------------------- | Register annotation loader |-------------------------------------------------------------------------- | | Doctrine Annotations does not use normal PHP autoloading, therefore | we are required to register the autoloader separately. | | More information: http://stackoverflow.com/a/14646475 | */ Doctrine\Common\Annotations\AnnotationRegistry::registerLoader([require base_path('vendor/autoload.php'), 'loadClass']); /* |-------------------------------------------------------------------------- | Return The Application |-------------------------------------------------------------------------- | | This script returns the application instance. The instance is given to | the calling script so we can separate the building of the instances | from the actual running of the application and sending responses. | */ return $app;
public function initialize() { Doctrine\Common\Annotations\AnnotationRegistry::registerLoader("class_exists"); date_default_timezone_set('Europe/Prague'); $this->getService('events.manager')->createEvent(array('Nette\\DI\\Container', 'onInitialize'))->dispatch($this); header('X-Frame-Options: SAMEORIGIN'); header('X-Powered-By: Nette Framework'); header('Content-Type: text/html; charset=utf-8'); Nette\Reflection\AnnotationsParser::setCacheStorage($this->getByType("Nette\\Caching\\IStorage")); Nette\Reflection\AnnotationsParser::$autoRefresh = TRUE; $this->getService('session.session')->exists() && $this->getService('session.session')->start(); Kdyby\Doctrine\Diagnostics\Panel::registerBluescreen($this); Tracy\Debugger::getBlueScreen()->collapsePaths[] = '/home/richmond/vhosts/nette-test/sandbox/vendor/kdyby/doctrine/src/Kdyby/Doctrine'; Tracy\Debugger::getBlueScreen()->collapsePaths[] = '/home/richmond/vhosts/nette-test/sandbox/vendor/doctrine'; Tracy\Debugger::getBlueScreen()->collapsePaths[] = '/home/richmond/vhosts/nette-test/sandbox/app/../temp/proxies'; }
<?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. */ $loader = (require __DIR__ . '/../vendor/autoload.php'); Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(function ($class) { return class_exists($class); });