public function __construct($vendorPath = null)
{
parent::__construct(self::NAME, self::VERSION);
$this->vendorPath = $vendorPath;
$dispatcher = new EventDispatcher();
$dispatcher->addListener(ConsoleEvents::COMMAND, array($this, 'onCommand'));
$this->setDispatcher($dispatcher);
$this->loadConfig();
foreach ($this->findCommandsInDir(__DIR__ . '/Command', '\\CraftCli\\Command') as $command) {
$this->registerCommand($command);
}
}