Proyectos de Subversion LeadersLinked - Services

Rev

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