Beispiel #1
0
 /**
  * Initializes all components used by phpDocumentor.
  *
  * @param ClassLoader $autoloader
  * @param array       $values
  */
 public function __construct($autoloader = null, array $values = array())
 {
     $this->defineIniSettings();
     self::$VERSION = strpos('@package_version@', '@') === 0 ? trim(file_get_contents(__DIR__ . '/../../VERSION')) : '@package_version@';
     parent::__construct('phpDocumentor', self::$VERSION, $values);
     $this['kernel.timer.start'] = time();
     $this['kernel.stopwatch'] = function () {
         return new Stopwatch();
     };
     $this['autoloader'] = $autoloader;
     $this->register(new JmsSerializerServiceProvider());
     $this->register(new Configuration\ServiceProvider());
     $this->addEventDispatcher();
     $this->addLogging();
     $this->register(new ValidatorServiceProvider());
     $this->register(new Translator\ServiceProvider());
     $this->register(new Descriptor\ServiceProvider());
     $this->register(new Parser\ServiceProvider());
     $this->register(new Partials\ServiceProvider());
     $this->register(new Transformer\ServiceProvider());
     $this->register(new Plugin\ServiceProvider());
     $this->addCommandsForProjectNamespace();
     if (\Phar::running()) {
         $this->addCommandsForPharNamespace();
     }
 }
 /**
  * Initializes all components used by phpDocumentor.
  */
 public function __construct()
 {
     ini_set('memory_limit', -1);
     self::$VERSION = file_get_contents(__DIR__ . '/../../VERSION');
     parent::__construct('phpDocumentor', self::$VERSION);
     $this->addAutoloader();
     $this->addConfiguration();
     $this->addLogging();
     $this->setTimezone();
     $this->addEventDispatcher();
     $this['console']->getHelperSet()->set(new ProgressHelper());
     $this['translator.locale'] = 'en';
     $this['translator'] = $this->share(function ($app) {
         $translator = new Translator();
         $translator->setLocale($app['translator.locale']);
         return $translator;
     });
     $this->addSerializer();
     $this->register(new ValidatorServiceProvider());
     $this->register(new Descriptor\ServiceProvider());
     $this->register(new Parser\ServiceProvider());
     $this->register(new Transformer\ServiceProvider());
     // TODO: make plugin service provider calls registrable from config
     $this->register(new Plugin\Core\ServiceProvider());
     $this->addCommandsForProjectNamespace();
 }