tobiassjosten / boris-loader
Loads project specific contexts into Boris REPL
Installs: 30 118
Dependents: 0
Suggesters: 0
Security: 0
Stars: 28
Watchers: 3
Forks: 8
Open Issues: 0
Requires
- d11wtq/boris: 1.*
Requires (Dev)
- mockery/mockery: ~0.9
- phpunit/phpunit: ~5.0
This package is not auto-updated.
Last update: 2024-11-23 15:01:19 UTC
README
Loads project specific contexts into d11wtq/boris REPL.
Currently supports Composer, Drupal, eZ Publish and Symfony.
Usage
The easiest (and recommended) way of using boris-loader is by hooking into Boris via your .borisrc
file, either in your $HOME
or your current working directory. Simply clone this repository somewhere and add the following lines to your .borisrc
.
<?php
require 'path/to/cloned/boris-loader.php';
\Boris\Loader\Loader::load($boris);
By default, boris-loader will try to load any Composer configuration it can find. If you are working with projects like Symfony or Drupal, you can have boris-loader look for and run their respective bootstrap.
<?php
require __DIR__.'/../../../../boris-loader.php';
\Boris\Loader\Loader::load($boris, array(
new \Boris\Loader\Provider\Symfony2(),
new \Boris\Loader\Provider\Composer(),
));
Providers
- Composer: \Boris\Loader\Provider\Composer().
- Drupal 7: \Boris\Loader\Provider\Drupal7().
- Drupal 8: \Boris\Loader\Provider\Drupal8().
- eZ Publish: \Boris\Loader\Provider\EzPublish().
- Symfony2: \Boris\Loader\Provider\Symfony2().
Symfony2 provider optional arguments
You can optionally pass the Symfony environment name and debug mode to the Symfony2 provider as arguments. The arguments default to 'dev' environment and true for debug mode.
<?php
require __DIR__.'/../../../../boris-loader.php';
\Boris\Loader\Loader::load($boris, array(
new \Boris\Loader\Provider\Symfony2('prod', false),
));
See this document for an example of using ENV vars to make this dynamic in your ~/.borisrc