diff --git a/.drone.yml b/.drone.yml
new file mode 100644
index 00000000..53acd087
--- /dev/null
+++ b/.drone.yml
@@ -0,0 +1,114 @@
+kind: pipeline
+type: docker
+name: HeartWave
+
+# dev is DMZ
+
+trigger:
+ event:
+ - push
+
+steps:
+ - name: test
+ image: php:7.4
+ commands:
+ - cd Sources
+ # Installe les dépendances PHP si nécessaire
+ - composer install
+ # - composer require phpunit/phpunit
+ - vendor/bin/phpunit common/Tests
+
+ # build CONTAINER for app-build on flutter IMAGE
+ - name: docker-build
+ build: Sources/src/config
+ ports:
+ - "8080:80"
+ volumes:
+ - ./php/vhosts:/etc/apache2/sites-enabled
+ - ./:/var/www
+ restart: always
+
+ - name: code-analysis
+ image: #####
+ environment:
+ SONAR_TOKEN:
+ from_secret: SONAR_TOKEN
+ commands:
+ - export SONAR_SCANNER_VERSION=4.7.0.2747
+ - export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
+ - curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
+ - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
+ - export PATH=$SONAR_SCANNER_HOME/bin:$PATH
+ - export SONAR_SCANNER_OPTS="-server"
+ - sonar-scanner -D sonar.projectKey=Bowl_in -D sonar.sources=./Sources/bowlin_project -D sonar.host.url=https://codefirst.iut.uca.fr/sonar -D sonar.flutter.coverage.reportPath=./Sources/bowlin_project/coverage/lcov.info
+ depends_on: [ test ]
+
+
+ # database container deployment
+ - name: container-mysql
+ image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
+ volumes:
+ - db-data:/var/lib/mysql
+ environment:
+ IMAGENAME: mariadb:10
+ CONTAINERNAME: mysql
+ COMMAND: create
+ # OVERWRITE: false
+ # should be true
+ PRIVATE: false
+ CODEFIRST_CLIENTDRONE_ENV_MARIADB_ROOT_PASSWORD:
+ from_secret: db_root_password
+ CODEFIRST_CLIENTDRONE_ENV_MARIADB_DATABASE:
+ from_secret: db_database
+ CODEFIRST_CLIENTDRONE_ENV_MARIADB_USER:
+ from_secret: db_user
+ CODEFIRST_CLIENTDRONE_ENV_MARIADB_PASSWORD:
+ from_secret: db_password
+ ADMINS: antoineperederii,antoinepinagot,kevinmonteiro,paullevrault,davidd_almeida
+
+ - name: phpmyadmin-container
+ # should find a goog version
+ image: phpmyadmin
+ restart: always
+ ports:
+ - 8082:80
+ environment:
+ PMA_HOST: container-mysql
+ depends_on:
+ -container-mysql
+ networks:
+ - admin
+
+
+ - name: docker-push
+ image: plugins/docker
+ settings:
+ username:
+ from_secret: DOCKER_USERNAME
+ password:
+ from_secret: DOCKER_PASSWORD
+ repo: myusername/my-php-app
+ tags: latest
+ auto_tag: true
+ registry: docker.io
+
+ - name: deploy-container
+ image: docker
+ commands:
+ - docker stop my-php-container || true
+ - docker rm my-php-container || true
+ - docker run -d --name my-php-container -p 80:80 myusername/my-php-app
+ - name: notify
+ image: ruby:2.1
+ rules:
+ - if: "$CI_COMMIT_TAG =~ /^.*-demo$/"
+ when: on_success
+ script:
+ - sh ./notifymail.sh
+
+volumes:
+ db-data:
+
+networks:
+ admin:
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..becd7966
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,24 @@
+.idea
+node_modules
+.vscode
+*.swp
+*.swo
+.env
+# Cache files for Sublime Text
+*.tmlanguage.cache
+*.tmPreferences.cache
+*.stTheme.cache
+
+# Workspace files are user-specific
+*.sublime-workspace
+
+# Project files should be checked into the repository, unless a significant
+# proportion of contributors will probably not be using Sublime Text
+*.sublime-project
+
+# SFTP configuration file
+sftp-config.json
+sftp-config-alt*.json
+
+*.log*
+coverage/
diff --git a/Documents/Images/Gitflow.png b/Documents/Images/Gitflow.png
new file mode 100644
index 00000000..b420e7ee
Binary files /dev/null and b/Documents/Images/Gitflow.png differ
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..ad14a470
--- /dev/null
+++ b/README.md
@@ -0,0 +1,93 @@
+# HeartTrack
+
+## Présentation
+
+**Nom de l'application :** HeartTrack
+
+### Contexte
+
+HeartTrack est une application web PHP et mobile Android destinée aux sportifs pour l'analyse de courbes cardiaques. L'objectif principal de cette application est de récupérer les données de fréquence cardiaque à partir d'une montre, de les afficher sous forme de courbes, d'identifier des patterns, de fournir des statistiques et de réaliser des prédictions liées à l'effort physique, à la chaleur, à la récupération, etc.
+
+## Récapitulatif du Projet
+
+Le projet HeartTrack, avec son application HeartTrack, vise à offrir une solution complète pour l'analyse des données de fréquence cardiaque, en mettant l'accent sur les besoins des sportifs. L'application sera capable de traiter et d'interpréter les données de manière intelligente, fournissant ainsi des informations précieuses pour optimiser les performances sportives et la santé.
+
+## Répartition du Git
+
+[**Sources**](Sources) : **Code de l'application**
+
+[**Documents**](Documents) : **Documentation de l'application**
+
+--
+
+
+
+Le projet HeartTrack utilise un modèle de flux de travail Git (Gitflow) pour organiser le développement. Voici une brève explication des principales branches :
+
+- **branche prod** : Cette branche contient la version de production stable de l'application. Les modifications sur cette branche sont généralement destinées à des mises en production.
+
+- **branche master** : La branche master est similaire à la branche de production, mais elle peut contenir des fonctionnalités en cours de développement qui sont presque prêtes pour une mise en production.
+
+- **branche test** : Cette branche est utilisée pour déployer une version démo de l'application. Elle est mise à jour avec les dernières fonctionnalités et surtout la totalité de leurs test en développement.
+
+- **branche issue** : Pour chaque problème (issue) que vous résolvez, vous devez créer une branche portant le nom de l'issue, par exemple, "issue_#32_nom" où 32 est le numéro de l'issue et nom est une description courte de l'issue. Une fois l'issue résolue, assurez-vous de mettre à jour le changelog et de créer une merge request.
+
+
+## Développement
+
+### Travailler sur une Issue
+
+Si vous êtes amené à travailler sur une issue, suivez ces principes :
+
+1. Les issues sont créées dans le système de gestion de versions (Git), chaque issue ayant un numéro unique.
+
+2. Lorsque vous décidez de travailler sur une issue, attribuez-vous l'issue et créez une branche avec un nom correspondant à l'issue sous la forme suivante : "issue_#32_nom" où 32 est le numéro de l'issue et nom est son libellé.
+
+3. Une fois que vous avez résolu l'issue dans votre branche, assurez-vous de mettre à jour le changelog avec les modifications apportées.
+
+4. Ensuite, poussez votre branche sur le référentiel distant et créez une merge request pour que vos modifications soient examinées par les autres membres de l'équipe.
+
+## Prérequis
+
+Avant de commencer à travailler sur le projet HeartTrack, assurez-vous d'avoir les prérequis suivants installés :
+
+- Serveur web (par exemple, Apache)
+- PHP (version recommandée)
+- Base de données (par exemple, MySQL)
+- Git
+
+## Installation
+
+Pour installer et exécuter le projet HeartTrack, suivez ces étapes :
+
+1. Clonez ce référentiel sur votre machine locale en utilisant la commande suivante :
+ `git clone https://codefirst.iut.uca.fr/git/FitDev/Projet_fit_web`
+
+2. Configurez votre environnement de développement avec les prérequis mentionnés ci-dessus.
+
+3. Copiez le fichier de configuration d'exemple et configurez les paramètres de l'application :
+
+cp config/config.example.php config/config.php
+
+4. Importez la structure de la base de données à partir du fichier SQL fourni :
+
+mysql -u votre_nom_utilisateur -p < db_schema.sql
+
+
+5. Démarrez votre serveur web et accédez à l'application via le navigateur.
+
+## Exécution
+
+Pour exécuter l'application, suivez les instructions d'installation ci-dessus. Une fois l'application configurée et le serveur web en cours d'exécution, accédez à l'application via votre navigateur web.
+
+## Déploiement en Démo
+
+Pour déployer une version de démonstration de l'application, utilisez la branche "demo" du référentiel. Cette branche est généralement mise à jour avec les dernières fonctionnalités en développement.
+
+## Déploiement en Production
+
+Pour déployer la version de production de l'application, utilisez la branche "prod" du référentiel.
+
+---
+
+N'hésitez pas à contribuer au développement de HeartTrack en résolvant des issues ou en ajoutant de nouvelles fonctionnalités. Nous vous encourageons à suivre les principes et les pratiques décrites dans ce document pour un développement efficace et collaboratif.
\ No newline at end of file
diff --git a/Sources/.dockerignore b/Sources/.dockerignore
new file mode 100644
index 00000000..365317ad
--- /dev/null
+++ b/Sources/.dockerignore
@@ -0,0 +1,3 @@
+vendor/
+node_modules/
+.env
diff --git a/Sources/.env.test b/Sources/.env.test
new file mode 100644
index 00000000..e69de29b
diff --git a/Sources/composer.json b/Sources/composer.json
new file mode 100644
index 00000000..e69de29b
diff --git a/Sources/config/Dockerfile b/Sources/config/Dockerfile
new file mode 100644
index 00000000..ece7cbf8
--- /dev/null
+++ b/Sources/config/Dockerfile
@@ -0,0 +1,17 @@
+# Utilisez une image de base PHP
+FROM php:7.4-apache
+
+# Définissez le répertoire de travail dans le conteneur
+WORKDIR /var/www/
+
+# Copiez les fichiers de votre projet dans le conteneur
+COPY . /var/www/
+
+# Installez les dépendances PHP (par exemple, si vous utilisez Composer)
+RUN composer install
+
+# Exposez le port 80 (port par défaut d'Apache)
+EXPOSE 80
+
+# Commande pour démarrer Apache (vous pouvez également utiliser d'autres serveurs web comme Nginx)
+CMD ["apache2-foreground"]
diff --git a/Sources/config/config.php b/Sources/config/config.php
new file mode 100644
index 00000000..fa498fc1
--- /dev/null
+++ b/Sources/config/config.php
@@ -0,0 +1,11 @@
+ should use .env var
+const DB_HOST = 'londres';
+const DB_DATABASE = 'dbdadalmeida1';
+const DB_USER = 'dadalmeida1';
+const DB_PASSWORD = 'achanger';
+$dsn ='mysql:host=londres.uca.local;dbname=dbdadalmeida1';
+
+
+const VIEW_PATH = 'views';
diff --git a/Sources/index.php b/Sources/index.php
new file mode 100644
index 00000000..e69de29b
diff --git a/Sources/src/core/network/service/AuthService.php b/Sources/src/core/network/service/AuthService.php
new file mode 100644
index 00000000..e69de29b
diff --git a/Sources/src/core/network/service/IAuthService.php b/Sources/src/core/network/service/IAuthService.php
new file mode 100644
index 00000000..e69de29b
diff --git a/Sources/src/core/stub/ActivitiesManager.php b/Sources/src/core/stub/ActivitiesManager.php
new file mode 100644
index 00000000..e69de29b
diff --git a/Sources/src/core/stub/StubData.php b/Sources/src/core/stub/StubData.php
new file mode 100644
index 00000000..6c3b525f
--- /dev/null
+++ b/Sources/src/core/stub/StubData.php
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/Sources/src/core/stub/UserManager.php b/Sources/src/core/stub/UserManager.php
new file mode 100644
index 00000000..4ea60ce6
--- /dev/null
+++ b/Sources/src/core/stub/UserManager.php
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/Sources/src/shared/router/AltoRouter.php b/Sources/src/shared/router/AltoRouter.php
new file mode 100644
index 00000000..31aa3381
--- /dev/null
+++ b/Sources/src/shared/router/AltoRouter.php
@@ -0,0 +1,302 @@
+
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+class AltoRouter
+{
+
+ /**
+ * @var array Array of all routes (incl. named routes).
+ */
+ protected $routes = [];
+
+ /**
+ * @var array Array of all named routes.
+ */
+ protected $namedRoutes = [];
+
+ /**
+ * @var string Can be used to ignore leading part of the Request URL (if main file lives in subdirectory of host)
+ */
+ protected $basePath = '';
+
+ /**
+ * @var array Array of default match types (regex helpers)
+ */
+ protected $matchTypes = [
+ 'i' => '[0-9]++',
+ 'a' => '[0-9A-Za-z]++',
+ 'h' => '[0-9A-Fa-f]++',
+ '*' => '.+?',
+ '**' => '.++',
+ '' => '[^/\.]++'
+ ];
+
+ /**
+ * Create router in one call from config.
+ *
+ * @param array $routes
+ * @param string $basePath
+ * @param array $matchTypes
+ * @throws Exception
+ */
+ public function __construct(array $routes = [], $basePath = '', array $matchTypes = [])
+ {
+ $this->addRoutes($routes);
+ $this->setBasePath($basePath);
+ $this->addMatchTypes($matchTypes);
+ }
+
+ /**
+ * Retrieves all routes.
+ * Useful if you want to process or display routes.
+ * @return array All routes.
+ */
+ public function getRoutes()
+ {
+ return $this->routes;
+ }
+
+ /**
+ * Add multiple routes at once from array in the following format:
+ *
+ * $routes = [
+ * [$method, $route, $target, $name]
+ * ];
+ *
+ * @param array $routes
+ * @return void
+ * @author Koen Punt
+ * @throws Exception
+ */
+ public function addRoutes($routes)
+ {
+ if (!is_array($routes) && !$routes instanceof Traversable) {
+ throw new RuntimeException('Routes should be an array or an instance of Traversable');
+ }
+ foreach ($routes as $route) {
+ call_user_func_array([$this, 'map'], $route);
+ }
+ }
+
+ /**
+ * Set the base path.
+ * Useful if you are running your application from a subdirectory.
+ * @param string $basePath
+ */
+ public function setBasePath($basePath)
+ {
+ $this->basePath = $basePath;
+ }
+
+ /**
+ * Add named match types. It uses array_merge so keys can be overwritten.
+ *
+ * @param array $matchTypes The key is the name and the value is the regex.
+ */
+ public function addMatchTypes(array $matchTypes)
+ {
+ $this->matchTypes = array_merge($this->matchTypes, $matchTypes);
+ }
+
+ /**
+ * Map a route to a target
+ *
+ * @param string $method One of 5 HTTP Methods, or a pipe-separated list of multiple HTTP Methods (GET|POST|PATCH|PUT|DELETE)
+ * @param string $route The route regex, custom regex must start with an @. You can use multiple pre-set regex filters, like [i:id]
+ * @param mixed $target The target where this route should point to. Can be anything.
+ * @param string $name Optional name of this route. Supply if you want to reverse route this url in your application.
+ * @throws Exception
+ */
+ public function map($method, $route, $target, $name = null)
+ {
+
+ $this->routes[] = [$method, $route, $target, $name];
+
+ if ($name) {
+ if (isset($this->namedRoutes[$name])) {
+ throw new RuntimeException("Can not redeclare route '{$name}'");
+ }
+ $this->namedRoutes[$name] = $route;
+ }
+
+ return;
+ }
+
+ /**
+ * Reversed routing
+ *
+ * Generate the URL for a named route. Replace regexes with supplied parameters
+ *
+ * @param string $routeName The name of the route.
+ * @param array @params Associative array of parameters to replace placeholders with.
+ * @return string The URL of the route with named parameters in place.
+ * @throws Exception
+ */
+ public function generate($routeName, array $params = [])
+ {
+
+ // Check if named route exists
+ if (!isset($this->namedRoutes[$routeName])) {
+ throw new RuntimeException("Route '{$routeName}' does not exist.");
+ }
+
+ // Replace named parameters
+ $route = $this->namedRoutes[$routeName];
+
+ // prepend base path to route url again
+ $url = $this->basePath . $route;
+
+ if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
+ foreach ($matches as $index => $match) {
+ list($block, $pre, $type, $param, $optional) = $match;
+
+ if ($pre) {
+ $block = substr($block, 1);
+ }
+
+ if (isset($params[$param])) {
+ // Part is found, replace for param value
+ $url = str_replace($block, $params[$param], $url);
+ } elseif ($optional && $index !== 0) {
+ // Only strip preceding slash if it's not at the base
+ $url = str_replace($pre . $block, '', $url);
+ } else {
+ // Strip match block
+ $url = str_replace($block, '', $url);
+ }
+ }
+ }
+
+ return $url;
+ }
+
+ /**
+ * Match a given Request Url against stored routes
+ * @param string $requestUrl
+ * @param string $requestMethod
+ * @return array|boolean Array with route information on success, false on failure (no match).
+ */
+ public function match($requestUrl = null, $requestMethod = null)
+ {
+
+ $params = [];
+
+ // set Request Url if it isn't passed as parameter
+ if ($requestUrl === null) {
+ $requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
+ }
+
+ // strip base path from request url
+ $requestUrl = substr($requestUrl, strlen($this->basePath));
+
+ // Strip query string (?a=b) from Request Url
+ if (($strpos = strpos($requestUrl, '?')) !== false) {
+ $requestUrl = substr($requestUrl, 0, $strpos);
+ }
+
+ $lastRequestUrlChar = $requestUrl ? $requestUrl[strlen($requestUrl)-1] : '';
+
+ // set Request Method if it isn't passed as a parameter
+ if ($requestMethod === null) {
+ $requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
+ }
+
+ foreach ($this->routes as $handler) {
+ list($methods, $route, $target, $name) = $handler;
+
+ $method_match = (stripos($methods, $requestMethod) !== false);
+
+ // Method did not match, continue to next route.
+ if (!$method_match) {
+ continue;
+ }
+
+ if ($route === '*') {
+ // * wildcard (matches all)
+ $match = true;
+ } elseif (isset($route[0]) && $route[0] === '@') {
+ // @ regex delimiter
+ $pattern = '`' . substr($route, 1) . '`u';
+ $match = preg_match($pattern, $requestUrl, $params) === 1;
+ } elseif (($position = strpos($route, '[')) === false) {
+ // No params in url, do string comparison
+ $match = strcmp($requestUrl, $route) === 0;
+ } else {
+ // Compare longest non-param string with url before moving on to regex
+ // Check if last character before param is a slash, because it could be optional if param is optional too (see https://github.com/dannyvankooten/AltoRouter/issues/241)
+ if (strncmp($requestUrl, $route, $position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position-1] !== '/')) {
+ continue;
+ }
+
+ $regex = $this->compileRoute($route);
+ $match = preg_match($regex, $requestUrl, $params) === 1;
+ }
+
+ if ($match) {
+ if ($params) {
+ foreach ($params as $key => $value) {
+ if (is_numeric($key)) {
+ unset($params[$key]);
+ }
+ }
+ }
+
+ return [
+ 'target' => $target,
+ 'params' => $params,
+ 'name' => $name
+ ];
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Compile the regex for a given route (EXPENSIVE)
+ * @param $route
+ * @return string
+ */
+ protected function compileRoute($route)
+ {
+ if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
+ $matchTypes = $this->matchTypes;
+ foreach ($matches as $match) {
+ list($block, $pre, $type, $param, $optional) = $match;
+
+ if (isset($matchTypes[$type])) {
+ $type = $matchTypes[$type];
+ }
+ if ($pre === '.') {
+ $pre = '\.';
+ }
+
+ $optional = $optional !== '' ? '?' : null;
+
+ //Older versions of PCRE require the 'P' in (?P)
+ $pattern = '(?:'
+ . ($pre !== '' ? $pre : null)
+ . '('
+ . ($param !== '' ? "?P<$param>" : null)
+ . $type
+ . ')'
+ . $optional
+ . ')'
+ . $optional;
+
+ $route = str_replace($block, $pattern, $route);
+ }
+ }
+ return "`^$route$`u";
+ }
+}
diff --git a/Sources/src/shared/router/Router.php b/Sources/src/shared/router/Router.php
new file mode 100644
index 00000000..6b8a85fb
--- /dev/null
+++ b/Sources/src/shared/router/Router.php
@@ -0,0 +1,87 @@
+router = new AltoRouter();
+ $this->router->setBasePath($this->path);
+ $this->initialiseRoutes();
+
+
+ $match = $this->router->match();
+ if(!$match){
+ $tabError[] = 'error : wrong path ';
+
+ require($dir . $vues['error']);
+ }
+ switch ($match['target']){
+ case 'UserControler' :
+ $this->userConnexion('UserControler', $match);
+ break;
+ case 'VisteurControler' :
+ $this->callController('VisteurControler', $match);
+ break;
+ case 'any':
+
+ VisteurControler::displayView();
+ break;
+ default:
+ $tabError[] = 'error : Wrong call router';
+ require($dir . $vues['error']);
+ }
+ }catch (PDOException $exp){
+ $tabError[] = 'error data base' . $exp->getMessage();
+ require($dir . $vues['error']);
+ } catch (Exception $exp2){
+ $tabError[] = 'unknow exeption' . $exp2->getMessage();
+ require($dir . $vues['error']);
+ }catch (Error $e){
+ $tabError[] = 'unknow error' . $e->getMessage();
+ require($dir . $vues['error']);
+ }
+ }
+
+ private function userConnexion(string $controller, array $match) : void{
+ global $dir, $vues;
+
+ if(ModelUser::isUser() != NULL){
+ $controller = 'UserControler';
+ $this->callController($controller, $match);
+ }
+ else{
+ VisteurControler::displayView();
+ }
+
+ }
+
+ private function initialiseRoutes() : void{
+ $this->router->map( 'GET|POST', '/user/[a:action]?/[i:id]?', 'UserControler','user_action');
+ $this->router->map( 'GET|POST', '/', 'any');
+ $this->router->map( 'GET|POST', '/[a:action]/[i:id]?', 'VisteurControler','vistor_action');
+
+ }
+
+ private function callController(string $controller, array $match) : void{
+ global $dir, $vues;
+ $action = Validation::val_action($match['params']['action']);
+ $controller = new $controller;
+ if(isset($match['params']['id'])){
+ $param[] = $match['params']['id'];
+ } else
+ $param[] = array();
+ if(is_callable(array($controller, $action)))
+ call_user_func_array(array($controller, $action), $param);
+ else{
+ $tabError[] = 'error : controller ';
+ require($dir . $vues['error']);
+ }
+ }
+
+}
diff --git a/Sources/src/utils/SplClassLoader.php b/Sources/src/utils/SplClassLoader.php
new file mode 100644
index 00000000..e1ed7530
--- /dev/null
+++ b/Sources/src/utils/SplClassLoader.php
@@ -0,0 +1,208 @@
+.
+ */
+
+/**
+ * SplClassLoader implementation that implements the technical interoperability
+ * standards for PHP 5.3 namespaces and class names.
+ *
+ * http://groups.google.com/group/php-standards/web/psr-0-final-proposal?pli=1
+ *
+ * // Example which loads classes for the Doctrine Common package in the
+ * // Doctrine\Common namespace.
+ * $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine');
+ * $classLoader->register();
+ *
+ * @license http://www.opensource.org/licenses/mit-license.html MIT License
+ * @author Jonathan H. Wage
+ * @author Roman S. Borschel
+ * @author Matthew Weier O'Phinney
+ * @author Kris Wallsmith
+ * @author Fabien Potencier
+ */
+class SplClassLoader
+{
+ private $_fileExtension = '.php';
+ private $_namespace;
+ private $_includePath;
+ private $_namespaceSeparator = '\\';
+
+ /**
+ * Creates a new SplClassLoader that loads classes of the
+ * specified namespace.
+ *
+ * @param string $ns The namespace to use.
+ */
+ public function __construct(string $ns = null, string $includePath = null)
+ {
+ $this->_namespace = $ns;
+ $this->_includePath = $includePath;
+ }
+
+ /**
+ * Sets the namespace separator used by classes in the namespace of this class loader.
+ *
+ * @param string $sep The separator to use.
+ */
+ public function setNamespaceSeparator(string $sep)
+ {
+ $this->_namespaceSeparator = $sep;
+ }
+
+ /**
+ * Gets the namespace seperator used by classes in the namespace of this class loader.
+ *
+ * @return void
+ */
+ public function getNamespaceSeparator()
+ {
+ return $this->_namespaceSeparator;
+ }
+
+ /**
+ * Sets the base include path for all class files in the namespace of this class loader.
+ *
+ * @param string $includePath
+ */
+ public function setIncludePath(string $includePath)
+ {
+ $this->_includePath = $includePath;
+ }
+
+ /**
+ * Gets the base include path for all class files in the namespace of this class loader.
+ *
+ * @return string $includePath
+ */
+ public function getIncludePath()
+ {
+ return $this->_includePath;
+ }
+
+ /**
+ * Sets the file extension of class files in the namespace of this class loader.
+ *
+ * @param string $fileExtension
+ */
+ public function setFileExtension($fileExtension)
+ {
+ $this->_fileExtension = $fileExtension;
+ }
+
+ /**
+ * Gets the file extension of class files in the namespace of this class loader.
+ *
+ * @return string $fileExtension
+ */
+ public function getFileExtension()
+ {
+ return $this->_fileExtension;
+ }
+
+ /**
+ * Installs this class loader on the SPL autoload stack.
+ */
+ public function register()
+ {
+ spl_autoload_register(array($this, 'loadClass'));
+ }
+
+ /**
+ * Uninstalls this class loader from the SPL autoloader stack.
+ */
+ public function unregister()
+ {
+ spl_autoload_unregister(array($this, 'loadClass'));
+ }
+
+ /**
+ * Loads the given class or interface.
+ *
+ * @param string $className The name of the class to load.
+ * @return void
+ */
+ public function loadClass(string $className)
+ {
+ if (null === $this->_namespace || $this->_namespace . $this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace . $this->_namespaceSeparator))) {
+ $fileName = '';
+ $namespace = '';
+ if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) {
+ $namespace = substr($className, 0, $lastNsPos);
+ $className = substr($className, $lastNsPos + 1);
+ $fileName = str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
+ }
+ $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension;
+
+ require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName;
+ }
+ }
+}
+
+
+//
\ No newline at end of file
diff --git a/Sources/src/utils/Validation.php b/Sources/src/utils/Validation.php
new file mode 100644
index 00000000..98163c28
--- /dev/null
+++ b/Sources/src/utils/Validation.php
@@ -0,0 +1,109 @@
+
diff --git a/notify.sh b/notify.sh
new file mode 100644
index 00000000..5b5b563c
--- /dev/null
+++ b/notify.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+changelog="$(base64 -w 0 CHANGELOG)"
+
+# This call sends a message to the given recipient with vars and custom vars.
+curl -s \
+ -X POST \
+ --user "46cb7f286b30df20369be709a91424a9:957e3ac14b3b106331ccd9dfe07f67fd" \
+ https://api.mailjet.com/v3.1/send \
+ -H 'Content-Type: application/json' \
+ -d '{ "Messages":[ { "From": { "Email": "contact@lamsterpilotage.fr", "Name": "Equipe de développement" }, "To": [ { { "Email": "equipedev@waveheart.fr", "Name": "dev" } ], "TemplateID": 2687222, "TemplateLanguage": true, "Subject": "Nouvelle version démo", "Variables": {}, "Attachments": [ { "ContentType": "text/plain", "Filename": "changelog.md", "Base64Content": "'"$changelog"'" } ] } ] }'
\ No newline at end of file