build_bootstrap.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/usr/bin/env php
  2. <?php
  3. /*
  4. * This file is part of the Symfony Standard Edition.
  5. *
  6. * (c) Fabien Potencier <fabien@symfony.com>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. if (!$baseDir = realpath(__DIR__.'/../../../../../../..')) {
  12. exit('Looks like you don\'t have a standard layout.');
  13. }
  14. require_once $baseDir.'/vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
  15. /*
  16. * This file is part of the Symfony package.
  17. *
  18. * (c) Fabien Potencier <fabien@symfony.com>
  19. *
  20. * For the full copyright and license information, please view the LICENSE
  21. * file that was distributed with this source code.
  22. */
  23. use Symfony\Component\ClassLoader\UniversalClassLoader;
  24. use Symfony\Component\ClassLoader\ClassCollectionLoader;
  25. $loader = new UniversalClassLoader();
  26. $loader->registerNamespaces(array('Symfony' => $baseDir.'/vendor/symfony/src'));
  27. $loader->register();
  28. $file = $baseDir.'/app/bootstrap.php.cache';
  29. if (file_exists($file)) {
  30. unlink($file);
  31. }
  32. ClassCollectionLoader::load(array(
  33. 'Symfony\\Component\\DependencyInjection\\ContainerAwareInterface',
  34. 'Symfony\\Component\\DependencyInjection\\ContainerAware',
  35. 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
  36. 'Symfony\\Component\\DependencyInjection\\Container',
  37. 'Symfony\\Component\\HttpKernel\\HttpKernelInterface',
  38. 'Symfony\\Component\\HttpKernel\\KernelInterface',
  39. 'Symfony\\Component\\HttpKernel\\Kernel',
  40. 'Symfony\\Component\\ClassLoader\\ClassCollectionLoader',
  41. 'Symfony\\Component\\ClassLoader\\UniversalClassLoader',
  42. 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle',
  43. 'Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface',
  44. 'Symfony\\Component\\Config\\ConfigCache',
  45. 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle',
  46. ), dirname($file), basename($file, '.php.cache'), false, false, '.php.cache');
  47. file_put_contents($file, "<?php\n\nnamespace { require_once __DIR__.'/autoload.php'; }\n\n".substr(file_get_contents($file), 5));