| 1 | 
           efrain | 
           1 | 
           <?php
  | 
        
        
            | 
            | 
           2 | 
              | 
        
        
            | 
            | 
           3 | 
           declare(strict_types=1);
  | 
        
        
            | 
            | 
           4 | 
              | 
        
        
           | 288 | 
           www | 
           5 | 
           ini_set('curl.cainfo', '/etc/apache2/ssl/cacert.pem');
  | 
        
        
           | 9 | 
           efrain | 
           6 | 
              | 
        
        
           | 288 | 
           www | 
           7 | 
              | 
        
        
           | 1 | 
           efrain | 
           8 | 
           use Laminas\Mvc\Application;
  | 
        
        
            | 
            | 
           9 | 
           use Laminas\Stdlib\ArrayUtils;
  | 
        
        
            | 
            | 
           10 | 
              | 
        
        
           | 42 | 
           efrain | 
           11 | 
              | 
        
        
            | 
            | 
           12 | 
              | 
        
        
           | 1 | 
           efrain | 
           13 | 
           /**
  | 
        
        
            | 
            | 
           14 | 
            * This makes our life easier when dealing with paths. Everything is relative
  | 
        
        
            | 
            | 
           15 | 
            * to the application root now.
  | 
        
        
            | 
            | 
           16 | 
            */
  | 
        
        
            | 
            | 
           17 | 
           chdir(dirname(__DIR__));
  | 
        
        
            | 
            | 
           18 | 
              | 
        
        
            | 
            | 
           19 | 
           // Decline static file requests back to the PHP built-in webserver
  | 
        
        
            | 
            | 
           20 | 
           if (php_sapi_name() === 'cli-server') {
  | 
        
        
            | 
            | 
           21 | 
               $path = realpath(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
  | 
        
        
            | 
            | 
           22 | 
               if (is_string($path) && __FILE__ !== $path && is_file($path)) {
  | 
        
        
            | 
            | 
           23 | 
                   return false;
  | 
        
        
            | 
            | 
           24 | 
               }
  | 
        
        
            | 
            | 
           25 | 
               unset($path);
  | 
        
        
            | 
            | 
           26 | 
           }
  | 
        
        
            | 
            | 
           27 | 
              | 
        
        
            | 
            | 
           28 | 
           // Composer autoloading
  | 
        
        
            | 
            | 
           29 | 
           include __DIR__ . '/../vendor/autoload.php';
  | 
        
        
            | 
            | 
           30 | 
              | 
        
        
            | 
            | 
           31 | 
           if (! class_exists(Application::class)) {
  | 
        
        
            | 
            | 
           32 | 
               throw new RuntimeException(
  | 
        
        
            | 
            | 
           33 | 
                   "Unable to load application.\n"
  | 
        
        
            | 
            | 
           34 | 
                   . "- Type `composer install` if you are developing locally.\n"
  | 
        
        
            | 
            | 
           35 | 
                   . "- Type `vagrant ssh -c 'composer install'` if you are using Vagrant.\n"
  | 
        
        
            | 
            | 
           36 | 
                   . "- Type `docker-compose run lamians composer install` if you are using Docker.\n"
  | 
        
        
            | 
            | 
           37 | 
               );
  | 
        
        
            | 
            | 
           38 | 
           }
  | 
        
        
            | 
            | 
           39 | 
              | 
        
        
            | 
            | 
           40 | 
           // Retrieve configuration
  | 
        
        
            | 
            | 
           41 | 
           $appConfig = require __DIR__ . '/../config/application.config.php';
  | 
        
        
            | 
            | 
           42 | 
           if (file_exists(__DIR__ . '/../config/development.config.php')) {
  | 
        
        
            | 
            | 
           43 | 
               $appConfig = ArrayUtils::merge($appConfig, require __DIR__ . '/../config/development.config.php');
  | 
        
        
            | 
            | 
           44 | 
           }
  | 
        
        
            | 
            | 
           45 | 
              | 
        
        
            | 
            | 
           46 | 
           // Run the application!
  | 
        
        
            | 
            | 
           47 | 
           Application::init($appConfig)->run();
  |