Пример #1
0
 /**
  * cake standardized argument parser
  * autosets basic help information
  * (because of the required Model arguments)
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addArguments(array('model' => array('help' => 'Model Name (or Plugin.Model)', 'required' => true), 'method' => array('help' => 'The Model\'s method', 'required' => false), 'param1' => array('help' => 'optional param to pass', 'required' => false), 'param2' => array('help' => 'optional param to pass', 'required' => false), 'param3' => array('help' => 'optional param to pass', 'required' => false), 'param4' => array('help' => 'optional param to pass', 'required' => false), 'param5' => array('help' => 'optional param to pass', 'required' => false)));
     $parser->addOptions(array('plugin' => array('short' => 'p', 'help' => '(optional) The plugin within witch to look for this model'), 'behavior' => array('short' => 'b', 'help' => '(optional) Attach this behavior on setup'), 'force' => array('short' => 'f', 'help' => '(optional) Force this attempt, even if the method isn\'t found on the model', 'boolean' => true), 'json' => array('short' => 'j', 'help' => '(optional) JSON array of arguments specified rather than a literal string', 'boolean' => true)));
     return $parser;
 }
Пример #2
0
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addArgument('path', array('help' => 'The absolute path to the file or the folder you want to import.', 'required' => true));
     $parser->addOption('recursive', array('short' => 'r', 'help' => 'Import a folder, recursively.', 'boolean' => true))->command('import');
     return $parser;
 }
Пример #3
0
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__d('backend', "Manage Cache"));
     $parser->addArgument('command', array('help' => 'Command', 'required' => true, 'choices' => array('clear')));
     return $parser;
 }
Пример #4
0
 /**
  * getOptionParser() の override.
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $dtype = 'chatwork_console';
     $parser->description(__d($dtype, 'A console tool for Chatwork API'))->addSubcommand('fetchMe', array('help' => __d($dtype, '自分自身の情報を取得する.'), 'parser' => array('description' => __d($dtype, 'この機能に引数はありません。'), 'arguments' => array())))->addSubcommand('fetchMyStatus', array('help' => __d($dtype, '自分の未読数、未読To数、未完了タスク数を返す.'), 'parser' => array('description' => __d($dtype, 'この機能に引数はありません。'), 'arguments' => array())))->addSubcommand('fetchMyTasks', array('help' => __d($dtype, '自分のタスク一覧を取得する.'), 'parser' => array('description' => __d($dtype, 'API がページネーションに対応していないため、100 件までしか取得できません。'), 'arguments' => array('assigned_by account_id' => array('help' => __d($dtype, 'タスクの依頼者のアカウントID.')), 'status' => array('choices' => array('open', 'done'), 'help' => __d($dtype, 'タスクのステータス.'))))))->addSubcommand('fetchContacts', array('help' => __d($dtype, '自分のコンタクト一覧を取得.'), 'parser' => array('description' => __d($dtype, 'この機能に引数はありません。'), 'arguments' => array())))->addSubcommand('fetchRooms', array('help' => __d($dtype, '自分のチャット一覧の取得.'), 'parser' => array('description' => __d($dtype, 'この機能に引数はありません。'), 'arguments' => array())))->addSubcommand('fetchRoom', array('help' => __d($dtype, 'チャットの名前、アイコン、種類(my/direct/group)を取得.'), 'parser' => array('description' => __d($dtype, ''), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true)))))->addSubcommand('fetchRoomMembers', array('help' => __d($dtype, 'チャットのメンバー一覧を取得.'), 'parser' => array('description' => __d($dtype, ''), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true)))))->addSubcommand('fetchRoomMessages', array('help' => __d($dtype, 'チャットのメッセージ一覧を取得.'), 'parser' => array('description' => __d($dtype, 'API がページネーションに対応していないため、100 件までしか取得できません。※このAPIは未実装です!まだ利用することはできません。'), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true), 'force' => array('help' => __d($dtype, '未取得にかかわらず最新の100件を取得するか. 1を指定すると未取得にかかわらず最新の100件を取得します(デフォルトは0)'), 'choices' => array(0, 1))))))->addSubcommand('fetchRoomMessage', array('help' => __d($dtype, 'メッセージ情報を取得.'), 'parser' => array('description' => __d($dtype, ''), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true), 'message_id' => array('help' => __d($dtype, 'メッセージ ID.'), 'required' => true)))))->addSubcommand('fetchRoomTasks', array('help' => __d($dtype, 'チャットのタスク一覧を取得.'), 'parser' => array('description' => __d($dtype, 'API がページネーションに対応していないため、100 件までしか取得できません。'), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true), 'account_id' => array('help' => __d($dtype, 'タスクの担当者のアカウントID.')), 'assigned_by account_id' => array('help' => __d($dtype, 'タスクの依頼者のアカウントID.')), 'status' => array('choices' => array('open', 'done'), 'help' => __d($dtype, 'タスクのステータス.'))))))->addSubcommand('fetchRoomTask', array('help' => __d($dtype, 'タスク情報を取得.'), 'parser' => array('description' => __d($dtype, ''), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true), 'task_id' => array('help' => __d($dtype, 'タスク ID.'), 'required' => true)))))->addSubcommand('fetchRoomFiles', array('help' => __d($dtype, 'チャットのファイル一覧を取得.'), 'parser' => array('description' => __d($dtype, 'API がページネーションに対応していないため、100 件までしか取得できません。'), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true), 'account_id' => array('help' => __d($dtype, 'アップロードしたユーザーのアカウントID.'))))))->addSubcommand('fetchRoomFile', array('help' => __d($dtype, 'ファイル情報を取得.'), 'parser' => array('description' => __d($dtype, ''), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true), 'file_id' => array('help' => __d($dtype, 'ファイルの ID.'), 'required' => true), 'create_download_url' => array('help' => __d($dtype, 'ダウンロードする為のURLを生成するか 30 秒間だけダウンロード可能なURLを生成します.'), 'choices' => array(0, 1))))))->addSubcommand('createRoom', array('help' => __d($dtype, 'ファイル情報を取得.'), 'parser' => array('description' => __d($dtype, ''), 'arguments' => array('name' => array('help' => __d($dtype, '作成したいグループチャットのチャット名.'), 'required' => true), 'members_admin_ids' => array('help' => __d($dtype, '管理者権限のユーザー.' . PHP_EOL . '作成したチャットに参加メンバーのうち、管理者権限にしたいユーザーのアカウントIDの配列.' . PHP_EOL . '最低1人は指定する必要がある.' . PHP_EOL . '※リストはカンマ区切りで複数の値を指定してください.'), 'required' => true), 'members_member_ids' => array('help' => __d($dtype, 'メンバー権限のユーザー.' . PHP_EOL . '作成したチャットに参加メンバーのうち、メンバー権限にしたいユーザーのアカウントIDの配列.' . PHP_EOL . '※リストはカンマ区切りで複数の値を指定してください.')), 'members_readonly_ids' => array('help' => __d($dtype, '閲覧のみ権限のユーザー.' . PHP_EOL . '作成したチャットに参加メンバーのうち、閲覧のみ権限にしたいユーザーのアカウントIDの配列.' . PHP_EOL . '※リストはカンマ区切りで複数の値を指定してください.')), 'description' => array('help' => __d($dtype, 'グループチャットの概要説明テキスト.')), 'icon_preset' => array('help' => __d($dtype, 'グループチャットのアイコン種類.'), 'choices' => array('group', 'check', 'document', 'meeting', 'event', 'project', 'business', 'study', 'security', 'star', 'idea', 'heart', 'magcup', 'beer', 'music', 'sports', 'travel'))))))->addSubcommand('postRoomMessage', array('help' => __d($dtype, 'チャットに新しいメッセージを追加.'), 'parser' => array('description' => __d($dtype, ''), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true), 'body' => array('help' => __d($dtype, 'メッセージ本文.'), 'required' => true)))))->addSubcommand('postRoomTask', array('help' => __d($dtype, 'チャットに新しいタスクを追加.'), 'parser' => array('description' => __d($dtype, ''), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true), 'body' => array('help' => __d($dtype, 'タスクの内容.'), 'required' => true), 'to_ids' => array('help' => __d($dtype, '担当者のアカウントIDをカンマ区切りで.' . PHP_EOL . '※リストはカンマ区切りで複数の値を指定してください.'), 'required' => true), 'limit' => array('help' => __d($dtype, 'タスクの期限. Unix Time で入力してください.'))))))->addSubcommand('editRoom', array('help' => __d($dtype, 'チャットの名前、アイコンをアップデート.'), 'parser' => array('description' => __d($dtype, ''), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true), 'name' => array('help' => __d($dtype, 'グループチャットのチャット名.')), 'description' => array('help' => __d($dtype, 'グループチャットの概要説明テキスト')), 'icon_preset' => array('help' => __d($dtype, 'グループチャットのアイコン種類.'), 'choices' => array('group', 'check', 'document', 'meeting', 'event', 'project', 'business', 'study', 'security', 'star', 'idea', 'heart', 'magcup', 'beer', 'music', 'sports', 'travel'))))))->addSubcommand('editRoomMembers', array('help' => __d($dtype, 'チャットのメンバーを一括変更.'), 'parser' => array('description' => __d($dtype, ''), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true), 'members_admin_ids' => array('help' => __d($dtype, '管理者権限のユーザー.' . PHP_EOL . '作成したチャットに参加メンバーのうち、管理者権限にしたいユーザーのアカウントIDの配列.' . PHP_EOL . '最低1人は指定する必要がある.' . PHP_EOL . '※リストはカンマ区切りで複数の値を指定してください.'), 'required' => true), 'members_member_ids' => array('help' => __d($dtype, 'メンバー権限のユーザー.' . PHP_EOL . '作成したチャットに参加メンバーのうち、メンバー権限にしたいユーザーのアカウントIDの配列.' . PHP_EOL . '※リストはカンマ区切りで複数の値を指定してください.')), 'members_readonly_ids' => array('help' => __d($dtype, '閲覧のみ権限のユーザー.' . PHP_EOL . '作成したチャットに参加メンバーのうち、閲覧のみ権限にしたいユーザーのアカウントIDの配列.' . PHP_EOL . '※リストはカンマ区切りで複数の値を指定してください.'))))))->addSubcommand('deleteRoom', array('help' => __d($dtype, 'グループチャットを退席/削除する.'), 'parser' => array('description' => __d($dtype, ''), 'arguments' => array('room_id' => array('help' => __d($dtype, 'チャットルーム ID.'), 'required' => true), 'action_type' => array('help' => __d($dtype, '退席するか、削除するか.' . PHP_EOL . '退席すると、このグループチャットにある自分が担当のタスク、および自分が送信したファイルは削除されます.' . PHP_EOL . '削除すると、このグループチャットに参加しているメンバー全員のメッセージ、タスク、ファイルはすべて削除されます.' . PHP_EOL . '※一度削除すると元に戻せません!'), 'required' => true, 'choices' => array('leave', 'delete'))))));
     return $parser;
 }
Пример #5
0
 /**
  * Display help/options
  */
 public function getOptionParser()
 {
     $drivers = array('Mysql', 'Postgres', 'Sqlite', 'Sqlserver');
     $parser = parent::getOptionParser();
     $parser->description(__d('croogo', 'Install Utilities'))->addSubcommand('main', array('help' => 'Generate croogo.php, database.php, settings.json and create admin user.', 'parser' => array('description' => 'Generate croogo.php, database.php, settings.json and create admin user.')))->addSubcommand('setup_acos', array('help' => 'Setup default ACOs for roles', 'parser' => array('description' => 'Generate default role settings during release')))->addOption('datasource', array('help' => 'Database Driver', 'short' => 'd', 'required' => true, 'options' => $drivers))->addOption('host', array('help' => 'Database Host', 'short' => 'h', 'required' => true))->addOption('login', array('help' => 'Database User', 'short' => 'l', 'required' => true))->addOption('password', array('help' => 'Database Password', 'short' => 'p', 'required' => true))->addOption('database-name', array('help' => 'Database Name', 'short' => 'n', 'required' => true))->addOption('port', array('help' => 'Database Port', 'short' => 't', 'required' => true))->addOption('prefix', array('help' => 'Table Prefix', 'short' => 'x', 'required' => true))->addArgument('admin-user', array('help' => 'Admin username'))->addArgument('admin-password', array('help' => 'Admin password'));
     return $parser;
 }
