aboutsummaryrefslogtreecommitdiff
path: root/src/bdrem/Cli.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-03-20 17:03:06 +0100
committerChristian Weiske <cweiske@cweiske.de>2014-03-20 17:03:06 +0100
commit6032c11d7a88651d85154ffe835a26b3f569c893 (patch)
treeb3cb83cb8d7dbcfa23891b84e3f0447c31e743c8 /src/bdrem/Cli.php
parent62842c0ba16bb1dc67435dea7b4d75af7773eacb (diff)
downloadbdrem-6032c11d7a88651d85154ffe835a26b3f569c893.tar.gz
bdrem-6032c11d7a88651d85154ffe835a26b3f569c893.zip
add docblocks to all files, classes, methods and variables
Diffstat (limited to 'src/bdrem/Cli.php')
-rw-r--r--src/bdrem/Cli.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/bdrem/Cli.php b/src/bdrem/Cli.php
index f108e8e..0525a37 100644
--- a/src/bdrem/Cli.php
+++ b/src/bdrem/Cli.php
@@ -1,8 +1,39 @@
<?php
+/**
+ * Part of bdrem
+ *
+ * PHP version 5
+ *
+ * @category Tools
+ * @package Bdrem
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @copyright 2014 Christian Weiske
+ * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
+ * @link http://cweiske.de/bdrem.htm
+ */
namespace bdrem;
+/**
+ * Command line user interface for the terminal/shell.
+ * Renders an ASCII table by default.
+ *
+ * @category Tools
+ * @package Bdrem
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @copyright 2014 Christian Weiske
+ * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
+ * @version Release: @package_version@
+ * @link http://cweiske.de/bdrem.htm
+ */
class Cli extends UserInterface
{
+ /**
+ * Load parameters for the CLI option parser.
+ * Set the default renderer to "console" and adds some CLI-only commands
+ * like "readme" and "config".
+ *
+ * @return \Console_CommandLine CLI option parser
+ */
protected function loadParameters()
{
$parser = parent::loadParameters();
@@ -24,6 +55,13 @@ class Cli extends UserInterface
return $parser;
}
+ /**
+ * Handle any commands given on the CLI
+ *
+ * @param object $res Command line parameters and options
+ *
+ * @return void
+ */
protected function handleCommands($res)
{
if ($res->command_name == '') {
@@ -37,12 +75,22 @@ class Cli extends UserInterface
}
}
+ /**
+ * Handle the "readme" command and output the readme.
+ *
+ * @return void
+ */
protected function showReadme()
{
readfile(__DIR__ . '/../../README.rst');
exit();
}
+ /**
+ * Handle the "config" command and output the default configuration
+ *
+ * @return void
+ */
protected function extractConfig()
{
readfile(__DIR__ . '/../../data/bdrem.config.php.dist');