__construct() public method

Registers the autoloader and necessary components.
public __construct ( string $name, string | null $version = null, array $values = [] )
$name string Name for this application.
$version string | null Version number for this application.
$values array
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 2
0
 /**
  * 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();
 }
Ejemplo n.º 3
0
 /**
  * Initializes all components used by phpDocumentor.
  */
 function __construct()
 {
     parent::__construct('phpDocumentor', self::VERSION);
     $this->addAutoloader();
     $this->addLogging();
     $this->addConfiguration();
     $this->addEventDispatcher();
     $this->loadPlugins();
     $this['console']->getHelperSet()->set(new \phpDocumentor\Console\Helper\ProgressHelper());
     $this->addCommandsForProjectNamespace();
 }
Ejemplo n.º 4
0
 public function __construct($values = array())
 {
     parent::__construct("Kengrabber", self::VERSION, $values);
     $this->initialize();
 }