示例#1
0
 /**
  * Initialize
  * @return void
  * @uses $connection
  * @uses $now
  */
 public function initialize()
 {
     parent::initialize();
     //Gets database connection
     $this->connection = ConnectionManager::get('default');
     //Sets now for MySql
     $this->now = new Time();
 }
示例#2
0
 /**
  * Gets the option parser instance and configures it.
  * @return ConsoleOptionParser
  * @uses MeTools\Shell\InstallShell::getOptionParser()
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     return $parser->addSubcommands(['add' => ['help' => __d('me_cms', 'Adds an user'), 'parser' => ['options' => ['group' => ['short' => 'g', 'help' => __d('me_cms', 'Group ID')]]]], 'groups' => ['help' => __d('me_cms', 'Lists user groups')], 'users' => ['help' => __d('me_cms', 'Lists users')]]);
 }
示例#3
0
 /**
  * Gets the option parser instance and configures it.
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     return $parser->addSubcommands(['all' => ['help' => __d('me_tools', 'Executes all available tasks')], 'copyConfig' => ['help' => __d('me_tools', 'Copies the configuration files')], 'copyFonts' => ['help' => __d('me_tools', 'Creates symbolic links for fonts')], 'createDirectories' => ['help' => __d('me_tools', 'Creates default directories')], 'createRobots' => ['help' => __d('me_tools', 'Creates the {0} file', 'robots.txt')], 'createVendorsLinks' => ['help' => __d('me_tools', 'Creates symbolic links for vendor assets')], 'fixComposerJson' => ['help' => __d('me_tools', 'Fixes {0}', 'composer.json')], 'installPackages' => ['help' => __d('me_tools', 'Installs the suggested packages')], 'setPermissions' => ['help' => __d('me_tools', 'Sets directories permissions')]])->addOption('force', ['boolean' => true, 'default' => false, 'help' => __d('me_tools', 'Executes tasks without prompting'), 'short' => 'f'])->description(__d('me_tools', 'Executes some tasks to make the system ready to work'));
 }