osotov / illuminate-for-bitrix
Adaptation of some Illuminate components for usage inside 1C-Bitrix framework
Requires
- php: >=5.5.9
- illuminate/container: 5.1.*
- illuminate/database: 5.1.*
- illuminate/events: 5.1.*
- illuminate/support: 5.1.*
This package is not auto-updated.
Last update: 2024-12-25 10:37:07 UTC
README
Adaptation of some Illuminate components for usage inside 1C-Bitrix framework
note
This package requires latest versions of php (>= 5.5.9).
installation
To install package, run the command below and you will get the latest version
composer require osotov/illuminate-for-bitrix
usage
Include Composer autoloader (/vendor/autoload.php) inside init.php file.
Instantiate bootstrapper class and use bootstrap method to initialize container.
$bootstrapper = new \Osotov\IlluminateForBitrix\Bootstrapper(); $bootstrapper->bootstrap();
Now you are able to get container instance from any code executed after init.php.
$container = \Osotov\IlluminateForBitrix\Container::getContainer();
If you want to register service provider class pass its instance to registerServiceProviders method.
$serviceProvider = new MyServiceProvider(); $bootstrapper->registerServiceProviders($serviceProvider);
If you want to use Eloquent use addDbConnection method. By default it uses Bitrix connection credentials. If you want to use different connection pass array with credentials as argument.
$bootstrapper->addDbConnection();