From 5be434f4c7003863f27b22f03ef8f563cbae5f37 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 19 Feb 2018 23:01:42 +0100 Subject: [PATCH] +add composer.json + update autoloader --- autoloader.php | 37 +------------------------------------ composer.json | 27 +++++++++++++++++++++++++++ public_html/index.php | 2 +- 3 files changed, 29 insertions(+), 37 deletions(-) create mode 100644 composer.json diff --git a/autoloader.php b/autoloader.php index ca24bd1..ce28dce 100755 --- a/autoloader.php +++ b/autoloader.php @@ -18,42 +18,7 @@ } - - /* Secure Hash Function - * - * @raw Data to hash - * @salt Salt to use for hashing - * @pepper Pepper to use for hashing - * - */ - function secure_hash(String $raw, String $salt='2104\'dsa:">AS"D:', String $pepper='3894.234123;\'21'){ - return hash('sha512', $pepper.hash('sha512', $raw.$salt)); - } - - - - /* AUTOLOADER - * - * @className Nom de la classe appelee - * - */ - function autoloader($className){ - $path = ''; - - /* [1] On utilise le namespace pour localiser - ===============================================*/ - // On remplace les '\' par des '/' - $path = str_replace('\\', '/', $className) . '.php'; - $path = __BUILD__.'/'.$path; - - // Si le fichier existe - if( file_exists($path) ) - require_once $path; // on inclue le fichier - - } - - // On definit l'autoloader comme autoloader (obvious) - spl_autoload_register('autoloader', false, true); + \session_start(); ?> diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..0dca2c6 --- /dev/null +++ b/composer.json @@ -0,0 +1,27 @@ +{ + "name": "ptut", + "description": "PTUT website", + "license": "proprietary", + "authors": [ + { + "name": "xdrm-brackets", + "email": "xdrm.brackets.dev@gmail.com" + }, { + "name": "SeekDasky", + "email": "mascaro.lucas@yahoo.fr" + }, { + "name": "G. Fauvet", + "email": "gfauvet@gmail.com" + } + ], + "autoload": { + "psr-4": { + "api\\": "build/api", + "database\\": "build/database", + "error\\": "build/error", + "http\\": "build/http", + "router\\": "build/router" + }, + "files": ["autoloader.php"] + } +} diff --git a/public_html/index.php b/public_html/index.php index c57fb65..475e764 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -1,4 +1,4 @@ -