Commit dc5c9ced authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

ménage future api

parent 70f5a81c
Loading
Loading
Loading
Loading
Loading

api/start.php

deleted100644 → 0
+0 −15
Original line number Diff line number Diff line
<?php

echo 'Aucune API disponible pour le moment';

// ajouter à composer (liste à revoir, en cours dev test):
/*
"api-platform/core"                : "4.1.15",
        "api-platform/metadata"            : "4.1.15",
        "api-platform/documentation"       : "*",
        "api-platform/doctrine-orm"        : "4.1.15",
        "phpdocumentor/reflection-docblock": "5.6.2",
        "symfony/property-info"            : "7.3.0",
        "symfony/routing"                  : "7.3.0",
        "symfony/validator"
*/
 No newline at end of file
+20 −15
Original line number Diff line number Diff line
@@ -3,8 +3,7 @@
declare(strict_types=1);

use Laminas\Mvc\Application;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
//use App\Kernel;

/**
 * This makes our life easier when dealing with paths. Everything is relative
@@ -28,9 +27,18 @@ if (php_sapi_name() === 'cli-server') {
    unset($path);
}

if (str_starts_with($_SERVER['REQUEST_URI'],'/api')){
//    require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

//    return function (array $context) {
//        return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
//    };
    die('Aucune API n\'existe pour le moment');
}else {
    // Composer autoloading
    include __DIR__ . '/../vendor/autoload.php';


    if (! class_exists(Application::class)) {
        throw new RuntimeException(
            "Unable to load application.\n"
@@ -41,9 +49,6 @@ if (! class_exists(Application::class)) {

    $container = require __DIR__ . '/../config/container.php';

if (str_starts_with($_SERVER['REQUEST_URI'],'/api')){
    require dirname(__DIR__) . '/api/start.php';
}else {
    // Run the application!
    /** @var Application $app */
    $app = $container->get('Application');