Пример #6
0
 /**
  * Gets the option parser instance and configures it.
  *
  * @return ConsoleOptionParser
  */
 function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__('Scans SVN, marking changed plugins as dirty.'));
     $parser->addArgument('max', array('help' => __('Maximum number of revisions to check.')));
     return $parser;
 }
Пример #7
0
 /**
  * Gets the option parser instance and configures it.
  *
  * @return ConsoleOptionParser
  */
 function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__('Updates the git clones from SVN.'));
     $parser->addArgument('max', array('help' => __('Maximum number of plugins to update.')));
     return $parser;
 }
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addOption('race_id', array('help' => 'race_id', 'default' => null));
     $parser->addOption('update', array('help' => '1:update', 'default' => 0));
     $parser->addOption('mode', array('help' => '1:resultExpect 2:raceData', 'default' => 1));
     return $parser;
 }
Пример #9
0
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__d('backend', 'Backend Console'));
     $parser->addSubcommand('cache', array('help' => __('Cache Task'), 'parser' => $this->Cache->getOptionParser()));
     $parser->addSubcommand('user', array('help' => __d('backend', "Manage backend users"), 'parser' => $this->User->getOptionParser()));
     return $parser;
 }
Пример #10
0
 /**
  * Gets the option parser instance and configures it.
  *
  * @return ConsoleOptionParser
  */
 function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__('Refreshes plugin information with current details from WordPress.org.'));
     $parser->addArgument('max', array('help' => __('Maximum number of plugins to refresh.')));
     $parser->addSubcommand('queue', array('help' => __('Queues plugins for a refresh if they have stale data.'), 'parser' => array('description' => array(__('All plugins with data older than the given number of days is added to the refresh queue.')), 'arguments' => array('days' => array('help' => __('Number of days old plugin data can be before being queued for a refresh.'), 'required' => false)))));
     return $parser;
 }
