TheSeer\Autoload\Factory::getApplication PHP Method

getApplication() public method

public getApplication ( ) : Application
return Application
    public function getApplication()
    {
        return new Application($this->getLogger(), $this->config, $this);
    }

Usage Example

示例#1
0
文件: CLI.php 项目: hco/Autoload
 /**
  * Main executor method
  *
  * @return void
  */
 public function run()
 {
     try {
         $input = $this->setupInput();
         $input->process();
         if ($input->getOption('help')->value === TRUE) {
             $this->showVersion();
             $this->showUsage();
             exit(CLI::RC_OK);
         }
         if ($input->getOption('version')->value === TRUE) {
             $this->showVersion();
             exit(CLI::RC_OK);
         }
         $config = $this->configure($input);
         $this->factory->setConfig($config);
         if (!$config->isQuietMode()) {
             $this->showVersion();
         }
         $rc = $this->factory->getApplication()->run();
         exit($rc);
     } catch (\ezcConsoleException $e) {
         $this->showVersion();
         echo $e->getMessage() . "\n\n";
         $this->showUsage();
         exit(CLI::RC_PARAM_ERROR);
     } catch (\Exception $e) {
         $this->showVersion();
         fwrite(STDERR, "\nError while processing request:\n - " . $e->getMessage() . "\n");
         exit(CLI::RC_EXEC_ERROR);
     }
 }
All Usage Examples Of TheSeer\Autoload\Factory::getApplication