Skip to content

Instantly share code, notes, and snippets.

@jbroadway
Last active August 29, 2015 13:57
Show Gist options
  • Save jbroadway/9532847 to your computer and use it in GitHub Desktop.
Save jbroadway/9532847 to your computer and use it in GitHub Desktop.
Using Boris REPL with Elefant CMS.
<?php
/**
* Load Boris REPL when run via `php index.php boris`.
*/
if ($controller->cli && $_SERVER['REQUEST_URI'] === '/boris') {
require_once ('lib/vendor/autoload.php');
$cache = Cache::init (conf ('Cache'));
$controller->cache ($cache);
$boris = new \Boris\Boris ('elefant> ');
$boris->setLocal (array (
'cache' => $cache,
'controller' => $controller,
'i18n' => $i18n,
'page' => $page,
'tpl' => $tpl
));
$boris->start ();
}
?>

Using Boris REPL with Elefant CMS

Note: Boris requires PHP's pcntl extension.

1. Install Boris via:

    composer.phar require d11wtq/boris

2. Add the provided bootstrap.php to your document root.

3. Call via:

    php index.php boris

The following Elefant objects are available to the REPL for inspection:

  • $controller
  • $i18n
  • $page
  • $tpl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment