Proyectos de Subversion LeadersLinked - Services

Rev

Rev 40 | Rev 42 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

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