| @@ 60-93 (lines=34) @@ | ||
| 57 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
| 58 | * @link http://datasift.github.io/storyplayer |
|
| 59 | */ |
|
| 60 | class CreateStory_ForceSwitch extends CliSwitch |
|
| 61 | { |
|
| 62 | public function __construct() |
|
| 63 | { |
|
| 64 | // define our name, and our description |
|
| 65 | $this->setName('force'); |
|
| 66 | $this->setShortDescription('force the action to happen'); |
|
| 67 | ||
| 68 | // what are the short switches? |
|
| 69 | $this->addShortSwitch('f'); |
|
| 70 | ||
| 71 | // what are the long switches? |
|
| 72 | $this->addLongSwitch('force'); |
|
| 73 | ||
| 74 | // all done |
|
| 75 | } |
|
| 76 | ||
| 77 | /** |
|
| 78 | * |
|
| 79 | * @param CliEngine $engine |
|
| 80 | * @param integer $invokes |
|
| 81 | * @param array $params |
|
| 82 | * @param boolean $isDefaultParam |
|
| 83 | * @return CliResult |
|
| 84 | */ |
|
| 85 | public function process(CliEngine $engine, $invokes = 1, $params = array(), $isDefaultParam = false) |
|
| 86 | { |
|
| 87 | // remember the setting |
|
| 88 | $engine->options->force = true; |
|
| 89 | ||
| 90 | // tell the engine that it is done |
|
| 91 | return new CliResult(CliResult::PROCESS_CONTINUE); |
|
| 92 | } |
|
| 93 | } |
|
| @@ 63-96 (lines=34) @@ | ||
| 60 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
| 61 | * @link http://datasift.github.io/storyplayer |
|
| 62 | */ |
|
| 63 | class Feature_LogInternalEventsSwitch extends CliSwitch |
|
| 64 | { |
|
| 65 | public function __construct() |
|
| 66 | { |
|
| 67 | // define our name, and our description |
|
| 68 | $this->setName(static::class); |
|
| 69 | $this->setShortDescription('log all internal events'); |
|
| 70 | $this->setLongDesc( |
|
| 71 | "Use this switch when you want Storyplayer to log internal events." |
|
| 72 | ); |
|
| 73 | ||
| 74 | // what are the long switches? |
|
| 75 | $this->addLongSwitch('log-internal-events'); |
|
| 76 | ||
| 77 | // all done |
|
| 78 | } |
|
| 79 | ||
| 80 | /** |
|
| 81 | * |
|
| 82 | * @param CliEngine $engine |
|
| 83 | * @param integer $invokes |
|
| 84 | * @param array $params |
|
| 85 | * @param boolean $isDefaultParam |
|
| 86 | * @return CliResult |
|
| 87 | */ |
|
| 88 | public function process(CliEngine $engine, $invokes = 1, $params = array(), $isDefaultParam = false) |
|
| 89 | { |
|
| 90 | // remember the setting |
|
| 91 | $engine->options->logInternalEvents = true; |
|
| 92 | ||
| 93 | // tell the engine that it is done |
|
| 94 | return new CliResult(CliResult::PROCESS_CONTINUE); |
|
| 95 | } |
|
| 96 | } |
|
| 97 | ||
| @@ 63-96 (lines=34) @@ | ||
| 60 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
| 61 | * @link http://datasift.github.io/storyplayer |
|
| 62 | */ |
|
| 63 | class Feature_WarnDeprecatedSwitch extends CliSwitch |
|
| 64 | { |
|
| 65 | public function __construct() |
|
| 66 | { |
|
| 67 | // define our name, and our description |
|
| 68 | $this->setName('warnDeprecated'); |
|
| 69 | $this->setShortDescription('enable warnings about use of deprecated features'); |
|
| 70 | $this->setLongDesc( |
|
| 71 | "Use this switch when you want Storyplayer to warn you that your stories and/or modules rely on deprecated features." |
|
| 72 | ); |
|
| 73 | ||
| 74 | // what are the long switches? |
|
| 75 | $this->addLongSwitch('warn-deprecated'); |
|
| 76 | ||
| 77 | // all done |
|
| 78 | } |
|
| 79 | ||
| 80 | /** |
|
| 81 | * |
|
| 82 | * @param CliEngine $engine |
|
| 83 | * @param integer $invokes |
|
| 84 | * @param array $params |
|
| 85 | * @param boolean $isDefaultParam |
|
| 86 | * @return CliResult |
|
| 87 | */ |
|
| 88 | public function process(CliEngine $engine, $invokes = 1, $params = array(), $isDefaultParam = false) |
|
| 89 | { |
|
| 90 | // remember the setting |
|
| 91 | $engine->options->warnDeprecated = true; |
|
| 92 | ||
| 93 | // tell the engine that it is done |
|
| 94 | return new CliResult(CliResult::PROCESS_CONTINUE); |
|
| 95 | } |
|
| 96 | } |
|
| 97 | ||