Merge pull request #10 from LeOSW42/copilot/improve-project-structure
Restructure MVC layout into public/src with Core/Thirds/Controllers/Models
8
.gitignore
vendored
@@ -1,7 +1,7 @@
|
|||||||
/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
|
||||||
|
|||||||
@@ -1 +1,10 @@
|
|||||||
[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/`)
|
||||||
|
- `Controllers/` : contrôleurs MVC backend (ancien `controllers/`)
|
||||||
|
- `Models/` : modèles MVC backend (ancien `models/`)
|
||||||
|
- `Thirds/` : dépendances tierces backend (ancien `third/`)
|
||||||
|
|||||||
@@ -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";
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
require_once __DIR__ . '/includes/config.php';
|
|
||||||
require_once __DIR__ . '/includes/routes.php';
|
|
||||||
4
public/index.php
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../src/Core/config.php';
|
||||||
|
require_once __DIR__ . '/../src/Core/routes.php';
|
||||||
@@ -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>
|
||||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 356 B After Width: | Height: | Size: 356 B |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 673 KiB After Width: | Height: | Size: 673 KiB |
|
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 708 KiB After Width: | Height: | Size: 708 KiB |
|
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 299 B |
|
Before Width: | Height: | Size: 420 B After Width: | Height: | Size: 420 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 696 B After Width: | Height: | Size: 696 B |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 618 B After Width: | Height: | Size: 618 B |