示例#1
0
 /**
  * Application constructor.
  */
 public function __construct()
 {
     $this->config = Config::getInstance(__DIR__ . "/../config.php");
     $this->log = Log::getInstance();
     $app = static::app();
     parent::__construct($app->name, $app->version);
     $prefix = __NAMESPACE__ . '\\Commands\\';
     $baseDir = __DIR__ . '/Commands/';
     $this->addCommandsByPsr4($prefix, $baseDir);
 }
示例#2
0
 /**
  * Execute
  *
  * @param InputInterface $input
  * @param OutputInterface $output
  * @throws \Exception
  * @return void
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->input = $input;
     $this->output = $output;
     $this->config->setFile($input->getOption("config-file"));
     try {
         $conf = $this->config->get("twi");
         $this->to = new TwistOAuth($conf["ck"], $conf["cs"], $conf["at"], $conf["as"]);
         $this->start();
     } catch (\Exception $e) {
         $this->log->log($e);
         throw $e;
     }
 }