PHP code example of pixelbrackets / application-context

1. Go to this page and download the library: Download pixelbrackets/application-context 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/ */

    

pixelbrackets / application-context example snippets


if($applicationContext->isDevelopment()) {
    // … do this in development mode only
}

   $applicationContext = new \Pixelbrackets\ApplicationContext\ApplicationContext(getenv('APPLICATION_CONTEXT'));
   

   $config['write-logs'] = true;
   $config['mail']['to'] = '[email protected]';
   if($applicationContext->isDevelopment()) {
       $config['mail']['to'] = '[email protected]';
   }
   

   $configFile = __DIR__ . '/Configuration/' . (string)$applicationContext . '.php';
   if (file_exists($configFile)) {
     
bash
   APPLICATION_CONTEXT=Development php index.php