diff options
Diffstat (limited to 'lib/task/isisInfoTask.class.php')
-rw-r--r-- | lib/task/isisInfoTask.class.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/task/isisInfoTask.class.php b/lib/task/isisInfoTask.class.php new file mode 100644 index 0000000..da4836c --- /dev/null +++ b/lib/task/isisInfoTask.class.php @@ -0,0 +1,41 @@ +<?php + +class isisInfoTask extends mySfTask +{ + protected function configure() + { + $this->addOptions(array( + new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name'), + new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), + new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'), + new sfCommandOption('loglevel', 'l', sfCommandOption::PARAMETER_REQUIRED, 'Log level', 'info'), + )); + + $this->namespace = 'isis'; + $this->name = 'info'; + $this->briefDescription = 'List information of ISIS databases'; + $this->detailedDescription = <<<EOF +The [isis:info|INFO] task lists information of ISIS databases. +Call it with: + + [php symfony isis:import|INFO] +EOF; + } + + protected function execute($arguments = array(), $options = array()) + { + // Initialize an IsisConnector. + $class = (class_exists('IsisImporterManager')) ? 'IsisImporterManager' : 'sfIsisImporterManager'; + $isis = new $class($options['loglevel']); + + // Error handling. + if ($isis == FALSE) + { + $this->logSection('isis', 'Error opening ISIS database.'); + return FALSE; + } + + // Database information. + $isis->info($this, 'task'); + } +} |