library/Garp/Cli/Command/Shell.php
protected function _tick() {
        while (true) {
            // Grab a line of PHP code from the prompt
            $line = $this->_getInput();

            /**
             * Note that $this->__result will be populated, if no target variable is given
             * in the expression. In other words, this will populate $this->__result:
             * $someModel->fetchAll();
             * But this won't:
             * $rows = $someModel->fetchAll();
             * ...because we assume the user wants to do something with the variable.
             */
            if (!$this->_input && !preg_match('/^(\$\w+\s?\=)|print|echo/', $line)) {
                $line = '$this->__result = ' . $line;
            }

            $this->_input .= $line;

            // If no semicolon is found at the end, assume
            // multi-line input. The user is therefore not finished,
            // so we just continue here and wait for that semicolon.
            if (substr($line, -1) !== ';') {
                continue;
            }

            // Execute input, and grab its output
            ob_start(array($this, 'output'));
            eval($this->_input);
            ob_end_flush();

            // Clear result var
            $this->__result = null;
            // Reset input
            $this->_input = '';
        }
    }
protected function _tick() {
        while (true) {
            // Grab a line of PHP code from the prompt
            $line = $this->_getInput();

            /**
             * Note that $this->__result will be populated, if no target variable is given
             * in the expression. In other words, this will populate $this->__result:
             * $someModel->fetchAll();
             * But this won't:
             * $rows = $someModel->fetchAll();
             * ...because we assume the user wants to do something with the variable.
             */
            if (!$this->_input && !preg_match('/^(\$\w+\s?\=)|print|echo/', $line)) {
                $line = '$this->__result = ' . $line;
            }

            $this->_input .= $line;

            // If no semicolon is found at the end, assume
            // multi-line input. The user is therefore not finished,
            // so we just continue here and wait for that semicolon.
            if (substr($line, -1) !== ';') {
                continue;
            }

            // Execute input, and grab its output
            ob_start(array($this, 'output'));
            eval($this->_input);
            ob_end_flush();

            // Clear result var
            $this->__result = null;
            // Reset input
            $this->_input = '';
        }
    }
protected function _tick ( ) { while ( true ) { // Grab a line of PHP code from the prompt $ line = $ this -> _getInput ( ) ; /**
             * Note that $this->__result will be populated, if no target variable is given
             * in the expression. In other words, this will populate $this->__result:
             * $someModel->fetchAll();
             * But this won't:
             * $rows = $someModel->fetchAll();
             * ...because we assume the user wants to do something with the variable.
             */ if ( ! $ this -> _input && ! preg_match ( '/^(\$\w+\s?\=)|print|echo/' , $ line ) ) { $ line = '$this->__result = ' . $ line ; } $ this -> _input .= $ line ; // If no semicolon is found at the end, assume // multi-line input. The user is therefore not finished, // so we just continue here and wait for that semicolon. if ( substr ( $ line , - 1 ) !== ';' ) { continue ; } // Execute input, and grab its output ob_start ( array ( $ this , 'output' ) ) ; eval ( $ this -> _input ) ; ob_end_flush ( ) ; // Clear result var $ this -> __result = null ; // Reset input $ this -> _input = '' ; } }
One iteration in the main loop.

@return Void
One iteration in the main loop .