Source for file VerbosePrint.php
Documentation is available at VerbosePrint.php
class PHP_Shell_Extensions_VerbosePrint implements PHP_Shell_Extension {
protected $opt_verbose = false;
protected $oneshot_verbose = false;
public function register () {
$cmd = PHP_Shell_Commands ::getInstance ();
$cmd->registerCommand ('#^p #', $this, 'cmdPrint', 'p <var>', 'print the variable verbosly');
$opt = PHP_Shell_Options ::getInstance ();
$opt->registerOption ('verboseprint', $this, 'optSetVerbose');
* handle the 'p ' command
* @return string the pure command-string without the 'p ' command
public function cmdPrint ($l) {
$this->oneshot_verbose = true;
public function optSetVerbose ($key, $val) {
$this->opt_verbose = true;
$this->opt_verbose = false;
* 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;
Documentation generated on Mon, 11 Mar 2019 14:40:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|