Proyectos de Subversion LeadersLinked - Services

Rev

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