Restructure MVC into public/src layout

Co-authored-by: LeOSW42 <673670+LeOSW42@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-24 14:00:58 +00:00
parent 1be6b7ff0c
commit f617ecb350
135 changed files with 75 additions and 63 deletions

10
.gitignore vendored
View File

@@ -1,8 +1,8 @@
/includes/config.php /src/Core/config.php
/medias/* /public/medias/*
/_maps /public/_maps
_ressources/dump.sql /public/_ressources/dump.sql
*.sublime-project *.sublime-project
*.sublime-workspace *.sublime-workspace
*.log *.log
/tmp/* /tmp/*

View File

@@ -1 +1,8 @@
[Kabano website](https://kabano.org/) [Kabano website](https://kabano.org/)
## Arborescence
- `public/` : assets frontend et point d'entrée web (`index.php`, `views/`, `_ressources/`)
- `src/` : code backend commun
- `Core/` : configuration et utilitaires communs (ancien `includes/`)
- `Thirds/` : dépendances tierces backend (ancien `third/`)

View File

@@ -1,50 +0,0 @@
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
locale_set_default("fr_FR");
date_default_timezone_set("UTC"); // Default tz for date manipulation is UTC. Display tz is in session.php
/*****
** Management of folder names
*****/
// It is the include folder name
$config['include_folder']=basename(__DIR__);
// This is the absolute folder to the root of the website
$config['abs_root_folder']=str_replace($config['include_folder'],"",__DIR__);
// This is the relative folder to the root of the website from the DocumentRoot (can also be called subfolder)
$config['rel_root_folder']=str_replace($_SERVER['DOCUMENT_ROOT'],"",$config['abs_root_folder']);
$config['web_root_folder']="https://kabano.test/";
if($config['rel_root_folder']=="") $config['rel_root_folder']="/";
// Here all the absolute paths to specific folders
$config['views_folder'] = $config['abs_root_folder']."views/";
$config['controllers_folder'] = $config['abs_root_folder']."controllers/";
$config['models_folder'] = $config['abs_root_folder']."models/";
$config['medias_folder'] = $config['abs_root_folder']."medias/";
$config['includes_folder'] = $config['abs_root_folder']."includes/";
$config['third_folder'] = $config['abs_root_folder']."third/";
$config['logs_folder'] = $config['abs_root_folder']."logs/";
// Here all the relative url to specific folders
$config['views_url'] = $config['rel_root_folder']."views/";
/*****
** SQL Database configuration
*****/
$config['SQL_host'] = "localhost";
$config['SQL_user'] = "kabano";
$config['SQL_pass'] = "PASSWORD";
$config['SQL_db'] = "postgres";
/*****
** Mail configuration
*****/
$config['admin_mail'] = "leo@lstronic.com";
$config['bot_mail'] = "robot@kabano.com";

View File

@@ -1,4 +0,0 @@
<?php
require_once __DIR__ . '/includes/config.php';
require_once __DIR__ . '/includes/routes.php';

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

4
public/index.php Executable file
View File

@@ -0,0 +1,4 @@
<?php
require_once __DIR__ . '/../src/Core/config.php';
require_once __DIR__ . '/../src/Core/routes.php';

View File

@@ -19,7 +19,7 @@ echo ('<?xml version="1.0" encoding="UTF-8"?>'); ?>
<description>L'actualité du blog officiel de Kabano : Plateforme collaborative de recensement de cabanes et refuges.</description> <description>L'actualité du blog officiel de Kabano : Plateforme collaborative de recensement de cabanes et refuges.</description>
<language>fr</language> <language>fr</language>
<image> <image>
<url><?=$config['web_root_folder']?>views/img/header_rss.svg</url> <url><?=$config['web_root_folder']?>public/views/img/header_rss.svg</url>
<title>Kabano</title> <title>Kabano</title>
<link><?=$config['web_root_folder']?></link> <link><?=$config['web_root_folder']?></link>
<height>44</height> <height>44</height>
@@ -42,4 +42,4 @@ echo ('<?xml version="1.0" encoding="UTF-8"?>'); ?>
</channel> </channel>
</rss> </rss>

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 356 B

After

Width:  |  Height:  |  Size: 356 B

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 673 KiB

After

Width:  |  Height:  |  Size: 673 KiB

View File

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 139 KiB

View File

Before

Width:  |  Height:  |  Size: 708 KiB

After

Width:  |  Height:  |  Size: 708 KiB

View File

Before

Width:  |  Height:  |  Size: 299 B

After

Width:  |  Height:  |  Size: 299 B

View File

Before

Width:  |  Height:  |  Size: 420 B

After

Width:  |  Height:  |  Size: 420 B

Some files were not shown because too many files have changed in this diff Show More