+add composer.json + update autoloader
This commit is contained in:
parent
c41e024c9d
commit
5be434f4c7
|
@ -18,42 +18,7 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/* Secure Hash Function
|
||||
*
|
||||
* @raw<String> Data to hash
|
||||
* @salt<String> Salt to use for hashing
|
||||
* @pepper<String> 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<String> 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();
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
@ -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"]
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
<?php require_once '../autoloader.php';
|
||||
<?php require_once '../vendor/autoload.php';
|
||||
|
||||
use \router\core\Router;
|
||||
use \database\core\Repo;
|
||||
|
|
Loading…
Reference in New Issue