codeigniter example

/** * Prepare for debugging.. * * @return void */
    public function prepare(?RequestInterface $request = null, ?ResponseInterface $response = null)
    {
        /** * @var IncomingRequest|null $request */
        if (CI_DEBUG && ! is_cli()) {
            $app = Services::codeigniter();

            $request ??= Services::request();
            $response ??= Services::response();

            // Disable the toolbar for downloads             if ($response instanceof DownloadResponse) {
                return;
            }

            $toolbar = Services::toolbar(config(ToolbarConfig::class));
            $stats   = $app->getPerformanceStats();
            

/* * --------------------------------------------------------------- * GRAB OUR CODEIGNITER INSTANCE * --------------------------------------------------------------- * * The CodeIgniter class contains the core functionality to make * the application run, and does all the dirty work to get * the pieces all working together. */

$app = Config\Services::codeigniter();
$app->initialize();
$context = is_cli() ? 'php-cli' : 'web';
$app->setContext($context);

/* *--------------------------------------------------------------- * LAUNCH THE APPLICATION *--------------------------------------------------------------- * Now that everything is set up, it's time to actually fire * up the engines and make this app do its thang. */

Home | Imprint | This part of the site doesn't use cookies.