| 1 |
<?php |
| 2 |
/** |
| 3 |
* Packeta bootstrap. |
| 4 |
* |
| 5 |
* @package Packeta |
| 6 |
*/ |
| 7 |
|
| 8 |
use Packetery\Module\CompatibilityBridge; |
| 9 |
use PacketeryNette\Bootstrap\Configurator; |
| 10 |
|
| 11 |
defined( 'PACKETERY_PLUGIN_DIR' ) || define( 'PACKETERY_PLUGIN_DIR', __DIR__ ); |
| 12 |
defined( 'PACKETERY_DEBUG' ) || define( 'PACKETERY_DEBUG', false ); |
| 13 |
|
| 14 |
require_once __DIR__ . '/packetery_vendor/autoload.php'; |
| 15 |
|
| 16 |
$configurator = new Configurator(); |
| 17 |
$configurator->setDebugMode( PACKETERY_DEBUG ); |
| 18 |
|
| 19 |
if ( PACKETERY_DEBUG ) { |
| 20 |
$configurator->enableDebugger( PACKETERY_PLUGIN_DIR . '/log' ); |
| 21 |
} |
| 22 |
|
| 23 |
$configurator->addConfig( __DIR__ . '/config/config.neon' ); |
| 24 |
$configurator->setTempDirectory( __DIR__ . '/temp' ); |
| 25 |
$configurator->createRobotLoader()->addDirectory( __DIR__ . '/src' )->register(); |
| 26 |
|
| 27 |
$configurator->defaultExtensions = []; |
| 28 |
|
| 29 |
$container = $configurator->createContainer(); |
| 30 |
CompatibilityBridge::setContainer( $container ); |
| 31 |
|
| 32 |
return $container; |
| 33 |
|