diff --git a/src/Psy/Command/DemoCommand.php b/src/Psy/Command/DemoCommand.php new file mode 100644 index 000000000..c5ceb0cfb --- /dev/null +++ b/src/Psy/Command/DemoCommand.php @@ -0,0 +1,36 @@ +setName('demo') + ->setDefinition(array( + new InputOption('message', 'm', InputOption::VALUE_REQUIRED, 'Message to send.'), + )) + ->setDescription('Sample command just for testing.') + ->setHelp( + <<getOption('message'); + $output->writeln(sprintf('Received message "%s". ', $message)); + } +} diff --git a/src/Psy/Plugin/AbstractPlugin.php b/src/Psy/Plugin/AbstractPlugin.php new file mode 100644 index 000000000..c3b7fba88 --- /dev/null +++ b/src/Psy/Plugin/AbstractPlugin.php @@ -0,0 +1,68 @@ +getShortName()); + } + + /** + * @param array $configuration + * + * @return array + */ + final public static function getConfiguration($configuration = array()) + { + return array_merge_recursive( + $configuration, + array( + 'commands' => static::getCommands(), + 'presenters' => static::getPresenters(), + 'matchers' => static::getMatchers(), + // if any more parts of the config are exposed publicly, remember to add here with the static ref. + ) + ); + } + + // any publicly exposed configuration piece below here ↓ + + /** + * @return array + */ + public static function getCommands() + { + // add your own commands + return array(); + } + + /** + * @return array + */ + public static function getPresenters() + { + // add your own presenters + return array(); + } + + /** + * @return array + */ + public static function getMatchers() + { + // add your own presenters + return array(); + } +} diff --git a/src/Psy/Plugin/DemoPlugin.php b/src/Psy/Plugin/DemoPlugin.php new file mode 100644 index 000000000..089eac8a1 --- /dev/null +++ b/src/Psy/Plugin/DemoPlugin.php @@ -0,0 +1,19 @@ +