Пример #11
0
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addOption('race_id', array('help' => 'race_id', 'default' => null));
     $parser->addOption('update', array('help' => '1:update', 'default' => 0));
     $parser->addOption('mode', array('help' => '1:list 2:uma 3:weight 4:odds', 'default' => 1));
     return $parser;
 }
Пример #12
0
 /**
  * Gets the option parser instance and configures it.
  *
  * @return ConsoleOptionParser
  */
 function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__('Performs the initial git-svn clone of plugins.'));
     $parser->addArgument('max', array('help' => __('Maximum number of plugins to clone.')));
     $parser->addSubcommand('queue', array('help' => __('Queues a plugin to clone if not already busy.'), 'parser' => array('description' => array(__('Keeps the cloning queue busy if there haven\'t been'), __('any plugins requested to be cloned.'), '', __('If the cloning queue is less than the count given,'), __('one plugin will be added to the queue in preference'), __('of the latest updated or added first.')), 'arguments' => array('min' => array('help' => __('Minimum number of queued plugins.'), 'required' => false)))));
     return $parser;
 }
Пример #13
0
 /**
  * Get the Console Option Parser
  *
  * @return ConsoleOptionParser The Console Option Parser.
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(array(__('A shell to seed your database with fake and/or fixed data.'), __(''), __('Uses Faker to generate the fake data.'), __('Uses shell tasks for implementing specific seeders.'), __('Organizes logical groups of seeders in custom seeder shells/suites.')));
     $parser->addArguments(array('model' => array('help' => "The name of a seeder shell task without 'SeederTask' suffix.\n" . "For example 'Article' for 'ArticleSeederTask'.\n" . "Alternatively the name of a model.\n" . "It will try to guess the field formatters then.", 'required' => false)));
     $parser->addOptions(array('mode' => array('help' => "The seeding mode.\n" . "'manual' = No Field formatters are guessed.\n" . "'auto' = All field formatters are guessed.\n" . "'mixed' = Only missing field formatters are guessed.\n", 'short' => 'm', 'choices' => array('manual', 'auto', 'mixed'), 'default' => ''), 'locale' => array('help' => 'The locale to use for Faker.', 'short' => 'l', 'default' => ''), 'records' => array('help' => 'The amount of records to seed.', 'short' => 'r', 'default' => ''), 'validate' => array('help' => 'Whether or not to validate when saving the seeding data.', 'choices' => array('first', true, false), 'default' => ''), 'seed' => array('help' => 'Set the seed number for Faker to use.', 'short' => 's', 'default' => ''), 'no-truncate' => array('help' => 'Prevents that the model gets truncated before seeding.', 'boolean' => true)));
     $parser->epilog(array(__('All shell options can be set through:'), __('1. CLI parameter, e.g. "--records"'), __('2. The seeder specific configuration, e.g. "FakeSeeder.Article.records"'), __('3. The general seeder configuration, e.g "FakeSeeder.records"'), __('4. The seeder shell task class properties, e.g. "$_records"'), __('The values are checked in that order. The first value found is taken.'), __('If no value is set, it will fall back to an optional default value.'), __(''), __('When no seeders are set (e.g. in a custom seeder suite) and if called without arguments, ' . 'it will prompt to execute one of the seeder shell tasks available.')));
     return $parser;
 }
 /**
  * Gets the option parser instance and configures it.
  * By overriding this method you can configure the ConsoleOptionParser before returning it.
  *
  * @return ConsoleOptionParser
  * @link http://book.cakephp.org/2.0/en/console-and-shells.html#Shell::getOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addSubcommand('lint', array('help' => __('Validate syntax and basic data requirements for your cronjobs.json file'), 'parser' => array()));
     $parser->addSubcommand('show', array('help' => __('Convert cronjobs.json to a crontab compatible output. This will also lint the file to ensure correct syntax'), 'parser' => array()));
     $parser->addSubcommand('export', array('help' => __('Export all cronjobs.json cronjobs into crontab. This command will also remove project cronjobs that no longer exist in cronjobs.json'), 'parser' => array()));
     $parser->addSubcommand('clear', array('help' => __('Remove all cronjobs belonging to the current project from crontab'), 'parser' => array()));
     return $parser;
 }
 /**
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addOption('retry-limit', ['short' => 'l', 'help' => 'Number of reattempts on failure', 'default' => 5]);
     $parser->addOption('orders', ['short' => 'o', 'help' => 'Comma Seperated list of order ids [withouth,spaces]']);
     $parser->addOption('skus', ['short' => 's', 'help' => 'Comma Seperated list of skus [withouth,spaces]']);
     $parser->addOption('warehouse', ['short' => 'w', 'help' => 'Warehouse (e.g. US, NL, MX or 1, 2, 3)']);
     $parser->description('Ecommerce Interface to Netsuite.');
     return $parser;
 }
Пример #16
0
 /**
  * ヘルプ内容とパラメータ・オプション群の定義
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     // ConsoleOptionParserインスタンスの取得
     $parser = parent::getOptionParser();
     // ヘルプの先頭にくるこのシェルの説明
     $parser->description('This is DailyShell\'s help.');
     // サブコマンドの説明・オプションの定義
     $parser->addSubcommand('MemberData', array('help' => 'Backup Members data.', 'parser' => $this->MemberData->getOptionParser()));
     return $parser;
 }
Пример #17
0
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__d('backend', "Mange UserModels"));
     $parser->addArgument('command', array('help' => 'Command', 'required' => true, 'choices' => array('add', 'edit', 'delete')));
     $parser->addArgument('username', array('help' => __d('backend', "Username"), 'required' => true));
     $parser->addOption('password', array('help' => __d('backend', "Password"), 'short' => 'p'));
     $parser->addOption('mail', array('help' => __d('backend', "Mail"), 'short' => 'm'));
     $parser->addOption('root', array('help' => __d('backend', "Is SuperUser"), 'short' => 'r', 'boolean' => true));
     return $parser;
 }
Пример #18
0
 /**
  * ヘルプ内容とパラメータ・オプション群の定義
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     // ConsoleOptionParserインスタンスの取得
     $parser = parent::getOptionParser();
     // ヘルプの先頭にくるこのタスクの説明
     $parser->description('This is MemberData Task\'s help.');
     // 引数の説明
     $parser->addArgument('FileName', array('help' => 'Output file name.', 'required' => true));
     // タスクのオプションの定義
     $parser->addOption('connection', array('help' => 'Database connection.', 'short' => 'c', 'default' => 'default', 'choices' => array('default', 'test')));
     return $parser;
 }
Пример #19
0
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     //        $parser->addArgument('type', array(
     //            'help' => 'Either a full path or type of class.'));
     //        $parser->addArgument('className', array(
     //            'help' => 'A CakePHP core class name (e.g: Component, HtmlHelper).'
     //        ));
     $parser->addOption('template', array('short' => 'c', 'help' => 'Use template file for new creation.'));
     $parser->addOption('class', array('short' => 'l', 'help' => 'Use template file for new creation.'));
     $parser->addOption('environment', array('short' => 'e', 'help' => 'Do not fuss with this unless you know what you are doing.'));
     $parser->addOption('timestamp', array('short' => 't', 'help' => 'The timestamp of the migration want to execute.'));
     $parser->description('Wrapper to run Phinx migrations in CakePHP.');
     return $parser;
 }
Пример #20
0
 /**
  * Gets the option parser instance and configures it.
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__d('cake_console', 'Generate a new CakePHP project skeleton.'))->addArgument('name', array('help' => __d('cake_console', 'Application directory to make, if it starts with "/" the path is absolute.')))->addOption('empty', array('boolean' => true, 'help' => __d('cake_console', 'Create empty files in each of the directories. Good if you are using git')))->addOption('theme', array('short' => 't', 'help' => __d('cake_console', 'Theme to use when baking code.')))->addOption('skel', array('default' => current(App::core('Console')) . 'Templates' . DS . 'skel', 'help' => __d('cake_console', 'The directory layout to use for the new application skeleton.' . ' Defaults to cake/Console/Templates/skel of CakePHP used to create the project.')));
     return $parser;
 }
Пример #21
0
 /**
  * Get the option parser.
  *
  * @return void
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $type = array('choices' => array('aro', 'aco'), 'required' => true, 'help' => __d('cake_console', 'Type of node to create.'));
     $parser->description(__d('cake_console', 'A console tool for managing the DbAcl'))->addSubcommand('create', array('help' => __d('cake_console', 'Create a new ACL node'), 'parser' => array('description' => __d('cake_console', 'Creates a new ACL object <node> under the parent'), 'arguments' => array('type' => $type, 'parent' => array('help' => __d('cake_console', 'The node selector for the parent.'), 'required' => true), 'alias' => array('help' => __d('cake_console', 'The alias to use for the newly created node.'), 'required' => true)))))->addSubcommand('delete', array('help' => __d('cake_console', 'Deletes the ACL object with the given <node> reference'), 'parser' => array('description' => __d('cake_console', 'Delete an ACL node.'), 'arguments' => array('type' => $type, 'node' => array('help' => __d('cake_console', 'The node identifier to delete.'), 'required' => true)))))->addSubcommand('setparent', array('help' => __d('cake_console', 'Moves the ACL node under a new parent.'), 'parser' => array('description' => __d('cake_console', 'Moves the ACL object specified by <node> beneath <parent>'), 'arguments' => array('type' => $type, 'node' => array('help' => __d('cake_console', 'The node to move'), 'required' => true), 'parent' => array('help' => __d('cake_console', 'The new parent for <node>.'), 'required' => true)))))->addSubcommand('getpath', array('help' => __d('cake_console', 'Print out the path to an ACL node.'), 'parser' => array('description' => array(__d('cake_console', "Returns the path to the ACL object specified by <node>."), __d('cake_console', "This command is useful in determining the inheritance of permissions for a certain object in the tree.")), 'arguments' => array('type' => $type, 'node' => array('help' => __d('cake_console', 'The node to get the path of'), 'required' => true)))))->addSubcommand('check', array('help' => __d('cake_console', 'Check the permissions between an ACO and ARO.'), 'parser' => array('description' => array(__d('cake_console', 'Use this command to check ACL permissions.')), 'arguments' => array('aro' => array('help' => __d('cake_console', 'ARO to check.'), 'required' => true), 'aco' => array('help' => __d('cake_console', 'ACO to check.'), 'required' => true), 'action' => array('help' => __d('cake_console', 'Action to check'), 'default' => 'all')))))->addSubcommand('grant', array('help' => __d('cake_console', 'Grant an ARO permissions to an ACO.'), 'parser' => array('description' => array(__d('cake_console', 'Use this command to grant ACL permissions. Once executed, the ARO specified (and its children, if any) will have ALLOW access to the specified ACO action (and the ACO\'s children, if any).')), 'arguments' => array('aro' => array('help' => __d('cake_console', 'ARO to grant permission to.'), 'required' => true), 'aco' => array('help' => __d('cake_console', 'ACO to grant access to.'), 'required' => true), 'action' => array('help' => __d('cake_console', 'Action to grant'), 'default' => 'all')))))->addSubcommand('deny', array('help' => __d('cake_console', 'Deny an ARO permissions to an ACO.'), 'parser' => array('description' => array(__d('cake_console', 'Use this command to deny ACL permissions. Once executed, the ARO specified (and its children, if any) will have DENY access to the specified ACO action (and the ACO\'s children, if any).')), 'arguments' => array('aro' => array('help' => __d('cake_console', 'ARO to deny.'), 'required' => true), 'aco' => array('help' => __d('cake_console', 'ACO to deny.'), 'required' => true), 'action' => array('help' => __d('cake_console', 'Action to deny'), 'default' => 'all')))))->addSubcommand('inherit', array('help' => __d('cake_console', 'Inherit an ARO\'s parent permissions.'), 'parser' => array('description' => array(__d('cake_console', "Use this command to force a child ARO object to inherit its permissions settings from its parent.")), 'arguments' => array('aro' => array('help' => __d('cake_console', 'ARO to have permissions inherit.'), 'required' => true), 'aco' => array('help' => __d('cake_console', 'ACO to inherit permissions on.'), 'required' => true), 'action' => array('help' => __d('cake_console', 'Action to inherit'), 'default' => 'all')))))->addSubcommand('view', array('help' => __d('cake_console', 'View a tree or a single node\'s subtree.'), 'parser' => array('description' => array(__d('cake_console', "The view command will return the ARO or ACO tree."), __d('cake_console', "The optional node parameter allows you to return"), __d('cake_console', "only a portion of the requested tree.")), 'arguments' => array('type' => $type, 'node' => array('help' => __d('cake_console', 'The optional node to view the subtree of.'))))))->addSubcommand('initdb', array('help' => __d('cake_console', 'Initialize the DbAcl tables. Uses this command : cake schema create DbAcl')))->epilog(array('Node and parent arguments can be in one of the following formats:', '', ' - <model>.<id> - The node will be bound to a specific record of the given model.', '', ' - <alias> - The node will be given a string alias (or path, in the case of <parent>)', "   i.e. 'John'. When used with <parent>, this takes the form of an alias path,", "   i.e. <group>/<subgroup>/<parent>.", '', "To add a node at the root level, enter 'root' or '/' as the <parent> parameter."));
     return $parser;
 }
Пример #22
0
 /**
  * get the option parser
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $subcommandParser = array('options' => array('plugin' => array('short' => 'p', 'help' => __d('cake_console', 'The plugin to update. Only the specified plugin will be updated.')), 'ext' => array('short' => 'e', 'help' => __d('cake_console', 'The extension(s) to search. A pipe delimited list, or a preg_match compatible subpattern'), 'default' => 'php|ctp|thtml|inc|tpl'), 'git' => array('short' => 'g', 'help' => __d('cake_console', 'Use git command for moving files around.'), 'boolean' => true), 'dry-run' => array('short' => 'd', 'help' => __d('cake_console', 'Dry run the update, no files will actually be modified.'), 'boolean' => true)));
     return parent::getOptionParser()->description(__d('cake_console', "A shell to help automate upgrading from CakePHP 1.3 to 2.0. \n" . "Be sure to have a backup of your application before running these commands."))->addSubcommand('all', array('help' => __d('cake_console', 'Run all upgrade commands.'), 'parser' => $subcommandParser))->addSubcommand('tests', array('help' => __d('cake_console', 'Update tests class names to FooTest rather than FooTestCase.'), 'parser' => $subcommandParser))->addSubcommand('locations', array('help' => __d('cake_console', 'Move files and folders to their new homes.'), 'parser' => $subcommandParser))->addSubcommand('i18n', array('help' => __d('cake_console', 'Update the i18n translation method calls.'), 'parser' => $subcommandParser))->addSubcommand('helpers', array('help' => __d('cake_console', 'Update calls to helpers.'), 'parser' => $subcommandParser))->addSubcommand('basics', array('help' => __d('cake_console', 'Update removed basics functions to PHP native functions.'), 'parser' => $subcommandParser))->addSubcommand('request', array('help' => __d('cake_console', 'Update removed request access, and replace with $this->request.'), 'parser' => $subcommandParser))->addSubcommand('configure', array('help' => __d('cake_console', "Update Configure::read() to Configure::read('debug')"), 'parser' => $subcommandParser))->addSubcommand('constants', array('help' => __d('cake_console', "Replace Obsolete constants"), 'parser' => $subcommandParser))->addSubcommand('components', array('help' => __d('cake_console', 'Update components to extend Component class.'), 'parser' => $subcommandParser))->addSubcommand('exceptions', array('help' => __d('cake_console', 'Replace use of cakeError with exceptions.'), 'parser' => $subcommandParser));
 }
Пример #23
0
 /**
  * Gets the option parser instance and configures it.
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__d('cake_console', 'Get the list of available shells for this CakePHP application.'))->addOption('sort', array('help' => __d('cake_console', 'Does nothing (deprecated)'), 'boolean' => true))->addOption('xml', array('help' => __d('cake_console', 'Get the listing as XML.'), 'boolean' => true));
     return $parser;
 }
 /**
  * get the option parser.
  *
  * @return void
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     return $parser->description('Load test fixtures into any datasource you want')->addArgument('fixtures', array('help' => 'A comma separated list of fixtures to use (Format is same as $fixtures property in CakeTest classes', 'required' => true))->addOption('datasource', array('help' => 'Datasource to use', 'default' => 'default'));
 }
Пример #25
0
 /**
  * Gets the option parser instance and configures it.
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(array(__d('cake_console', 'PHP Built-in Server for CakePHP'), __d('cake_console', '<warning>[WARN] Don\'t use this at the production environment</warning>')))->addOption('host', array('short' => 'H', 'help' => __d('cake_console', 'ServerHost')))->addOption('port', array('short' => 'p', 'help' => __d('cake_console', 'ListenPort')))->addOption('document_root', array('short' => 'd', 'help' => __d('cake_console', 'DocumentRoot')));
     return $parser;
 }
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addOption('day', array('help' => 'day [yyyy-mm-dd]', 'default' => date('Y-m-d', strtotime('-1 day', time()))));
     return $parser;
 }
 /**
  * Get the option parser.
  *
  * @return void
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     return $parser->description('The Migration shell.' . '')->addOption('plugin', array('short' => 'p', 'help' => __('Plugin name to be used')))->addOption('precheck', array('short' => 'm', 'default' => 'Migrations.PrecheckException', 'help' => __('Precheck migrations')))->addOption('force', array('short' => 'f', 'boolean' => true, 'help' => __('Force \'generate\' to compare all tables.')))->addOption('connection', array('short' => 'c', 'default' => null, 'help' => __('Overrides the \'default\' connection of the MigrationVersion')))->addOption('migrationConnection', array('short' => 'i', 'default' => null, 'help' => __('Overrides the \'default\' connection of the CakeMigrations that are applied')))->addOption('dry', array('short' => 'd', 'boolean' => true, 'default' => false, 'help' => __('Output the raw SQL queries rather than applying them to the database.')))->addOption('no-auto-init', array('short' => 'n', 'boolean' => true, 'default' => false, 'help' => __('Disables automatic creation of migrations table and running any internal plugin migrations')))->addOption('schema-class', array('short' => 's', 'boolean' => false, 'default' => false, 'help' => __('CamelCased Classname without the `Schema` suffix to use when reading or generating schema files. See `Console/cake schema generate --help`.')))->addSubcommand('status', array('help' => __('Displays a status of all plugin and app migrations.')))->addSubcommand('run', array('help' => __('Run a migration to given direction or version.')))->addSubcommand('generate', array('help' => __('Generates a migration file.')));
 }
Пример #28
0
 /**
  * get the option parser
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     return $parser->description(__d('cake_console', 'Bake new database configuration settings.'));
 }
Пример #29
0
 /**
  * Gets the option parser instance and configures it.
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->description(__d('cake_console', 'Lookup doc block comments for classes in CakePHP.'))->addArgument('type', array('help' => __d('cake_console', 'Either a full path or type of class (model, behavior, controller, component, view, helper)')))->addArgument('className', array('help' => __d('cake_console', 'A CakePHP core class name (e.g: Component, HtmlHelper).')))->addOption('method', array('short' => 'm', 'help' => __d('cake_console', 'The specific method you want help on.')));
     return $parser;
 }
Пример #30
0
 /**
  * Get & configure the option parser
  *
  * @return void
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     return $parser->description(__d('cake_console', 'CakePHP Language String Extraction:'))->addOption('app', array('help' => __d('cake_console', 'Directory where your application is located.')))->addOption('paths', array('help' => __d('cake_console', 'Comma separated list of paths.')))->addOption('merge', array('help' => __d('cake_console', 'Merge all domain strings into the default.po file.'), 'choices' => array('yes', 'no')))->addOption('output', array('help' => __d('cake_console', 'Full path to output directory.')))->addOption('files', array('help' => __d('cake_console', 'Comma separated list of files.')))->addOption('exclude-plugins', array('boolean' => true, 'default' => true, 'help' => __d('cake_console', 'Ignores all files in plugins if this command is run inside from the same app directory.')))->addOption('plugin', array('help' => __d('cake_console', 'Extracts tokens only from the plugin specified and puts the result in the plugin\'s Locale directory.')))->addOption('ignore-model-validation', array('boolean' => true, 'default' => false, 'help' => __d('cake_console', 'Ignores validation messages in the $validate property.' . ' If this flag is not set and the command is run from the same app directory,' . ' all messages in model validation rules will be extracted as tokens.')))->addOption('validation-domain', array('help' => __d('cake_console', 'If set to a value, the localization domain to be used for model validation messages.')))->addOption('exclude', array('help' => __d('cake_console', 'Comma separated list of directories to exclude.' . ' Any path containing a path segment with the provided values will be skipped. E.g. test,vendors')));
 }