1. Go to this page and download the library: Download redbitcz/debug-mode-enabler library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$debugModeDetector = new \Redbitcz\DebugMode\Detector();
$configurator = new Configurator();
$configurator->setDebugMode($debugModeDetector->isDebugMode());
$enabler = new \Redbitcz\DebugMode\Enabler($tempDir);
$detector = new \Redbitcz\DebugMode\Detector(\Redbitcz\DebugMode\Detector::MODE_FULL, $enabler);
$enabler->activate(true);
$tempDir = __DIR__ . '/../temp';
$enabler = new \Redbitcz\DebugMode\Enabler($tempDir);
$debugModeDetector = new \Redbitcz\DebugMode\Detector(\Redbitcz\DebugMode\Detector::MODE_FULL, $enabler);
$configurator = new Configurator();
$configurator->setDebugMode($debugModeDetector->isDebugMode());
$configurator->addServices(['debugModeEnabler' => $debugModeDetector->getEnabler()]);
if (…) {
return true;
} else {
return false;
}
if (…) {
return true;
} else {
return null;
}
$detector = new \Redbitcz\DebugMode\Detector();
$plugin = new MyPlugin();
$detector->appendPlugin($plugin);
$detector->isDebugMode(); // <---- this invoke all Plugins