From 6dae236ec5528522de472637f9d70a98158b9a5d Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Thu, 5 Feb 2015 11:45:26 +0100 Subject: Renamed 3rdparty directory to vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Php namespaces can’t begin with a number --- .../PhpShell/PHP/Shell/Extensions/VerbosePrint.php | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 framework/Vendor/PhpShell/PHP/Shell/Extensions/VerbosePrint.php (limited to 'framework/Vendor/PhpShell/PHP/Shell/Extensions/VerbosePrint.php') diff --git a/framework/Vendor/PhpShell/PHP/Shell/Extensions/VerbosePrint.php b/framework/Vendor/PhpShell/PHP/Shell/Extensions/VerbosePrint.php new file mode 100644 index 00000000..425937c1 --- /dev/null +++ b/framework/Vendor/PhpShell/PHP/Shell/Extensions/VerbosePrint.php @@ -0,0 +1,56 @@ +registerCommand('#^p #', $this, 'cmdPrint', 'p ', 'print the variable verbosly'); + + $opt = PHP_Shell_Options::getInstance(); + $opt->registerOption('verboseprint', $this, 'optSetVerbose'); +*/ + } + + /** + * handle the 'p ' command + * + * set the verbose flag + * + * @return string the pure command-string without the 'p ' command + */ + public function cmdPrint($l) { + $this->oneshot_verbose = true; + + $cmd = substr($l, 2); + + return $cmd; + } + + public function optSetVerbose($key, $val) { + switch($val) { + case "false": + case "on": + case "1": + $this->opt_verbose = true; + default: + $this->opt_verbose = false; + break; + } + } + + /** + * check if we have a verbose print-out + * + * @return bool 1 if verbose, 0 otherwise + */ + public function isVerbose() { + $v = $this->opt_verbose || $this->oneshot_verbose; + + $this->oneshot_verbose = false; + + return $v; + } +} + + -- cgit v1.2.3