Removed /lib folder added 'Twig' to default composer + cleaned autoloader file

This commit is contained in:
xdrm-brackets 2017-11-09 10:19:51 +01:00
parent 79216f6edc
commit 088683d2bf
4 changed files with 152 additions and 166 deletions

View File

@ -8,32 +8,6 @@
if( !defined('__PUBLIC__') ) define('__PUBLIC__', __ROOT__.'/public_html' );
/* [1] On définit __SERVER_HOST__ et __SERVER_ROOT__ si c'est pas déja fait
=========================================================*/
if( !defined('__SERVER_HOST__') || !defined('__SERVER_ROOT__') ){
/* (1) On charge le fichier de configuration */
$json = json_decode( file_get_contents(__ROOT__.'/config/server.json'), true );
// Si pas d'erreur, on définit
if( !is_null($json) ){
/* (2) Gestion de la config si server local ou remote */
if( !isset($_SERVER['SERVER_NAME']) || !checkdnsrr($_SERVER['SERVER_NAME'], 'NS') )
$config = $json['local'];
else
$config = $json['remote'];
/* (3) Création des constantes */
define('__SERVER_HOST__', $config['host']);
define('__SERVER_ROOT__', $config['root']);
}
}
/* ACTIVE LE DEBUGGAGE (WARNING + EXCEPTION)
*
*/
@ -65,52 +39,6 @@
}
/* AUTOLOADER
*
* @className<String> Nom de la classe appelee
*
*/
function autoloader($className){
/* [1] Basic processing
=========================================================*/
/* (1) Explode classname by namespaces */
$path = explode('\\', $className);
/* (2) Check if at least a filename */
if( count($path) < 1 )
throw new \Exception('Missing classname for autoloader.');
/* (3) Detect if build class or lib class */
$type = $path[0] === 'lib' ? 'lib' : 'build';
/* [2] Manage type and check file
=========================================================*/
/* (1) Build path according to type */
if( $type === 'lib' )
$file = __ROOT__.'/'.implode('/', $path).'.php';
else
$file = __BUILD__.'/'.implode('/', $path).'.php';
/* (2) Check file */
if( file_exists($file) )
require_once $file;
}
// // On definit l'autoloader comme autoloader (obvious)
// spl_autoload_register('autoloader', false, true);
/* On demarre la session securisee PHP
=========================================================*/
session_start();
// \manager\sessionManager::session_start();
\session_start();
?>

View File

@ -8,7 +8,9 @@
"email": "doowap31@gmail.com"
}
],
"require": {},
"require": {
"twig/twig": "dev-master"
},
"require-dev": {
"phpro/grumphp": "^0.11.5",
"jakub-onderka/php-parallel-lint": "^0.9.2",
@ -27,6 +29,6 @@
"view\\": "build/generic/view",
"token\\": "build/token"
},
"files": ["autoloader.php", "lib/vendor/autoload.php"]
"files": ["autoloader.php"]
}
}

205
composer.lock generated
View File

@ -4,9 +4,135 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "86e59c91b4ee70a2a9b726da1c9c6bb3",
"content-hash": "571f10b148faa9e2fe27a3fad429b4d2",
"packages": [],
"hash": "a67d059eefe03511f76073ba76c61878",
"content-hash": "98f631539238eb6dba4f74f1ae9e4744",
"packages": [
{
"name": "symfony/polyfill-mbstring",
"version": "v1.6.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296",
"reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.6-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"time": "2017-10-11 12:05:26"
},
{
"name": "twig/twig",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "9c8c0a4b2a72a8147ea34833cf4132ef408755ba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/9c8c0a4b2a72a8147ea34833cf4132ef408755ba",
"reference": "9c8c0a4b2a72a8147ea34833cf4132ef408755ba",
"shasum": ""
},
"require": {
"php": "^7.0",
"symfony/polyfill-mbstring": "~1.0"
},
"require-dev": {
"psr/container": "^1.0",
"symfony/debug": "~2.7",
"symfony/phpunit-bridge": "~3.3@dev"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"psr-0": {
"Twig_": "lib/"
},
"psr-4": {
"Twig\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
},
{
"name": "Armin Ronacher",
"email": "armin.ronacher@active-4.com",
"role": "Project Founder"
},
{
"name": "Twig Team",
"homepage": "http://twig.sensiolabs.org/contributors",
"role": "Contributors"
}
],
"description": "Twig, the flexible, fast, and secure template language for PHP",
"homepage": "http://twig.sensiolabs.org",
"keywords": [
"templating"
],
"time": "2017-09-27 17:50:14"
}
],
"packages-dev": [
{
"name": "composer/ca-bundle",
@ -437,16 +563,16 @@
},
{
"name": "justinrainbow/json-schema",
"version": "5.2.4",
"version": "5.2.6",
"source": {
"type": "git",
"url": "https://github.com/justinrainbow/json-schema.git",
"reference": "7ccb0e67ea8ace0f84c40900ca3c8a234467628c"
"reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/7ccb0e67ea8ace0f84c40900ca3c8a234467628c",
"reference": "7ccb0e67ea8ace0f84c40900ca3c8a234467628c",
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/d283e11b6e14c6f4664cf080415c4341293e5bbd",
"reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd",
"shasum": ""
},
"require": {
@ -499,7 +625,7 @@
"json",
"schema"
],
"time": "2017-10-04 20:57:36"
"time": "2017-10-21 13:15:38"
},
{
"name": "kahlan/kahlan",
@ -1552,65 +1678,6 @@
],
"time": "2017-07-29 21:54:42"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.5.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803",
"reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"time": "2017-06-14 15:44:48"
},
{
"name": "symfony/process",
"version": "v3.3.10",
@ -1879,7 +1946,9 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {
"twig/twig": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],

View File

@ -1,13 +0,0 @@
{
"name": "xdrm-brackets/logauth-smmp",
"description": "LogAuth lib",
"authors": [
{
"name": "xdrm-brackets",
"email": "doowap31@gmail.com"
}
],
"require": {
"twig/twig": "dev-master"
}
}