Proyectos de Subversion LeadersLinked - Services

Rev

Rev 9 | Rev 38 | 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
//define('DIR_URL', dirname(__DIR__));
10
//define('SITE_URL',  'http://'  . $_SERVER['SERVER_NAME'] . '/');
11
//date_default_timezone_set('Etc/GMT+6');
12
 
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();