コード例 #1
0
ファイル: Pager.php プロジェクト: alexpw/Console
         * @param   string  $output    Output (from the output buffer).
         * @param   int     $mode      Mode (from the output buffer).
         * @param   string  $type      Type. Please, see self::LESS or self::MORE.
         * @return  string
         */
        public static function pager($output, $mode, $type = null)
        {
            static $process = null;
            static $pipes = null;
            if ($mode & PHP_OUTPUT_HANDLER_START) {
                $pager = null !== $type ? \Hoa\Console\Processus::locate($type) : (isset($_ENV['PAGER']) ? $_ENV['PAGER'] : null);
                if (null === $pager) {
                    return $output;
                }
                $process = new \Hoa\Console\Processus($pager, null, array(0 => array('pipe', 'r')));
                $process->open();
            }
            $process->writeAll($output);
            if ($mode & PHP_OUTPUT_HANDLER_FINAL) {
                $process->close();
            }
            return null;
        }
    }
}
namespace {
    /**
     * Define PHP_OUTPUT_HANDLER_FINAL if PHP < 5.4.
     */
    PHP_VERSION_ID < 50400 && _define('PHP_OUTPUT_HANDLER_FINAL', PHP_OUTPUT_HANDLER_END);
}
コード例 #2
0
        define($name, $value);
    }
}
_define('ROOT', $findRoot());
_define('APP_DIR', 'App');
_define('WEBROOT_DIR', 'webroot');
_define('APP', ROOT . '/tests/App/');
_define('CONFIG', ROOT . '/tests/Config/');
_define('WWW_ROOT', ROOT . DS . WEBROOT_DIR . DS);
_define('TESTS', ROOT . DS . 'tests' . DS);
_define('TMP', ROOT . DS . 'tmp' . DS);
_define('LOGS', TMP . 'logs' . DS);
_define('CACHE', TMP . 'cache' . DS);
_define('CAKE_CORE_INCLUDE_PATH', ROOT . '/vendor/cakephp/cakephp');
_define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
_define('CAKE', CORE_PATH . 'src' . DS);
//require_once ROOT . '/vendor/cakephp/cakephp/src/basics.php';
require_once ROOT . '/vendor/autoload.php';
Cake\Core\Configure::write('App', ['namespace' => 'CakeDC\\OracleDriver\\Test\\App']);
Cake\Core\Configure::write('debug', true);
$TMP = new \Cake\Filesystem\Folder(TMP);
$TMP->create(TMP . 'cache/models', 0777);
$TMP->create(TMP . 'cache/persistent', 0777);
$TMP->create(TMP . 'cache/views', 0777);
$cache = ['default' => ['engine' => 'File'], '_cake_core_' => ['className' => 'File', 'prefix' => 'oracle_driver_cake_core_', 'path' => CACHE . 'persistent/', 'serialize' => true, 'duration' => '+10 seconds'], '_cake_model_' => ['className' => 'File', 'prefix' => 'oracle_driver_cake_model_', 'path' => CACHE . 'models/', 'serialize' => 'File', 'duration' => '+10 seconds'], '_cake_method_' => ['className' => 'File', 'prefix' => 'oracle_driver_cake_method_', 'path' => CACHE . 'models/', 'serialize' => 'File', 'duration' => '+10 seconds']];
Cake\Cache\Cache::config($cache);
Cake\Core\Configure::write('Session', ['defaults' => 'php']);
Cake\Core\Plugin::load('CakeDC\\OracleDriver', ['path' => ROOT . DS, 'autoload' => true]);
Cake\Routing\DispatcherFactory::add('Routing');
Cake\Routing\DispatcherFactory::add('ControllerFactory');
// Ensure default test connection is defined
コード例 #3
0
ファイル: Ll1.php プロジェクト: lovenunu/Hoa-compiler
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
namespace Hoa\Compiler;

/**
 * Define the __ constant, so useful in compiler :-).
 */
_define('GO', 'GO');
_define('__', '__');
/**
 * Class \Hoa\Compiler\Ll1.
 *
 * Provide an abstract LL(1) compiler, based on sub-automata and stacks.
 *
 * @copyright  Copyright © 2007-2015 Hoa community
 * @license    New BSD License
 */
abstract class Ll1
{
    /**
     * Initial line.
     * If we try to compile a code inside another code, the initial line would
     * not probably be 0.
     *