PluginProbe
Packeta / 2.1
Packeta v2.1
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
← All changes | bootstrap.php +26 -9 1.5.32.1 View file →
@@ -5,31 +5,48 @@
5 5 * @package Packeta
6 6 */
7 7
8 8 use Packetery\Module\CompatibilityBridge;
9 -use Packetery\Module\Helper;
10 9 use Packetery\Module\WpdbTracyPanel;
11 -use PacketeryNette\Bootstrap\Configurator;
12 -use PacketeryTracy\Debugger;
10 +use Packetery\Nette\Bootstrap\Configurator;
11 +use Packetery\Nette\Http\RequestFactory;
12 +use Packetery\Nette\InvalidStateException;
13 +use Packetery\Tracy\Debugger;
13 14
14 -defined( 'PACKETERY_PLUGIN_DIR' ) || define( 'PACKETERY_PLUGIN_DIR', __DIR__ );
15 -defined( 'PACKETERY_DEBUG' ) || define( 'PACKETERY_DEBUG', false );
15 +require_once __DIR__ . '/constants.php';
16 16
17 -require_once __DIR__ . '/packetery_vendor/autoload.php';
17 +require_once __DIR__ . '/deps/scoper-autoload.php';
18 18
19 -require_once __DIR__ . '/src/Packetery/Module/Helper.php';
20 -Helper::transformGlobalCookies();
19 +$disableGetPostCookieParsing = false;
20 +if ( PHP_SAPI !== 'cli' ) {
21 + try {
22 + ( new RequestFactory() )->fromGlobals();
23 + } catch ( InvalidStateException $invalidStateException ) {
24 + $disableGetPostCookieParsing = true;
25 + }
26 +}
21 27
22 28 $configurator = new Configurator();
29 +$configurator->addDynamicParameters(
30 + [
31 + 'disableGetPostCookieParsing' => $disableGetPostCookieParsing,
32 + ]
33 +);
23 34 $configurator->setDebugMode( PACKETERY_DEBUG );
24 35
25 36 Debugger::$logDirectory = PACKETERY_PLUGIN_DIR . '/log';
26 -if ( PACKETERY_DEBUG && false === wp_doing_cron() ) {
37 +if ( $configurator->isDebugMode() && wp_doing_cron() === false ) {
27 38 $configurator->enableDebugger( Debugger::$logDirectory );
28 39 Debugger::$strictMode = false;
29 40 }
30 41
31 42 $configurator->addConfig( __DIR__ . '/config/config.neon' );
43 +
44 +$localConfigFile = __DIR__ . '/config/config.local.neon';
45 +if ( file_exists( $localConfigFile ) ) {
46 + $configurator->addConfig( $localConfigFile ); // Local Development ENV only!
47 +}
48 +
32 49 $configurator->setTempDirectory( __DIR__ . '/temp' );
33 50 $configurator->createRobotLoader()->addDirectory( __DIR__ . '/src' )->setAutoRefresh( false )->register();
34 51
35 52 $configurator->defaultExtensions = [];