Example #1
0
 public function getParser()
 {
     $parser = parent::getParser();
     $xmlOption = new CommandLineOption("xml", "Get the listing as XML.");
     $parser->description('Get the list of available shells for this CoreTyson app.')->addOption($xmlOption);
     return $parser;
 }
Example #2
0
 public function __construct(Console $console = null)
 {
     parent::__construct($console);
     foreach ($this->tasks as $task) {
         if (!($className = Core::className($task, 'Shell/Tasks', 'Task'))) {
             if (!($className = Core::className($task, 'Console/Tasks', 'Task'))) {
                 throw new MissingTaskException(['class' => $task . 'Task']);
             }
         }
         $this->_loadedTasks[$task] = new $className($console);
     }
 }
Example #3
0
 /**
  * Gets the option parser instance and configures it.
  *
  * @return CommandLineParser
  */
 public function getParser()
 {
     $parser = parent::getParser();
     $parser->description(['PHP Built-in Server', '<warning>[WARN] Don\'t use this at the production environment</warning>']);
     $parser->options()["help"]->removeAlias("h");
     $hostOptn = new CommandLineOption("host", "Server host name", ServerShell::DEFAULT_HOST);
     $hostOptn->addAlias('h');
     $portOptn = new CommandLineOption("port", "Server port", ServerShell::DEFAULT_PORT);
     $portOptn->addAlias('p');
     $documentRootOptn = new CommandLineOption("document-root", "Server DocumentRoot", getcwd());
     $documentRootOptn->addAlias('d');
     $parser->addOption($hostOptn)->addOption($portOptn)->addOption($documentRootOptn);
     return $parser;
 }
Example #4
0
 /**
  * Display help for this console.
  *
  * @return CommandLineParser
  */
 public function getParser()
 {
     $parser = parent::getParser();
     $parser->description('This shell provides a REPL that you can use to interact ' . 'with your application in an interactive fashion. You can use ' . 'it to run adhoc queries with your models, or experiment ' . 'and explore the features of CoreTyson and your application.' . "\n\n" . 'You will need to have psysh installed for this Shell to work.');
     return $parser;
 }
Example #5
0
 public function getParser()
 {
     $parser = parent::getParser();
     $parser->description('Get the list of routes connected in this application. ');
     return $parser;
 }
Example #6
0
 public function getParser()
 {
     $parser = parent::getParser();
     $parser->addOption('bootstrap', ['alias' => ['b'], 'description' => 'Will load bootstrap.php from plugin.'])->addOption('routes', ['alias' => ['r'], 'description' => 'Will load routes.php from plugin.'])->addOption('autoload', ['description' => 'Will autoload the plugin using CoreTyson. ' . 'Set to true if you are not using composer to autoload your plugin.'])->addArgument('plugin', ['description' => 'Name of the plugin to load.']);
     return $parser;
 }