Skip to content

Instantly share code, notes, and snippets.

@tom--
Created July 19, 2014 15:56
Show Gist options
  • Select an option

  • Save tom--/dad3fc7925e765d0d093 to your computer and use it in GitHub Desktop.

Select an option

Save tom--/dad3fc7925e765d0d093 to your computer and use it in GitHub Desktop.
Start the wonderful Boris PHP REPL (https://github.com/d11wtq/boris) with Yii2. Handy for trying things out. Both files go in my home directory
<?php
require __DIR__ . '/startYii2.php';
$boris->setPrompt('yii2> ');
<?php
// Derived from Yii2's phpunit bootstrap
// ensure we get report on all possible php errors
error_reporting(-1);
define('YII_ENABLE_ERROR_HANDLER', false);
define('YII_DEBUG', true);
$_SERVER['SCRIPT_NAME'] = '/' . __DIR__;
$_SERVER['SCRIPT_FILENAME'] = __FILE__;
$yii2dir = '/Volumes/Sites/yii2';
// require composer autoloader if available
$composerAutoload = $yii2dir . '/vendor/autoload.php';
if (is_file($composerAutoload)) {
require_once($composerAutoload);
}
require_once($yii2dir . '/framework/Yii.php');
new \yii\console\Application([
'id' => 'boris',
'basePath' => __DIR__,
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment