Proyectos de Subversion LeadersLinked - Services

Rev

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