Cilex\Application::__construct PHP Method

__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
    public function __construct($name, $version = null, array $values = array())
    {
        parent::__construct($values);
        $this->register(new DispatcherServiceProvider());
        $this->register(new ConsoleServiceProvider(), array('console.name' => $name, 'console.version' => $version));
    }

Usage Example

Example #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();
     }
 }
All Usage Examples Of Cilex\Application::__construct