initialize Project
This commit is contained in:
3
backend/app/public/.htaccess
Normal file
3
backend/app/public/.htaccess
Normal file
@ -0,0 +1,3 @@
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^ index.php [QSA,L]
|
||||
67
backend/app/public/index.php
Normal file
67
backend/app/public/index.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
$domain = '.lxdapp.local'; // Leading dot is important for subdomain support
|
||||
session_set_cookie_params([
|
||||
'lifetime' => 0,
|
||||
'path' => '/',
|
||||
'domain' => $domain,
|
||||
'secure' => false, // set true if using HTTPS
|
||||
'httponly' => true,
|
||||
'samesite' => 'Lax',
|
||||
]);
|
||||
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
use DI\ContainerBuilder;
|
||||
use Slim\Factory\AppFactory;
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', '1');
|
||||
|
||||
// Build Container using PHP-DI
|
||||
$containerBuilder = new ContainerBuilder();
|
||||
$containerBuilder->useAutowiring(true); // Enable autowiring globally
|
||||
|
||||
|
||||
// Add settings
|
||||
$settings = require __DIR__ . '/../src/Settings/settings.php';
|
||||
$settings($containerBuilder);
|
||||
|
||||
// Add dependencies
|
||||
$dependencies = require __DIR__ . '/../src/Dependencies/dependencies.php';
|
||||
$dependencies($containerBuilder);
|
||||
|
||||
// Build the container
|
||||
$container = $containerBuilder->build();
|
||||
|
||||
// Set container to AppFactory
|
||||
AppFactory::setContainer($container);
|
||||
|
||||
// Create App
|
||||
$app = AppFactory::create();
|
||||
|
||||
$app->add(function ($request, $handler) {
|
||||
$response = $handler->handle($request);
|
||||
|
||||
// $origin = $request->getHeaderLine('Origin') ?: '*';
|
||||
$origin = $_SERVER['HTTP_ORIGIN'] ?? '*';
|
||||
return $response
|
||||
->withHeader('Access-Control-Allow-Origin', $origin)
|
||||
->withHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization')
|
||||
->withHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE, OPTIONS')
|
||||
->withHeader('Access-Control-Allow-Credentials', 'true');
|
||||
});
|
||||
|
||||
|
||||
// Register middleware
|
||||
(require __DIR__ . '/../src/Bootstrap/middleware.php')($app);
|
||||
|
||||
// Register routes
|
||||
(require __DIR__ . '/../src/Bootstrap/routes.php')($app);
|
||||
|
||||
// Run app
|
||||
$app->run();
|
||||
9
backend/app/public/last-access-logs/container-mitul.txt
Normal file
9
backend/app/public/last-access-logs/container-mitul.txt
Normal file
@ -0,0 +1,9 @@
|
||||
2025-07-08 13:07:05 : http://10.110.90.30:80
|
||||
2025-07-08 13:29:10 : http://10.110.90.30:80
|
||||
2025-07-08 14:43:45 : http://10.110.90.144:80
|
||||
2025-07-08 14:50:28 : http://10.110.90.89:80
|
||||
2025-07-08 14:53:41 : http://10.110.90.89:80
|
||||
2025-07-08 15:07:07 : http://10.110.90.95:80
|
||||
2025-07-08 15:12:49 : http://10.110.90.95:80
|
||||
2025-07-08 15:23:59 : http://10.110.90.147:80
|
||||
2025-07-08 15:24:26 : http://10.110.90.147:80
|
||||
Reference in New Issue
Block a user