Compare commits
119 commits
Author | SHA1 | Date | |
---|---|---|---|
Emmanuel ROY | cbcb0eb22f | ||
10bc015688 | |||
8277707a22 | |||
6d4e4f20f7 | |||
5d8dd0f702 | |||
61af7f0fcb | |||
d69e72165d | |||
666a13f719 | |||
73a505ce7b | |||
448f312b2e | |||
df0aeb1b80 | |||
e55358c819 | |||
f8bcc15874 | |||
108e5d7641 | |||
d8075c803b | |||
7a3cf99bea | |||
b725e80591 | |||
4dd174ebbf | |||
58f6adb7ba | |||
037e2b0812 | |||
ae43c2e6bb | |||
fe77b35dcc | |||
67ffc42769 | |||
23878bfe8e | |||
d7ab71841e | |||
22df2ca781 | |||
d4ae501192 | |||
99e7c9544c | |||
aed63829d0 | |||
a09f93cddc | |||
c238bfdcb3 | |||
5dc8af450a | |||
42fde64f60 | |||
0d3b2ae752 | |||
c341a9b84b | |||
5be76d38f6 | |||
eb54203916 | |||
128e34d292 | |||
fd48ba3ce9 | |||
4b94f3f6ea | |||
ffce2a8ca9 | |||
fd3a86d68c | |||
4a65e80938 | |||
2b9d7af69f | |||
297de5a303 | |||
4872d12d28 | |||
c136b3beaf | |||
3f0d453ef8 | |||
fc111abccf | |||
6de3e0e2c4 | |||
9b595d9bd3 | |||
42d7a8e40f | |||
d18bda5e9f | |||
29a6956c6c | |||
4aad8b3076 | |||
93a6a79efa | |||
5a788fafd3 | |||
014bc1edd9 | |||
8b7c766a1c | |||
28ac2bef9a | |||
2f89c46410 | |||
c0ab3e31ad | |||
405bd6c73d | |||
7855afc0fa | |||
b74a70c427 | |||
74fd81282c | |||
d07792e3d8 | |||
0618c51f14 | |||
2a2f2e3e46 | |||
521cc1efc1 | |||
da6556ff71 | |||
f517faa071 | |||
574a2afa8b | |||
d4e08d1f42 | |||
30493683b2 | |||
ba5f4a6fb2 | |||
7de9217e79 | |||
266a36dbfe | |||
444022efa7 | |||
326ef5ab59 | |||
1388b0fe11 | |||
68f87c9750 | |||
efd8cb05a4 | |||
da7d08ea3d | |||
8b070188c2 | |||
a2287a8610 | |||
25c69bdf30 | |||
d54bce2a5f | |||
418ec25a6d | |||
176ee07e49 | |||
5e9bd26db2 | |||
d47d1ae43c | |||
e99465453c | |||
ed5476cb21 | |||
9dbc83dc83 | |||
3de107cc9a | |||
8ab4b877f1 | |||
47ca90b801 | |||
17b6543ff5 | |||
c2bb37af55 | |||
ef39e7ec1e | |||
50812c22e8 | |||
4f5961312b | |||
353298db7f | |||
8551633514 | |||
2b6ac77922 | |||
56926af2d9 | |||
42ef646e87 | |||
c6391bb44f | |||
36a3aa2013 | |||
401dcf8167 | |||
55164d487c | |||
82420d80b2 | |||
5d978f58b9 | |||
bedf7ee0a2 | |||
4e5dbc1e17 | |||
21ec903fa9 | |||
21073bb54e | |||
c3328c06b8 |
12
.gitignore
vendored
12
.gitignore
vendored
|
@ -1,4 +1,14 @@
|
|||
composer.lock
|
||||
vendor
|
||||
/vendor
|
||||
.idea
|
||||
.php_cs.cache
|
||||
|
||||
|
||||
application/config/app-parameters.php
|
||||
application/config/bdd-parameters.php
|
||||
application/config/cas-authentification-config.php
|
||||
application/config/hybrid-authentification-config.php
|
||||
application/config/soap-constantes.php
|
||||
application/config/console-parameters.php
|
||||
|
||||
application/include/vues/cache/*
|
||||
|
|
56
README.md
56
README.md
|
@ -1,27 +1,47 @@
|
|||
# Modular Symfony Application
|
||||
# SAND-FRAMEWORK for Modular-Applications
|
||||
|
||||
---
|
||||
---
|
||||
Cette architecture MVC Objet est composée d'un layout Blade (Laravel)
|
||||
|
||||
Les urls d'accès sont de type www.domain.tld/page/varname1/varvalue1/varname2/varvalue2/ ...
|
||||
Cette architecture MVC Objet est composée d'un moteur de template (Blade ou Twig)
|
||||
|
||||
Afin de créer une nouvelle page vous devez instancier trois fichiers contenant diverses variables, dont voici les commandes:
|
||||
Les urls d'accès sont de type www.domain.tld/le_nom_de_mapage/varname1/varvalue1/varname2/varvalue2/ ...
|
||||
|
||||
Afin de créer une nouvelle page vous devez instancier trois fichiers contenant diverses variables, dont voici les adresses:
|
||||
|
||||
"application > include > controlleurs > mapage.php" contenant:
|
||||
> les commandes permettant de gérer un formulaire
|
||||
> un ou plusieurs accès à la base de données
|
||||
> les variables instanciées dans $templateData permettent l'affichage dans la vue blade
|
||||
---
|
||||
|
||||
"application > include > modeles > mapage.model" contenant
|
||||
>les variables spécifiques à la page de l'application exemple:
|
||||
`application > include > controlleurs > le_nom_de_mapage.php` contenant:
|
||||
- les commandes permettant de gérer un formulaire
|
||||
- un ou plusieurs accès à la base de données
|
||||
- des variables instanciées dans le tableau `$templateData` permettant l'affichage dans la vue blade ou twig
|
||||
|
||||
---
|
||||
|
||||
`application > include > modeles > le_nom_de_mapage.model` contenant
|
||||
les variables spécifiques à la page de l'application. soit par exemple:
|
||||
```
|
||||
name : le nom de mapage
|
||||
description : ma description pour les moteur de recherche
|
||||
params : paramètre(s) supplémentaire(s)
|
||||
name : le_nom_de_mapage
|
||||
page_title : le title du head de la page html rendue
|
||||
description : ma description pour les moteurs de recherche
|
||||
engine : none
|
||||
authentification : no
|
||||
ariane : {acceuil, test d'acceuil}
|
||||
arianelink : {index, le_nom_de_mapage}
|
||||
paramsN : paramètre(s) supplémentaire(s)
|
||||
```
|
||||
"application > include > vues > view > mapage.blade.php contenant
|
||||
> le layout blade a instancier
|
||||
avec en plus de cela :
|
||||
`engine : blade` pour un layout blade ou `engine : twig` pour un layout twig
|
||||
|
||||
pour les modules symfony, c'est un peu plus compliqué il faut instancier ces trois précédents fichiers en faisant appel la class Modular,
|
||||
ne pas oublier de référencer le module dans le dossier modules > setup > registre.model
|
||||
et faire correspondre le nom du dossier avec le registre, ici l'exemple est syf43.
|
||||
---
|
||||
|
||||
`application > include > vues > view > le_nom_de_mapage.blade.php` contenant le layout `blade` a instancier
|
||||
`application > include > vues > view > le_nom_de_mapage.html.twig` contenant le layout `twig` a instancier
|
||||
|
||||
> Vous pouvez aussi tout à fait utiliser la commande:
|
||||
>
|
||||
> `php console/bin.php page:add`
|
||||
|
||||
Pour les modules, c'est un peu plus compliqué : il faut instancier ces trois précédents fichiers en faisant appel la class Modular,
|
||||
ne pas oublier de référencer le module dans le dossier modules > setup > registre.model, ajouter le dossier contenant le code du module
|
||||
et faire correspondre le nom du controlleur frontal du module avec le registre.
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Package MVC\Classe
|
||||
* @author Emmanuel ROY
|
||||
* @license MIT-licence (open source)
|
||||
* @version 3.5
|
||||
*/
|
||||
|
||||
namespace MVC\Classe;
|
||||
|
||||
class Application
|
||||
|
@ -9,6 +16,8 @@ class Application
|
|||
public $browser;
|
||||
public $route;
|
||||
|
||||
public $controlleur;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
@ -17,17 +26,42 @@ class Application
|
|||
|
||||
$this->url = new Url($this->http->method, $this->browser->isAppRequest());
|
||||
|
||||
$dispacher = new Dispacher();
|
||||
$this->route = $dispacher->route;
|
||||
switch(APP_STATE) {
|
||||
case "CLOSED":
|
||||
case "MAINTAINED":
|
||||
$this->route = null;
|
||||
break;
|
||||
case "OPEN":
|
||||
if(\MVC\Classe\Application::is_under_update()) {
|
||||
$this->route = null;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
$dispacher = new Dispacher();
|
||||
$this->route = $dispacher->route;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function launch()
|
||||
{
|
||||
//print_r($this->route);
|
||||
$controlleur = new Controlleur($this);
|
||||
$this->controlleur = new Controlleur($this);
|
||||
//si la page n'est un controlleur d'action alors on affiche l'écran
|
||||
if (!$this->url->page['control']) {
|
||||
print($controlleur->vue->ecran);
|
||||
print($this->controlleur->vue->ecran);
|
||||
//si on affiche l'écran alors on vide les alertes de la session
|
||||
\MVC\Object\Alert::remove();
|
||||
}
|
||||
}
|
||||
|
||||
public static function is_under_update(){
|
||||
$ajh = new \DateTime('NOW');
|
||||
$maintenance_begin = new \DateTime(MAINTENANCE_DATE_DEBUT);
|
||||
$maintenance_fin = new \DateTime(MAINTENANCE_DATE_FIN);
|
||||
if($maintenance_begin < $ajh && $ajh < $maintenance_fin) {
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ class Bdd
|
|||
{
|
||||
public $bdd;
|
||||
|
||||
public function __construct($bdd = 'bdd1')
|
||||
public function __construct($bdd = 'default')
|
||||
{
|
||||
switch ($bdd) {
|
||||
case 'bdd1':
|
||||
|
@ -24,10 +24,21 @@ class Bdd
|
|||
|
||||
public function faireSQLRequete($sql)
|
||||
{
|
||||
$sql = \MVC\Classe\Caracter::avoid_sql_injection($sql);
|
||||
$req = $this->bdd->query($sql);
|
||||
// Print Pdo::ERRORs
|
||||
if (!$req && (ENV == 'TEST' || ENV == 'DEVEL')) {
|
||||
echo "\nPDO::errorInfo():\n";
|
||||
print_r($this->bdd->errorInfo());
|
||||
print_r($sql);
|
||||
}
|
||||
return $req;
|
||||
}
|
||||
|
||||
public function getLastInsertId(){
|
||||
return $this->bdd->lastInsertId();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Exemple:
|
||||
|
@ -46,13 +57,45 @@ class Bdd
|
|||
*/
|
||||
public function faireBindRequete($sql, array $params = null)
|
||||
{
|
||||
$req = $this->bdd->prepare($sql);
|
||||
if ($params) {
|
||||
foreach ($params as $value) {
|
||||
$req->bindParam($value[0], Caracter::normalise_ChaineDeCaracteres($value[1]), $value[2]);
|
||||
try{
|
||||
$req = $this->bdd->prepare($sql);
|
||||
// cas de tests des variables qui lance une exception
|
||||
//if(!$Allow) throw new Exception("Le format de l'isbn ne correspond pas au format attendu");
|
||||
if ($params) {
|
||||
foreach ($params as $value) {
|
||||
$value[1] = Caracter::normalise_ChaineDeCaracteres($value[1]);
|
||||
if($value[2] !== 'VALUE') {
|
||||
$req->bindParam(':'.$value[0], $value[1], $value[2]);
|
||||
}else{
|
||||
$req->bindValue(':'.$value[0], $value[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$req->execute();
|
||||
|
||||
}
|
||||
catch(PDOException $pdo_e){
|
||||
if (ENV == 'TEST' || ENV == 'DEVEL')
|
||||
{
|
||||
// Print Pdo::ERRORs
|
||||
//Faire quelque choses en cas d'erreur PDO
|
||||
echo "\nPDOException():\n";
|
||||
print_r($this->bdd->errorInfo());
|
||||
print_r($pdo_e);
|
||||
print_r($sql);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
catch(Exception $e){
|
||||
if (ENV == 'TEST' || ENV == 'DEVEL') {
|
||||
//Pour les autres erreurs faire autre chose
|
||||
echo "\nException():\n";
|
||||
print_r($this->bdd->errorInfo());
|
||||
print_r($e);
|
||||
print_r($sql);
|
||||
}
|
||||
}
|
||||
$req->execute();
|
||||
//$req->closeCursor();
|
||||
return $req;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,104 @@ class Browser
|
|||
//Logger::addLog('http.browser',$this->user);
|
||||
}
|
||||
|
||||
public static function get()
|
||||
{
|
||||
// Make case insensitive.
|
||||
$t = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
|
||||
// If the string *starts* with the string, strpos returns 0 (i.e., FALSE). Do a ghetto hack and start with a space.
|
||||
// "[strpos()] may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE."
|
||||
// http://php.net/manual/en/function.strpos.php
|
||||
$t = " " . $t;
|
||||
|
||||
// Humans / Regular Users
|
||||
if (strpos($t, 'opera') || strpos($t, 'opr/')) {
|
||||
return 'Opera';
|
||||
} elseif (strpos($t, 'edge')) {
|
||||
return 'Edge';
|
||||
} elseif (strpos($t, 'chrome')) {
|
||||
return 'Chrome';
|
||||
} elseif (strpos($t, 'safari')) {
|
||||
return 'Safari';
|
||||
} elseif (strpos($t, 'firefox')) {
|
||||
return 'Firefox';
|
||||
} elseif (strpos($t, 'msie') || strpos($t, 'trident/7')) {
|
||||
return 'Internet Explorer';
|
||||
}
|
||||
}
|
||||
|
||||
public static function get_firefox_version() {
|
||||
// Make case insensitive.
|
||||
$t = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
|
||||
// If the string *starts* with the string, strpos returns 0 (i.e., FALSE). Do a ghetto hack and start with a space.
|
||||
// "[strpos()] may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE."
|
||||
// http://php.net/manual/en/function.strpos.php
|
||||
$t = " " . $t;
|
||||
|
||||
// Firefox Users
|
||||
if (strpos($t, 'firefox')) {
|
||||
preg_match('/rv:(.*)\)/', $_SERVER['HTTP_USER_AGENT'], $matches, PREG_OFFSET_CAPTURE);
|
||||
if(isset($matches[1])) {
|
||||
return intval($matches[1][0]);
|
||||
}else{
|
||||
return 'no-version';
|
||||
}
|
||||
}
|
||||
return 'not-firefox';
|
||||
}
|
||||
|
||||
public static function get_ip() {
|
||||
// IP si internet partagé
|
||||
if (isset($_SERVER['HTTP_CLIENT_IP'])) {
|
||||
return $_SERVER['HTTP_CLIENT_IP'];
|
||||
}
|
||||
// IP derrière un proxy
|
||||
elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
return $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
}
|
||||
// Sinon : IP normale
|
||||
else {
|
||||
return (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '');
|
||||
}
|
||||
}
|
||||
|
||||
public static function get_os() {
|
||||
$user_agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
$os_platform = "Inconnu";
|
||||
$os_array = array(
|
||||
'/windows nt 10/i' => 'Windows 10',
|
||||
'/windows nt 6.3/i' => 'Windows 8.1',
|
||||
'/windows nt 6.2/i' => 'Windows 8',
|
||||
'/windows nt 6.1/i' => 'Windows 7',
|
||||
'/windows nt 6.0/i' => 'Windows Vista',
|
||||
'/windows nt 5.2/i' => 'Windows Server 2003/XP x64',
|
||||
'/windows nt 5.1/i' => 'Windows XP',
|
||||
'/windows xp/i' => 'Windows XP',
|
||||
'/windows nt 5.0/i' => 'Windows 2000',
|
||||
'/windows me/i' => 'Windows ME',
|
||||
'/win98/i' => 'Windows 98',
|
||||
'/win95/i' => 'Windows 95',
|
||||
'/win16/i' => 'Windows 3.11',
|
||||
'/macintosh|mac os x/i' => 'Mac OS X',
|
||||
'/mac_powerpc/i' => 'Mac OS 9',
|
||||
'/linux/i' => 'Linux',
|
||||
'/ubuntu/i' => 'Ubuntu',
|
||||
'/iphone/i' => 'iPhone',
|
||||
'/ipod/i' => 'iPod',
|
||||
'/ipad/i' => 'iPad',
|
||||
'/android/i' => 'Android',
|
||||
'/blackberry/i' => 'BlackBerry',
|
||||
'/webos/i' => 'Mobile'
|
||||
);
|
||||
foreach ($os_array as $regex => $value) {
|
||||
if (preg_match($regex, $user_agent)) {
|
||||
$os_platform = $value;
|
||||
}
|
||||
}
|
||||
return $os_platform;
|
||||
}
|
||||
|
||||
protected function get_browser_name()
|
||||
{
|
||||
|
||||
|
@ -112,10 +210,22 @@ class Browser
|
|||
|
||||
public function isAppRequest()
|
||||
{
|
||||
if (preg_match('#App#', $this->user)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
switch(APP_STATE) {
|
||||
case "CLOSED":
|
||||
case "MAINTAINED":
|
||||
return false;
|
||||
break;
|
||||
case "OPEN":
|
||||
if(\MVC\Classe\Application::is_under_update()) {
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (preg_match('#App#', $this->user)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,11 +14,11 @@ class Caracter
|
|||
|
||||
public static function fp_stripslashes($str)
|
||||
{
|
||||
if (get_magic_quotes_gpc() == 1) {
|
||||
/*if (get_magic_quotes_gpc() == 1) {
|
||||
return stripslashes($str);
|
||||
} else {
|
||||
} else {*/
|
||||
return $str;
|
||||
}
|
||||
/*}*/
|
||||
}
|
||||
|
||||
public static function normalise_ChaineDeCaracteresUpload($chaine)
|
||||
|
@ -28,11 +28,11 @@ class Caracter
|
|||
|
||||
public static function fp_addslashes($str)
|
||||
{
|
||||
if (get_magic_quotes_gpc() == 1) {
|
||||
/*if (get_magic_quotes_gpc() == 1) {
|
||||
return $str;
|
||||
} else {
|
||||
} else {*/
|
||||
return addslashes($str);
|
||||
}
|
||||
/*}*/
|
||||
}
|
||||
|
||||
public static function remplacerAccents($chaine)
|
||||
|
@ -74,4 +74,54 @@ class Caracter
|
|||
$chaine = str_replace('"', '"', $chaine);
|
||||
return $chaine;
|
||||
}
|
||||
public static function avoid_sql_injection($chaine){
|
||||
$chaine = preg_replace("/`;--/", "", $chaine);
|
||||
$chaine = preg_replace("/';--/", "", $chaine);
|
||||
$chaine = preg_replace('/";--/', "", $chaine);
|
||||
$chaine = preg_replace("/;--/", "", $chaine);
|
||||
return $chaine;
|
||||
}
|
||||
public static function avoid_guillemets($chaine)
|
||||
{
|
||||
$chaine = str_replace("'", "", $chaine);
|
||||
$chaine = str_replace('"', '', $chaine);
|
||||
return $chaine;
|
||||
}
|
||||
public static function mettreEnMajusculeAccents($chaine, $trueAccent = false)
|
||||
{
|
||||
if (!$trueAccent) {
|
||||
$chaine = str_replace('é', 'E', $chaine);
|
||||
$chaine = str_replace('è', 'E', $chaine);
|
||||
$chaine = str_replace('ë', 'E', $chaine);
|
||||
$chaine = str_replace('ê', 'E', $chaine);
|
||||
$chaine = str_replace('ç', 'C', $chaine);
|
||||
$chaine = str_replace('Ç', 'C', $chaine);
|
||||
$chaine = str_replace('à', 'A', $chaine);
|
||||
// $chaine = str_replace('','&aeacute;',$chaine);
|
||||
$chaine = str_replace('â', 'A', $chaine);
|
||||
$chaine = str_replace('ä', 'A', $chaine);
|
||||
$chaine = str_replace('î', 'I', $chaine);
|
||||
$chaine = str_replace('ï', 'I', $chaine);
|
||||
$chaine = str_replace('ù', 'U', $chaine);
|
||||
$chaine = str_replace('û', 'U', $chaine);
|
||||
$chaine = str_replace('ü', 'U', $chaine);
|
||||
} else {
|
||||
$chaine = str_replace('é', 'É', $chaine);
|
||||
$chaine = str_replace('è', 'È', $chaine);
|
||||
$chaine = str_replace('ë', 'Ë', $chaine);
|
||||
$chaine = str_replace('ê', 'Ê', $chaine);
|
||||
$chaine = str_replace('ç', 'Ç', $chaine);
|
||||
$chaine = str_replace('Ç', 'Ç', $chaine);
|
||||
$chaine = str_replace('à', 'À', $chaine);
|
||||
// $chaine = str_replace('','&aeacute;',$chaine);
|
||||
$chaine = str_replace('â', 'Â', $chaine);
|
||||
$chaine = str_replace('ä', 'Ä', $chaine);
|
||||
$chaine = str_replace('î', 'Î', $chaine);
|
||||
$chaine = str_replace('ï', 'Ï', $chaine);
|
||||
$chaine = str_replace('ù', 'Ù', $chaine);
|
||||
$chaine = str_replace('û', 'Û', $chaine);
|
||||
$chaine = str_replace('ü', 'Ü', $chaine);
|
||||
}
|
||||
return $chaine;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Package MVC\Classe
|
||||
* @author Emmanuel ROY
|
||||
* @license MIT-licence (open source)
|
||||
* @version 3.5
|
||||
*/
|
||||
|
||||
namespace MVC\Classe;
|
||||
|
||||
class Controlleur
|
||||
|
@ -22,7 +29,9 @@ class Controlleur
|
|||
}
|
||||
// no break
|
||||
default:
|
||||
//si c'est une route symfony alors on appelle le conduit associé
|
||||
if ($application->route != null) {
|
||||
$application->url->page['name'] = $application->route['_route'];
|
||||
$conduit = explode('::', $application->route['controller']);
|
||||
require CONDUIT_PATH . DIRECTORY_SEPARATOR . $conduit[0] . '.php';
|
||||
$conduitRoute = "\\" . $conduit[0];
|
||||
|
@ -31,14 +40,31 @@ class Controlleur
|
|||
$class->initialize($application);
|
||||
$this->vue = new VueVide();
|
||||
$this->vue->ecran = $class->$method();
|
||||
|
||||
//si c'est une page de traitement PRG on appelle le fichier de controle de formulaire
|
||||
} elseif ($application->url->page['control']) {
|
||||
$url_params = $application->url->page['params'];
|
||||
foreach($application->url->page['params'] as $key => $value){
|
||||
$_GET[$key] = $value;
|
||||
$url_params[$key] = $value;
|
||||
}
|
||||
require TRAITEMENT_PATH . DIRECTORY_SEPARATOR . $application->url->page['name'] . '.php';
|
||||
|
||||
//sinon c'est une page MVC normale
|
||||
} else {
|
||||
$this->modele = new Modele($application->url->page);
|
||||
$this->vue = new Vue($this);
|
||||
//on appelle le garde d'authentification
|
||||
if(isset($this->modele->page['authentification']) && $this->modele->page['authentification'] == 'yes'){
|
||||
//on declare la session lors du chargement du controlleur,
|
||||
// ainsi on instancie la page précédente et le javascript et le css asynchrone
|
||||
\MVC\Object\Session::createAndTestSession();
|
||||
}else{
|
||||
\MVC\Object\Session::sessionStart();
|
||||
}
|
||||
$this->vue = new Vue($this->modele->page);
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function callHttpResponse($application)
|
||||
|
|
|
@ -7,17 +7,21 @@ class ControlleurAction
|
|||
{
|
||||
public static function inserer($action, $data = array())
|
||||
{
|
||||
//on extrait la classe d'appel de l'action
|
||||
$action = explode('.', $action);
|
||||
$class = ucfirst($action[0]) . "Action";
|
||||
//echo $class;
|
||||
//TODO: use try ... catch with \MVC\Classe\Logger to log error
|
||||
if (is_file(ACTION_PATH . DIRECTORY_SEPARATOR . $class . ".php")) {
|
||||
require_once ACTION_PATH . DIRECTORY_SEPARATOR . $class . ".php";
|
||||
//On charge la classe Action de façon réflextive
|
||||
$slot = new $class();
|
||||
//si l'action passé en parametre est fournit avec une methode pointée on charge celle demandée sinon on charge celle par defaut
|
||||
if (isset($action[1])) {
|
||||
$method = $action[1];
|
||||
return $slot->$method($data);
|
||||
//On appel la méthode de la classe action de manière reflextive
|
||||
return $slot->$method(...$data);
|
||||
} else {
|
||||
return $slot->default($data);
|
||||
return $slot->default(...$data);
|
||||
}
|
||||
} else {
|
||||
/*HandleError*/
|
||||
|
|
|
@ -23,13 +23,8 @@ class HttpMethod
|
|||
case 'POST':
|
||||
break;
|
||||
case 'PUT':
|
||||
//$this->data['GET'] = ...
|
||||
//POST DATA except enctype="multipart/form-data"
|
||||
$this->data = json_decode(file_get_contents("php://input"), true);
|
||||
// no break
|
||||
case 'DELETE':
|
||||
//$this->data['GET'] = ...
|
||||
//POST DATA except enctype="multipart/form-data"
|
||||
//on décode les données depuis l'input afin de les traiter
|
||||
$this->data = json_decode(file_get_contents("php://input"), true);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -3,42 +3,6 @@
|
|||
|
||||
namespace MVC\Classe;
|
||||
|
||||
/**
|
||||
* Class Response
|
||||
*
|
||||
* example use:
|
||||
* $data = array('a','b','c');
|
||||
*
|
||||
* Three Way to send a request
|
||||
*
|
||||
* $request = new Response('http://myurl','mymethod');
|
||||
* $request->addContent($data);
|
||||
* $request->send();
|
||||
*
|
||||
* OR
|
||||
*
|
||||
* $request = new Response('http://myurl');
|
||||
* (
|
||||
* $request->createContext('mymethod')
|
||||
* $request->addContent($data);
|
||||
* $request->send();
|
||||
* ) OR (
|
||||
* $request->get($data);
|
||||
* $request->post($data);
|
||||
* $request->put($data);
|
||||
* $request->delete($data);
|
||||
*
|
||||
*
|
||||
* OR
|
||||
*
|
||||
* $request = new Response();
|
||||
* $request->setUrl('http://myurl')->get($data)
|
||||
* $request->setUrl('http://myurl')->post($data)
|
||||
* $request->setUrl('http://myurl')->put($data)
|
||||
* $request->setUrl('http://myurl')->delete($data)
|
||||
*
|
||||
* @package MVC\Classe
|
||||
*/
|
||||
class HttpMethodRequete
|
||||
{
|
||||
protected $url;
|
||||
|
|
|
@ -6,6 +6,31 @@ namespace MVC\Classe\Implement;
|
|||
class Action
|
||||
{
|
||||
public function render($view, $data)
|
||||
{
|
||||
return $this->renderBlade($view,$data);
|
||||
}
|
||||
|
||||
public function renderJSON($json)
|
||||
{
|
||||
//header('Content-Type: application/json; charset=utf-8');
|
||||
return json_encode($json, JSON_HEX_APOS);
|
||||
}
|
||||
|
||||
public function renderTwig($view, $data)
|
||||
{
|
||||
$paths = new \SplPriorityQueue;
|
||||
|
||||
$paths->insert(VIEW_PATH . DIRECTORY_SEPARATOR . "system", 100);
|
||||
$paths->insert(VIEW_PATH . DIRECTORY_SEPARATOR . "layout", 200);
|
||||
$paths->insert(VIEW_PATH . DIRECTORY_SEPARATOR . "view", 300);
|
||||
|
||||
$renderer = new \Windwalker\Renderer\TwigRenderer($paths);
|
||||
$view .= '.html';
|
||||
|
||||
return $renderer->render($view, $data);
|
||||
}
|
||||
|
||||
public function renderBlade($view, $data)
|
||||
{
|
||||
$paths = new \SplPriorityQueue;
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
|
||||
namespace MVC\Classe;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\Date;
|
||||
|
||||
class Logger
|
||||
{
|
||||
public static function addLog($type = 'default', $what = "")
|
||||
|
@ -28,14 +26,14 @@ class Logger
|
|||
*/
|
||||
public static function logCommandErrors(array $errors)
|
||||
{
|
||||
// log connection errors to the web service
|
||||
// log connection errors
|
||||
ob_start();
|
||||
foreach ($errors as $key => $value) {
|
||||
echo "\n\n$key : \n";
|
||||
print_r($value);
|
||||
}
|
||||
$write_string = ob_get_clean();
|
||||
file_put_contents(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "logs" . DIRECTORY_SEPARATOR . "errors_command.log", $write_string);
|
||||
file_put_contents(OUTPUT_PATH . DIRECTORY_SEPARATOR . "logs" . DIRECTORY_SEPARATOR . "errors_command.log", $write_string);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Package MVC\Classe
|
||||
* @author Emmanuel ROY
|
||||
* @license MIT-licence (open source)
|
||||
* @version 3.5
|
||||
*/
|
||||
|
||||
namespace MVC\Classe;
|
||||
|
||||
class Modele
|
||||
|
@ -16,7 +23,7 @@ class Modele
|
|||
//on recherche le pattern des tableau dans la valeur du paramètre
|
||||
// dans le cas ou la déclaration se fait sur une seule ligne
|
||||
if (preg_match("#{.*}#", $matches[2])) {
|
||||
if (preg_match_all("#(?<capture>[0-9a-zA-ZÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ_+\-]*)#", $matches[2], $arrayMatches)) {
|
||||
if (preg_match_all("#(?<capture>[0-9a-zA-ZÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ_+\- ']*)#", $matches[2], $arrayMatches)) {
|
||||
$array = array();
|
||||
foreach ($arrayMatches['capture'] as $val) {
|
||||
if ($val != '') {
|
||||
|
@ -30,11 +37,21 @@ class Modele
|
|||
$this->page[$matches[1]] = $matches[2];
|
||||
}
|
||||
}
|
||||
$this->page['url_params'] = $base_param['params'];
|
||||
|
||||
$this->page['all_params'] = $base_param['params'];
|
||||
//export nom a nom les variable dans la superglobale $_GET
|
||||
foreach($base_param['params'] as $key => $value){
|
||||
$_GET[$key] = $value;
|
||||
}
|
||||
} else {
|
||||
$this->page['name'] = $base_param['name'];
|
||||
$this->page['description'] = $base_param['description'];
|
||||
$this->page['params'] = $base_param['params'];
|
||||
$this->page['all_params'] = $base_param['params'];
|
||||
//export nom a nom les variable dans la superglobale $_GET
|
||||
foreach($base_param['params'] as $key => $value){
|
||||
$_GET[$key] = $value;
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,8 +15,12 @@ class Modular
|
|||
|
||||
$this->app = $appName;
|
||||
switch ($type) {
|
||||
case "gitlist":
|
||||
break;
|
||||
case "symfony":
|
||||
break;
|
||||
case "laravel":
|
||||
break;
|
||||
case "wordpress":
|
||||
if (isset($options[0])) {
|
||||
switch ($options[0]) {
|
||||
|
@ -90,25 +94,69 @@ class Modular
|
|||
|
||||
public function load($type = "symfony")
|
||||
{
|
||||
global $buffer_sand;
|
||||
switch ($type) {
|
||||
case "gitlist":
|
||||
ob_start(array('\\MVC\\Classe\\Modular', 'rappel'),0,PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_FLUSHABLE);
|
||||
$level = ob_get_level();
|
||||
require MODULES_PATH . DIRECTORY_SEPARATOR . $this->getAppName() . DIRECTORY_SEPARATOR . "index.php";
|
||||
break;
|
||||
case "symfony":
|
||||
require MODULES_PATH . DIRECTORY_SEPARATOR . $this->getAppName() . DIRECTORY_SEPARATOR . "public" . DIRECTORY_SEPARATOR . "index.php";
|
||||
break;
|
||||
ob_start(array('\\MVC\\Classe\\Modular', 'rappel'),0,PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_FLUSHABLE);
|
||||
$level = ob_get_level();
|
||||
$path = MODULES_PATH . DIRECTORY_SEPARATOR . $this->getAppName() . DIRECTORY_SEPARATOR . "public" . DIRECTORY_SEPARATOR . "index.php";
|
||||
return require MODULES_PATH . DIRECTORY_SEPARATOR . $this->getAppName() . DIRECTORY_SEPARATOR . "public" . DIRECTORY_SEPARATOR . "index.php";
|
||||
break;
|
||||
case "laravel":
|
||||
ob_start(array('\\MVC\\Classe\\Modular', 'rappel'),0,PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_FLUSHABLE);
|
||||
$level = ob_get_level();
|
||||
require MODULES_PATH . DIRECTORY_SEPARATOR . $this->getAppName() . DIRECTORY_SEPARATOR . "public" . DIRECTORY_SEPARATOR . "index.php";
|
||||
break;
|
||||
case "wordpress":
|
||||
ob_start(array('\\MVC\\Classe\\Modular', 'rappel'),0,PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_FLUSHABLE);
|
||||
$level = ob_get_level();
|
||||
require MODULES_PATH . DIRECTORY_SEPARATOR . $this->getAppName() . $this->subapp_dir . DIRECTORY_SEPARATOR . $this->subfile;
|
||||
break;
|
||||
case "prestashop":
|
||||
ob_start(array('\\MVC\\Classe\\Modular', 'rappel'),0,PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_FLUSHABLE);
|
||||
$level = ob_get_level();
|
||||
require MODULES_PATH . DIRECTORY_SEPARATOR . $this->getAppName() . $this->subapp_dir . DIRECTORY_SEPARATOR . "index.php";
|
||||
break;
|
||||
case "phplist":
|
||||
ob_start(array('\\MVC\\Classe\\Modular', 'rappel'),0,PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_FLUSHABLE);
|
||||
$level = ob_get_level();
|
||||
require MODULES_PATH . DIRECTORY_SEPARATOR . $this->getAppName() . $this->subapp_dir . DIRECTORY_SEPARATOR . "index.php";
|
||||
break;
|
||||
case "wanewsletter":
|
||||
ob_start(array('\\MVC\\Classe\\Modular', 'rappel'),0,PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_FLUSHABLE);
|
||||
$level = ob_get_level();
|
||||
require MODULES_PATH . DIRECTORY_SEPARATOR . $this->getAppName() . $this->subapp_dir . DIRECTORY_SEPARATOR . $this->subfile;
|
||||
break;
|
||||
case "phpmynewsletter":
|
||||
ob_start(array('\\MVC\\Classe\\Modular', 'rappel'),0,PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_FLUSHABLE);
|
||||
$level = ob_get_level();
|
||||
require MODULES_PATH . DIRECTORY_SEPARATOR . $this->getAppName() . $this->subapp_dir . DIRECTORY_SEPARATOR . $this->subfile;
|
||||
break;
|
||||
}
|
||||
$buffer_sand = "";
|
||||
if (ob_get_level() == $level) {
|
||||
if (ob_get_level() > 1) {
|
||||
$buffer_sand = ob_get_contents();
|
||||
ob_end_clean();
|
||||
} else {
|
||||
$buffer_sand = "BUFFER CLOSURE BY FRAMEWORK !<br/>".$buffer_sand;
|
||||
}
|
||||
}else{
|
||||
$final_level = ob_get_level();
|
||||
$buffer_sand = "BUFFER LEVEL $level CLOSURE $final_level BY FRAMEWORK !<br/>".$buffer_sand;
|
||||
}
|
||||
return $buffer_sand;
|
||||
}
|
||||
public static function rappel($buffer)
|
||||
{
|
||||
global $buffer_sand;
|
||||
$buffer_sand = $buffer;
|
||||
// remplace toutes les pommes par des carottes
|
||||
return $buffer;
|
||||
}
|
||||
}
|
||||
|
|
84
application/class/TwigControlleurAction.php
Normal file
84
application/class/TwigControlleurAction.php
Normal file
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace MVC\Classe;
|
||||
|
||||
|
||||
/**
|
||||
* Class MyActionTwigExtension
|
||||
* with call {{ static_call("AppBundle\Entity\YourEntity", "GetSomething", ["var1", "var2"]) }}
|
||||
* other {{ action("AppBundle\Entity\YourEntity", "GetSomething", ["var1", "var2"]) }}
|
||||
*
|
||||
* @package MVC\Classe
|
||||
*/
|
||||
|
||||
class TwigControlleurAction extends \Twig\Extension\AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Returns a list of functions to add to the existing list.
|
||||
*
|
||||
* @return \Twig\TwigFunction[]
|
||||
*/
|
||||
public function getFunctions() {
|
||||
return array(
|
||||
new \Twig\TwigFunction("action", array($this, "inserer")),
|
||||
new \Twig\TwigFunction("call", array($this, "getClassMethodStatic")),
|
||||
new \Twig\TwigFunction("session", array($this, "afficheSession")),
|
||||
new \Twig\TwigFunction("server", array($this, "afficheServer"))
|
||||
);
|
||||
}
|
||||
|
||||
public function afficheServer($key_var = ''){
|
||||
if($key_var !== ""){
|
||||
if(isset($_SERVER[$key_var])) {
|
||||
return $_SERVER[$key_var];
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}else {
|
||||
return $_SERVER;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function afficheSession($key_var = ''){
|
||||
if($key_var !== ""){
|
||||
if(isset($_SESSION[$key_var])) {
|
||||
return $_SESSION[$key_var];
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}else {
|
||||
return $_SESSION;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function inserer($action, $data = array())
|
||||
{
|
||||
//on extrait la classe d'appel de l'action
|
||||
$action = explode('.', $action);
|
||||
$class = ucfirst($action[0]) . "Action";
|
||||
//TODO: use try ... catch with \MVC\Classe\Logger to log error
|
||||
if (is_file(ACTION_PATH . DIRECTORY_SEPARATOR . $class . ".php")) {
|
||||
require_once ACTION_PATH . DIRECTORY_SEPARATOR . $class . ".php";
|
||||
//On charge la classe Action de façon réflextive
|
||||
$slot = new $class();
|
||||
//si l'action passé en parametre est fournit avec une methode pointée on charge celle demandée sinon on charge celle par defaut
|
||||
if (isset($action[1])) {
|
||||
$method = $action[1];
|
||||
//On appel la méthode de la classe action de manière reflextive
|
||||
return $slot->$method(...$data);
|
||||
} else {
|
||||
return $slot->default(...$data);
|
||||
}
|
||||
} else {
|
||||
/*HandleError*/
|
||||
}
|
||||
}
|
||||
public static function getClassMethodStatic($class, $method, $args = array())
|
||||
{
|
||||
return $class::$method(...$args);
|
||||
}
|
||||
}
|
|
@ -1,8 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace MVC\Classe;
|
||||
/**
|
||||
* Package MVC\Classe
|
||||
* @author Emmanuel ROY
|
||||
* @license MIT-licence (open source)
|
||||
* @version 3.5
|
||||
*/
|
||||
|
||||
//require_once dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR."config".DIRECTORY_SEPARATOR."define-constantes.php";
|
||||
namespace MVC\Classe;
|
||||
|
||||
class Url
|
||||
{
|
||||
|
@ -37,32 +42,47 @@ class Url
|
|||
}
|
||||
}
|
||||
|
||||
//print_r($urlParts);
|
||||
//Récupération du nom de la page
|
||||
if (isset($urlParts[0])) {
|
||||
//Récupération du nom de la page
|
||||
($urlParts[0] == 'index' || $urlParts[0] == '') ? $page['name'] = 'index' : $page['name'] = $urlParts[0];
|
||||
//il se peut que l'on ait des variable avec ? dans l'url
|
||||
$urlQuery = explode('?', $urlParts[0]);
|
||||
$urlQueryPageName = $urlQuery[0];
|
||||
($urlQueryPageName == 'index' || $urlQueryPageName == '') ? $page['name'] = 'index' : $page['name'] = $urlQueryPageName;
|
||||
unset($urlParts[0]);
|
||||
} else {
|
||||
$page['name'] = 'index';
|
||||
}
|
||||
|
||||
//il se peut que l'on ait des variable avec ? dans l'url
|
||||
$urlQuery = explode('?', $page['name']);
|
||||
$page['name'] = $urlQuery[0];
|
||||
|
||||
$page['name'] = strtolower($page['name']);
|
||||
|
||||
//si c'est une page de controle de formulaire : on renomme la page
|
||||
if ($page['name'] == 'control') {
|
||||
$page['control'] = true;
|
||||
($urlParts[1] == 'index' || $urlParts[1] == '') ? $page['name']='index' : $page['name']=$urlParts[1];
|
||||
unset($urlParts[1]);
|
||||
}
|
||||
|
||||
//Mise en place du statut de l'application
|
||||
switch(APP_STATE){
|
||||
case "CLOSED":
|
||||
$page['name'] = "error-application-closed";
|
||||
break;
|
||||
case "MAINTAINED":
|
||||
$page['name'] = "error-application-maintained";
|
||||
break;
|
||||
case "OPEN":
|
||||
if(\MVC\Classe\Application::is_under_update()) {
|
||||
$page['name'] = "error-application-maintained";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
}
|
||||
|
||||
//vérification du nombre de parametres:
|
||||
$numParts = count($urlParts);
|
||||
//s'il n'existe pas autant de clé que de valeurs, ce peut ^etre un module symfony
|
||||
//s'il n'existe pas autant de clé que de valeurs, ce peut ^etre un module symfony ou tout autre module
|
||||
if ($numParts%2 != 0) {
|
||||
//si un module symfony n'est pas reférencé avec le nom de la page, on renvoi un erreur
|
||||
//si un module symfony n'est pas reférencé avec le nom de la page, on renvoi une erreur
|
||||
if (!in_array($page['name'], $this->registre->getIndex())) {
|
||||
$page['name'] = 'error';
|
||||
$page['params'] = array();
|
||||
|
@ -70,9 +90,10 @@ class Url
|
|||
return;
|
||||
} else {
|
||||
foreach ($urlParts as $key => $value) {
|
||||
$values[] = $value;
|
||||
$keys[] = $key;
|
||||
$values[] = $value;
|
||||
//$keys[] = $key;
|
||||
}
|
||||
//$page['params'] = array_combine($keys, $values);
|
||||
$page['params'] = $values;
|
||||
}
|
||||
|
||||
|
@ -80,15 +101,6 @@ class Url
|
|||
} elseif ($numParts != 0) {
|
||||
// si c'est un module alors on charge un a un les parametres
|
||||
if (in_array($page['name'], $this->registre->getIndex())) {
|
||||
foreach ($urlParts as $key => $value) {
|
||||
$values[] = $value;
|
||||
$keys[] = $key;
|
||||
}
|
||||
$page['params'] = $values;
|
||||
// sinon c'est une page normal du framework
|
||||
} else {
|
||||
$values = array();
|
||||
$keys = array();
|
||||
foreach ($urlParts as $key => $value) {
|
||||
if ($key % 2 == 0) {
|
||||
$values[] = $value;
|
||||
|
@ -96,11 +108,29 @@ class Url
|
|||
$keys[] = $value;
|
||||
}
|
||||
}
|
||||
if ($page['control']) {
|
||||
$page['params'] = array_combine($values, $keys);
|
||||
} else {
|
||||
$page['params'] = array_combine($keys, $values);
|
||||
$page['params'] = array_combine($keys, $values);
|
||||
// sinon c'est une page normal du framework
|
||||
} else {
|
||||
$values = array();
|
||||
$keys = array();
|
||||
if($page['control']){
|
||||
foreach ($urlParts as $key => $value) {
|
||||
if ($key % 2 == 1) {
|
||||
$values[] = $value;
|
||||
} else {
|
||||
$keys[] = $value;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
foreach ($urlParts as $key => $value) {
|
||||
if ($key % 2 == 0) {
|
||||
$values[] = $value;
|
||||
} else {
|
||||
$keys[] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
$page['params'] = array_combine($keys, $values);
|
||||
}
|
||||
}
|
||||
$page['name'] = lcfirst($page['name']);
|
||||
|
@ -112,29 +142,60 @@ class Url
|
|||
//recherche du fichier controlleur correpondant HTTP1.1 ou HTTP1.0
|
||||
switch ($method) {
|
||||
//cas des requètes HTTP1.1
|
||||
case 'PUT':
|
||||
case 'DELETE':
|
||||
case 'GET':
|
||||
case 'POST':
|
||||
if ($appRequest) {
|
||||
$page['name'] = ucfirst($page['name']);
|
||||
$pageFile = CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'HttpReponse.php';
|
||||
$pageFile = CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'RestReponse.php';
|
||||
if (!file_exists($pageFile)) {
|
||||
$pageFile = CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'HttpReponse.php';
|
||||
}
|
||||
} else {
|
||||
$page['name'] = lcfirst($page['name']);
|
||||
$pageFile = CONTROLLERS_PATH . DIRECTORY_SEPARATOR . $page['name'] . '.php';
|
||||
if (!file_exists($pageFile)) {
|
||||
$page['name'] = ucfirst($page['name']);
|
||||
$pageFile = CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'HttpReponse.php';
|
||||
$pageFile = CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'RestReponse.php';
|
||||
if (!file_exists($pageFile)) {
|
||||
$pageFile = CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'HttpReponse.php';
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'PUT':
|
||||
case 'DELETE':
|
||||
$page['name'] = ucfirst($page['name']);
|
||||
$pageFile = CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'RestReponse.php';
|
||||
}
|
||||
}
|
||||
|
||||
//Test sur l'existence de la page actuelle et renvoi sur le controlleur 404 d'erreur si besoin
|
||||
if (!file_exists($pageFile)) {
|
||||
if ($appRequest) {
|
||||
$page['name'] = 'Error';
|
||||
$pageFile = CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'RestReponse.php';
|
||||
if (!file_exists($pageFile)) {
|
||||
$pageFile = CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'HttpReponse.php';
|
||||
}
|
||||
} else {
|
||||
$page['name'] = 'error';
|
||||
$pageFile = CONTROLLERS_PATH . DIRECTORY_SEPARATOR . $page['name'] . '.php';
|
||||
if (!file_exists($pageFile)) {
|
||||
$page['name'] = ucfirst($page['name']);
|
||||
$pageFile = CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'RestReponse.php';
|
||||
if (!file_exists($pageFile)) {
|
||||
$pageFile = CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'HttpReponse.php';
|
||||
if (!file_exists($pageFile)) {
|
||||
//FrameWork : expose undefined controlleur error
|
||||
// TODO: Send SANDerror
|
||||
die("le controlleur 404 d'erreur n'existe pas : \n"
|
||||
. CONTROLLERS_PATH . DIRECTORY_SEPARATOR . $page['name'] . '.php' . "\n"
|
||||
. "ou l'un des controlleurs 404 (REST ou HTTP) n'existe pas : \n"
|
||||
. CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'RestReponse.php \n'
|
||||
. " ou \n"
|
||||
. CONTROLLER_PATH . DIRECTORY_SEPARATOR . $page['name'] . 'HttpReponse.php');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->page = $page;
|
||||
|
@ -155,15 +216,6 @@ class Url
|
|||
}
|
||||
}
|
||||
|
||||
public static function module_link_rewrite($page, $params = array())
|
||||
{
|
||||
$stringParams = '';
|
||||
foreach ($params as $values) {
|
||||
$stringParams .= "/" . $values;
|
||||
}
|
||||
return '/' . BASE_SERVER_DIRECTORY . $page . $stringParams;
|
||||
}
|
||||
|
||||
private static function link_rewrite_slashParam($page, $params = array())
|
||||
{
|
||||
$stringParams = '';
|
||||
|
@ -184,18 +236,112 @@ class Url
|
|||
|
||||
public static function absolute_link_rewrite($isControlPatern, $page, $params = array())
|
||||
{
|
||||
$url = $_SERVER['HTTP_HOST'];
|
||||
if(isset($_SERVER['HTTP_HOST'])) {
|
||||
$url = $_SERVER['HTTP_HOST'];
|
||||
if (isset($_SERVER['REQUEST_SCHEME'])) {
|
||||
$scheme = $_SERVER['REQUEST_SCHEME'];
|
||||
} else {
|
||||
$scheme = 'http';
|
||||
}
|
||||
$scheme_tab = explode("://",PATH_URL);
|
||||
if( $scheme !== $scheme_tab[0]){
|
||||
$scheme = $scheme_tab[0];
|
||||
}
|
||||
$url = $scheme . "://" . $url;
|
||||
}else{
|
||||
$url = PATH_URL;
|
||||
}
|
||||
if( substr($url , -1) == "/"){
|
||||
$url = substr($url, 0, -1);
|
||||
}
|
||||
if ($isControlPatern) {
|
||||
$uri = self::controlLink_rewrite($page, $params);
|
||||
} else {
|
||||
$uri = self::link_rewrite_slashParam($page, $params);
|
||||
}
|
||||
if (isset($_SERVER['REQUEST_SCHEME'])) {
|
||||
$scheme = $_SERVER['REQUEST_SCHEME'];
|
||||
} else {
|
||||
$scheme = 'http';
|
||||
|
||||
|
||||
return ( $url . $uri);
|
||||
}
|
||||
|
||||
public static function getBaseDirectory(){
|
||||
return '/' . BASE_SERVER_DIRECTORY;
|
||||
}
|
||||
|
||||
public static function getRootDirectoryUrl(){
|
||||
if(isset($_SERVER['HTTP_HOST'])) {
|
||||
$url = $_SERVER['HTTP_HOST'];
|
||||
if (isset($_SERVER['REQUEST_SCHEME'])) {
|
||||
$scheme = $_SERVER['REQUEST_SCHEME'];
|
||||
} else {
|
||||
$scheme = 'http';
|
||||
}
|
||||
$scheme_tab = explode("://",PATH_URL);
|
||||
if( $scheme !== $scheme_tab[0]){
|
||||
$scheme = $scheme_tab[0];
|
||||
}
|
||||
$url = $scheme . "://" . $url;
|
||||
}else{
|
||||
$url = PATH_URL;
|
||||
}
|
||||
if( substr($url , -1) == "/"){
|
||||
$url = substr($url, 0, -1);
|
||||
}
|
||||
if( substr($url . "/" . BASE_SERVER_DIRECTORY, -1) == "/"){
|
||||
return substr($url . "/" . BASE_SERVER_DIRECTORY, 0, -1);
|
||||
}else {
|
||||
return $url . "/" . BASE_SERVER_DIRECTORY;
|
||||
}
|
||||
}
|
||||
|
||||
public static function getPageName(){
|
||||
|
||||
$url = parse_url($_SERVER['REQUEST_URI']);
|
||||
$urlTrim = trim($url['path'], '/');
|
||||
$urlParts = explode('/', $urlTrim);
|
||||
|
||||
//suppression des sous repertoires du BASE_SERVER_DIRECTORY
|
||||
$basePath = explode( '/', BASE_SERVER_DIRECTORY);
|
||||
foreach($basePath as $subDir) {
|
||||
if ($urlParts[0] == $subDir) {
|
||||
array_shift($urlParts);
|
||||
}
|
||||
}
|
||||
|
||||
return ($scheme . "://" . BASE_SERVER_DIRECTORY . $url . $uri);
|
||||
//Récupération du nom de la page
|
||||
if (isset($urlParts[0])) {
|
||||
//il se peut que l'on ait des variable avec ? dans l'url
|
||||
$urlQuery = explode('?', $urlParts[0]);
|
||||
$urlQueryPageName = $urlQuery[0];
|
||||
($urlQueryPageName == 'index' || $urlQueryPageName == '') ? $page['name'] = 'index' : $page['name'] = $urlQueryPageName;
|
||||
unset($urlParts[0]);
|
||||
} else {
|
||||
$page['name'] = 'index';
|
||||
}
|
||||
|
||||
$page['name'] = strtolower($page['name']);
|
||||
|
||||
//si c'est une page de controle de formulaire : on renomme la page
|
||||
if ($page['name'] == 'control') {
|
||||
$page['control'] = true;
|
||||
($urlParts[1] == 'index' || $urlParts[1] == '') ? $page['name']='index' : $page['name']=$urlParts[1];
|
||||
unset($urlParts[1]);
|
||||
}
|
||||
return $page;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtiens le fragment depuis une variable serveur,
|
||||
* ce qui est selon moi possible avec une bonne configuration serveur
|
||||
* sauf si le fragment est bloqué au niveau du navigateur (rétention d'informations)
|
||||
*
|
||||
* Selon QASTACK
|
||||
* => https://qastack.fr/programming/2317508/get-fragment-value-after-hash-from-a-url-in-php
|
||||
* ce n'est pas possible avec HTTP "standard" car cette valeur n'est jamais envoyée au serveur
|
||||
* (par conséquent, elle ne sera pas disponible dans $_SERVER["REQUEST_URI"]ou similaire variables prédéfinies)
|
||||
*/
|
||||
public static function getFragment(){
|
||||
$fragment = parse_url($_SERVER['REQUEST_URI'],PHP_URL_FRAGMENT);
|
||||
return $fragment;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Package MVC\Classe
|
||||
* @author Emmanuel ROY
|
||||
* @license MIT-licence (open source)
|
||||
* @version 3.5
|
||||
*/
|
||||
|
||||
namespace MVC\Classe;
|
||||
|
||||
class Vue
|
||||
|
@ -7,47 +14,70 @@ class Vue
|
|||
public $ecran;
|
||||
public $block_body;
|
||||
|
||||
public function __construct($application)
|
||||
public function __construct($page_params)
|
||||
{
|
||||
$templateData = array();
|
||||
extract($application->modele->page);
|
||||
//$templateData = array();
|
||||
$url_params = array();
|
||||
$templateData = $page_params;
|
||||
|
||||
extract($page_params);
|
||||
//de base on ajoute les parametres du .model et ceux provenant de l'url
|
||||
foreach ($page_params['all_params'] as $key => $value) {
|
||||
//$templateData[$key] = $value;
|
||||
$_GET[$key] = $value;
|
||||
$url_params[$key] = $value;
|
||||
}
|
||||
|
||||
|
||||
if(!isset($engine)){$engine = 'blade';}
|
||||
$flag_exist = false;
|
||||
switch ($engine){
|
||||
case 'twig':
|
||||
if (file_exists(VIEW_PATH.DIRECTORY_SEPARATOR."view".DIRECTORY_SEPARATOR.$name.".html.twig")) {
|
||||
$flag_exist = true;
|
||||
}
|
||||
break;
|
||||
case 'blade':
|
||||
default:
|
||||
if (file_exists(VIEW_PATH.DIRECTORY_SEPARATOR."view".DIRECTORY_SEPARATOR.$name.".blade.php")) {
|
||||
$flag_exist = true;
|
||||
}
|
||||
}
|
||||
|
||||
ob_start();
|
||||
if (file_exists(VIEW_PATH.DIRECTORY_SEPARATOR."view".DIRECTORY_SEPARATOR.$name.".blade.php")) {
|
||||
|
||||
if($flag_exist){
|
||||
//l'inclusion du controlleur doit renvoyer le tableau $templateData
|
||||
require CONTROLLER_PATH . DIRECTORY_SEPARATOR . $name . '.php';
|
||||
|
||||
|
||||
|
||||
//TEMPLATING BLADE
|
||||
//WINWALKER TEMPLATING ENGINE
|
||||
$paths = new \SplPriorityQueue;
|
||||
|
||||
$paths->insert(VIEW_PATH . DIRECTORY_SEPARATOR . "system", 100);
|
||||
$paths->insert(VIEW_PATH . DIRECTORY_SEPARATOR . "layout", 200);
|
||||
$paths->insert(VIEW_PATH . DIRECTORY_SEPARATOR . "view", 300);
|
||||
|
||||
if(!isset($engine)){$engine = 'blade';}
|
||||
|
||||
switch ($engine){
|
||||
case 'twig':
|
||||
$renderer = new \Windwalker\Renderer\TwigRenderer($paths);
|
||||
$renderer->addExtension(new \MVC\Classe\TwigControlleurAction);
|
||||
$name .= '.html';
|
||||
break;
|
||||
case 'blade':
|
||||
default:
|
||||
$renderer = new \Windwalker\Renderer\BladeRenderer($paths, array('cache_path' => VIEW_PATH . DIRECTORY_SEPARATOR . "cache"));
|
||||
$renderer = new \Windwalker\Renderer\BladeRenderer($paths, array('cache_path' => VIEW_PATH . DIRECTORY_SEPARATOR . "cache"));
|
||||
}
|
||||
|
||||
|
||||
//de base on ajoute les parametres du .model et ceux provenant de l'url
|
||||
foreach ($application->modele->page as $key => $value) {
|
||||
foreach ($page_params as $key => $value) {
|
||||
$templateData[$key] = $value;
|
||||
}
|
||||
|
||||
//WINWALKER TEMPLATING ENGINE RENDER
|
||||
echo $renderer->render($name, $templateData);
|
||||
} else {
|
||||
include CONTROLLER_PATH . DIRECTORY_SEPARATOR . $name . '.php';
|
||||
}
|
||||
$this->ecran = ob_get_clean();
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
<?php
|
||||
|
||||
|
||||
// De base laisser vide,
|
||||
// sauf si l'application est hebergé sur de multiples sous-repertoire en ajoutant le slash_final
|
||||
// par exemple : "my-app/"
|
||||
// ou : "my-app/dev/
|
||||
define("BASE_SERVER_DIRECTORY", "");
|
||||
|
||||
// Optionnel! il n'est nécessaire que si vous l'utilisez dans les fichier de traitement
|
||||
define('PATH_URL', $_SERVER['REQUEST_SCHEME'] . "://www.domain.org");
|
23
application/config/app-parameters.php.skel
Normal file
23
application/config/app-parameters.php.skel
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
|
||||
// De base laisser vide,
|
||||
// sauf si l'application est hebergé sur de multiples sous-repertoire en ajoutant le slash_final
|
||||
// par exemple : "my-app/"
|
||||
// ou : "my-app/dev/
|
||||
define("BASE_SERVER_DIRECTORY", "");
|
||||
|
||||
// Optionnel! il n'est nécessaire que si vous l'utilisez dans les fichiers de traitement ou dans une commande console
|
||||
define('PATH_URL', $_SERVER['REQUEST_SCHEME'] . "://localhost.localdomain");
|
||||
|
||||
|
||||
//Possible values are DEV DEVEL PROD PREPROD TEST
|
||||
//only PROD send email to right user
|
||||
define('ENV', "DEV");
|
||||
|
||||
//Possible values are OPEN CLOSED MAINTAINED
|
||||
define('APP_STATE', "OPEN");
|
||||
|
||||
define('MAINTENANCE_DATE_DEBUT', '2021-07-30 12:00');
|
||||
define('MAINTENANCE_DATE_FIN', '2021-07-30 14:00');
|
||||
define('MAINTENANCE_MESSAGE', "Mise à jour de la base de données");
|
|
@ -11,4 +11,4 @@ define('PASS_BDD1', "pass1");
|
|||
|
||||
define('DSN_BDD2', "mysql:host=localhost;dbname=db2");
|
||||
define('USER_BDD2', "user2");
|
||||
define('PASS_BDD2', "pass2");
|
||||
define('PASS_BDD2', "pass2");
|
|
@ -24,7 +24,7 @@ $phpcas_path = '../../source/';
|
|||
///////////////////////////////////////
|
||||
|
||||
// Full Hostname of your CAS Server
|
||||
$cas_host = 'cas.domain.fr';
|
||||
$cas_host = 'cas.localdomain';
|
||||
// Context of the CAS Server
|
||||
$cas_context = 'cas';
|
||||
// Port of your CAS server. Normally for a https server it's 443
|
||||
|
@ -54,49 +54,7 @@ $db_user = 'phpcasuser';
|
|||
$db_password = 'mysupersecretpass';
|
||||
$db_table = 'phpcastabel';
|
||||
$driver_options = '';
|
||||
|
||||
*/
|
||||
///////////////////////////////////////////
|
||||
// End Configuration -- Don't edit below //
|
||||
///////////////////////////////////////////
|
||||
|
||||
// Generating the URLS for the local cas example services for proxy testing
|
||||
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
|
||||
$curbase = 'https://' . $_SERVER['SERVER_NAME'];
|
||||
} else {
|
||||
$curbase = 'http://' . $_SERVER['SERVER_NAME'];
|
||||
}
|
||||
if ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) {
|
||||
$curbase .= ':' . $_SERVER['SERVER_PORT'];
|
||||
}
|
||||
|
||||
$curdir = dirname($_SERVER['REQUEST_URI']) . "/";
|
||||
|
||||
// CAS client nodes for rebroadcasting pgtIou/pgtId and logoutRequest
|
||||
$rebroadcast_node_1 = 'http://cas-client-1.example.com';
|
||||
$rebroadcast_node_2 = 'http://cas-client-2.example.com';
|
||||
|
||||
// access to a single service
|
||||
$serviceUrl = $curbase . $curdir . 'example_service.php';
|
||||
// access to a second service
|
||||
$serviceUrl2 = $curbase . $curdir . 'example_service_that_proxies.php';
|
||||
|
||||
$pgtBase = preg_quote(preg_replace('/^http:/', 'https:', $curbase . $curdir), '/');
|
||||
$pgtUrlRegexp = '/^' . $pgtBase . '.*$/';
|
||||
|
||||
$cas_url = 'https://' . $cas_host;
|
||||
if ($cas_port != '443') {
|
||||
$cas_url = $cas_url . ':' . $cas_port;
|
||||
}
|
||||
$cas_url = $cas_url . $cas_context;
|
||||
|
||||
// Set the session-name to be unique to the current script so that the client script
|
||||
// doesn't share its session with a proxied script.
|
||||
// This is just useful when running the example code, but not normally.
|
||||
session_name(
|
||||
'session_for-'
|
||||
. preg_replace('/[^a-z0-9-]/i', '_', basename($_SERVER['SCRIPT_NAME']))
|
||||
);
|
||||
// Set an UTF-8 encoding header for internation characters (User attributes)
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
?>
|
||||
*/
|
||||
///////////////////////////////////////////
|
3
application/config/console-parameters.php.skel
Normal file
3
application/config/console-parameters.php.skel
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
define("LINE_FEED", "\n");
|
|
@ -13,5 +13,5 @@ define("CONTROLLER_PATH", APPLICATION_PATH . DIRECTORY_SEPARATOR . "include" . D
|
|||
define("TRAITEMENT_PATH", APPLICATION_PATH . DIRECTORY_SEPARATOR . "traitements");
|
||||
define("PUBLIC_PATH", dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "public");
|
||||
define("CONSOLE_PATH", dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "console");
|
||||
define("OUTPUT_PATH", dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "output");
|
||||
define("DATA_PATH", dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . "data");
|
||||
|
6
application/config/ldap-parameters.php
Normal file
6
application/config/ldap-parameters.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
define('LDAP_USER','cn=name, ou=group, dc=domain, dc=tld');
|
||||
define('LDAP_PASSWORD','password');
|
||||
define('LDAP_URL',"ldap://ldap.domain.tld");
|
||||
define('LDAP_PORT',"389");
|
6
application/config/ldap-parameters.php.skel
Normal file
6
application/config/ldap-parameters.php.skel
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
define('LDAP_USER','cn=name, ou=group, dc=domain, dc=tld');
|
||||
define('LDAP_PASSWORD','password');
|
||||
define('LDAP_URL',"ldap://ldap.domain.tld");
|
||||
define('LDAP_PORT',"389");
|
|
@ -1,28 +1,86 @@
|
|||
<?php
|
||||
|
||||
use MVC\Classe\Dumper;
|
||||
use MVC\Classe\HttpMethodRequete;
|
||||
use MVC\Classe\Implement\Action;
|
||||
use MVC\Classe\Url;
|
||||
use MVC\Classe\Response;
|
||||
|
||||
class DefaultAction extends Action
|
||||
class DefaultAction extends \MVC\Classe\Implement\Action
|
||||
{
|
||||
public function default($data)
|
||||
public function default()
|
||||
{
|
||||
/**your action algorythm**/
|
||||
if (isset($data[0])) {
|
||||
$var1 = $data[0];
|
||||
if (isset($data1)) {
|
||||
$var1 = $data1;
|
||||
} else {
|
||||
$var1 = 1;
|
||||
}
|
||||
if (isset($data[1])) {
|
||||
$var2 = $data[1];
|
||||
if (isset($data2)) {
|
||||
$var2 = $data2;
|
||||
} else {
|
||||
$var2 = 2;
|
||||
}
|
||||
if (isset($data[2])) {
|
||||
$var3 = $data[2];
|
||||
if (isset($data3)) {
|
||||
$var3 = $data3;
|
||||
} else {
|
||||
$var3 = 3;
|
||||
}
|
||||
|
||||
return $this->render('action', array('var1' => $var1, 'var2' => $var2, 'var3' => $var3));
|
||||
}
|
||||
public function defaultBlade($data1,$data2,$data3)
|
||||
{
|
||||
/**your action algorythm**/
|
||||
if (isset($data1)) {
|
||||
$var1 = $data1;
|
||||
} else {
|
||||
$var1 = 1;
|
||||
}
|
||||
if (isset($data2)) {
|
||||
$var2 = $data2;
|
||||
} else {
|
||||
$var2 = 2;
|
||||
}
|
||||
if (isset($data3)) {
|
||||
$var3 = $data3;
|
||||
} else {
|
||||
$var3 = 3;
|
||||
}
|
||||
|
||||
return $this->render('action', array('var1' => $var1, 'var2' => $var2, 'var3' => $var3),'blade');
|
||||
}
|
||||
public function defaultTwig($data1,$data2,$data3)
|
||||
{
|
||||
/**your action algorythm**/
|
||||
if (isset($data1)) {
|
||||
$var1 = $data1;
|
||||
} else {
|
||||
$var1 = 1;
|
||||
}
|
||||
if (isset($data2)) {
|
||||
$var2 = $data2;
|
||||
} else {
|
||||
$var2 = 2;
|
||||
}
|
||||
if (isset($data3)) {
|
||||
$var3 = $data3;
|
||||
} else {
|
||||
$var3 = 3;
|
||||
}
|
||||
|
||||
return $this->render('action', array('var1' => $var1, 'var2' => $var2, 'var3' => $var3),'twig');
|
||||
}
|
||||
|
||||
public function variableSlug($data1,$data2,$data3)
|
||||
{
|
||||
/**your action algorythm**/
|
||||
if (isset($data1)) {
|
||||
$var1 = $data1;
|
||||
} else {
|
||||
$var1 = 1;
|
||||
}
|
||||
if (isset($data2)) {
|
||||
$var2 = $data2;
|
||||
} else {
|
||||
$var2 = 2;
|
||||
}
|
||||
if (isset($data3)) {
|
||||
$var3 = $data3;
|
||||
} else {
|
||||
$var3 = 3;
|
||||
}
|
||||
|
@ -30,38 +88,15 @@ class DefaultAction extends Action
|
|||
return $this->render('action', array('var1' => $var1, 'var2' => $var2, 'var3' => $var3));
|
||||
}
|
||||
|
||||
public function variableSlug($data)
|
||||
{
|
||||
|
||||
/**your action algorythm**/
|
||||
if (isset($data[0])) {
|
||||
$var1 = $data[0];
|
||||
} else {
|
||||
$var1 = 1;
|
||||
}
|
||||
if (isset($data[1])) {
|
||||
$var2 = $data[1];
|
||||
} else {
|
||||
$var2 = 2;
|
||||
}
|
||||
if (isset($data[2])) {
|
||||
$var3 = $data[2];
|
||||
} else {
|
||||
$var3 = 3;
|
||||
}
|
||||
|
||||
return $this->render('action', array('var1' => $var1, 'var2' => $var2, 'var3' => $var3));
|
||||
}
|
||||
|
||||
public function makeHttp11($data)
|
||||
public function makeHttp11()
|
||||
{
|
||||
$data = array('myval' => 25);
|
||||
//Dumper::dump($data);
|
||||
\MVC\Classe\Logger::addLog('action', 'http11 make request');
|
||||
$request = new HttpMethodRequete();
|
||||
$request->setUrl(Url::absolute_link_rewrite(false, 'accueil', ['var10'=>'val10']))->get($data);
|
||||
$request->setUrl(Url::absolute_link_rewrite(false, 'accueil', ['var10'=>'val10']))->post($data);
|
||||
$request->setUrl(Url::absolute_link_rewrite(false, 'accueil', ['var10' => 'val10']))->put($data);
|
||||
$request->setUrl(Url::absolute_link_rewrite(false, 'accueil', ['var10'=>'val10']))->delete($data);
|
||||
$request = new \MVC\Classe\HttpMethodRequete();
|
||||
$request->setUrl(\MVC\Classe\Url::absolute_link_rewrite(false, 'accueil', ['var10'=>'val10']))->get($data);
|
||||
$request->setUrl(\MVC\Classe\Url::absolute_link_rewrite(false, 'accueil', ['var10'=>'val10']))->post($data);
|
||||
$request->setUrl(\MVC\Classe\Url::absolute_link_rewrite(false, 'accueil', ['var10'=>'val10']))->put($data);
|
||||
$request->setUrl(\MVC\Classe\Url::absolute_link_rewrite(false, 'accueil', ['var10'=>'val10']))->delete($data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ use MVC\Classe\Response;
|
|||
|
||||
class MenudocsAction extends Action
|
||||
{
|
||||
public function default($data)
|
||||
public function default()
|
||||
{
|
||||
|
||||
|
||||
|
|
|
@ -8,6 +8,35 @@ class DocConduit extends Conduit
|
|||
// Route('/docs')
|
||||
public function index()
|
||||
{
|
||||
\MVC\Object\Session::createAndTestSession();
|
||||
$files = array();
|
||||
|
||||
if ($handle = opendir(DATA_PATH . '/docs')) {
|
||||
|
||||
while (false !== ($entry = readdir($handle))) {
|
||||
|
||||
if ($entry != "." && $entry != "..") {
|
||||
|
||||
$files[] = $entry;
|
||||
}
|
||||
}
|
||||
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
asort($files);
|
||||
|
||||
$this->templateData['page_title'] = 'Sommaire de la documentation du Framework';
|
||||
$this->templateData['description'] = 'Sommaire, Documentation, SAND, Framework';
|
||||
$this->templateData['files'] = $files;
|
||||
|
||||
return $this->render('docs', $this->templateData);
|
||||
}
|
||||
|
||||
// Route('/docs/file/{file}')
|
||||
public function readfile()
|
||||
{
|
||||
\MVC\Object\Session::createAndTestSession();
|
||||
|
||||
$files = array();
|
||||
|
||||
|
@ -26,24 +55,21 @@ class DocConduit extends Conduit
|
|||
|
||||
asort($files);
|
||||
|
||||
$this->templateData['page_title'] = 'Foo';
|
||||
$this->templateData['description'] = 'DocConduit';
|
||||
$this->templateData['files'] = $files;
|
||||
|
||||
return $this->render('docs', $this->templateData);
|
||||
}
|
||||
|
||||
// Route('/docs/file/{file}')
|
||||
public function readfile()
|
||||
{
|
||||
$key_file = array_search($this->file,$files);
|
||||
|
||||
$markdown = file_get_contents(DATA_PATH . '/docs/' . $this->file);
|
||||
|
||||
$my_html = MarkdownExtra::defaultTransform($markdown);
|
||||
|
||||
$this->templateData['page_title'] = 'Foo';
|
||||
$this->templateData['description'] = 'DocConduit';
|
||||
$this->templateData['page_title'] = 'Documentation du Framework';
|
||||
$this->templateData['description'] = 'Documentation, SAND, Framework';
|
||||
$this->templateData['data'] = $my_html;
|
||||
if(isset($files[$key_file - 1])) {
|
||||
$this->templateData['previous'] = $files[$key_file - 1];
|
||||
}
|
||||
if(isset($files[$key_file + 1])) {
|
||||
$this->templateData['next'] = $files[$key_file + 1];
|
||||
}
|
||||
|
||||
return $this->render('docs', $this->templateData);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ class FooConduit extends Conduit
|
|||
// Route('/foo')
|
||||
public function index()
|
||||
{
|
||||
\MVC\Object\Session::createAndTestSession();
|
||||
echo "blob of foo";
|
||||
return $this->render('foo', array('page_title' => 'Foo', 'description' => 'FooConduit'));
|
||||
}
|
||||
|
@ -15,6 +16,7 @@ class FooConduit extends Conduit
|
|||
// Route('/foo/{id}')
|
||||
public function load()
|
||||
{
|
||||
\MVC\Object\Session::createAndTestSession();
|
||||
echo "load of foo";
|
||||
return $this->render('foo', array('page_title' => 'Foo', 'description' => 'FooConduit', 'id' => $this->id));
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ class IndexConduit extends Conduit
|
|||
// Route('/')
|
||||
public function homepage()
|
||||
{
|
||||
\MVC\Object\Session::createAndTestSession();
|
||||
echo "IndexControlleur";
|
||||
return $this->render('index', array("templating_a"=>'blade',"templating_b"=>'twig',"templating_c"=>'edge'));
|
||||
}
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
<?php
|
||||
<?php
|
||||
\MVC\Object\Alert::addAlert('NOT OK!','You should not go to the admin access.','warning');
|
||||
\MVC\Object\Session::checkACL_admin();
|
7
application/include/controlleurs/donate.php
Normal file
7
application/include/controlleurs/donate.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
|
||||
use MVC\Classe\Logger;
|
||||
|
||||
$templateData = array("templating_a" => 'blade', "templating_b" => 'twig', "templating_c" => 'edge');
|
||||
Logger::addLog('ok', 'Hello world');
|
5
application/include/controlleurs/error-access-denied.php
Normal file
5
application/include/controlleurs/error-access-denied.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Controlleur permettant d'afficher la page d'erreur 403 accès restreint
|
||||
*/
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Controlleur permettant d'afficher la page d'erreur lors d'une fermeture de l'application
|
||||
*/
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Controlleur permettant d'afficher la page d'erreur lors d'une maintenance de l'application
|
||||
*/
|
|
@ -1 +1,6 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Controlleur permettant d'afficher la page d'erreur 404 page inexistante
|
||||
*/
|
||||
|
||||
|
|
5
application/include/controlleurs/feedback.php
Normal file
5
application/include/controlleurs/feedback.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Controlleur permettant d'afficher le recevoir un feedback
|
||||
*/
|
6
application/include/controlleurs/get-params.php
Normal file
6
application/include/controlleurs/get-params.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
\MVC\Classe\Dumper::dump($_GET);
|
||||
\MVC\Classe\Dumper::dump($url_params);
|
||||
\MVC\Classe\Dumper::dump($templateData);
|
||||
\MVC\Classe\Dumper::dump($GLOBALS);
|
3
application/include/controlleurs/gitlist.php
Normal file
3
application/include/controlleurs/gitlist.php
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
$app = new MVC\Classe\Modular($name, 'gitlist', $url_params);
|
||||
$templateData = array('app' => $app);
|
|
@ -8,5 +8,7 @@ use MVC\Classe\Logger;
|
|||
|
||||
\MVC\Classe\ControlleurAction::inserer('default.makeHttp11', []);
|
||||
|
||||
$templateData = array("templating_a"=>'blade',"templating_b"=>'twig',"templating_c"=>'edge');
|
||||
$templateData["templating_a"] ='blade';
|
||||
$templateData["templating_b"] ='twig';
|
||||
$templateData["templating_c"] ='edge';
|
||||
Logger::addLog('ok', 'Hello world');
|
||||
|
|
7
application/include/controlleurs/react.php
Normal file
7
application/include/controlleurs/react.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
|
||||
use MVC\Classe\Logger;
|
||||
|
||||
$templateData = array("templating_a"=>'blade',"templating_b"=>'twig',"templating_c"=>'edge');
|
||||
Logger::addLog('ok', 'Hello world');
|
7
application/include/controlleurs/vuejs.php
Normal file
7
application/include/controlleurs/vuejs.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
|
||||
use MVC\Classe\Logger;
|
||||
|
||||
$templateData = array("templating_a"=>'blade',"templating_b"=>'twig',"templating_c"=>'edge');
|
||||
Logger::addLog('ok', 'Hello world');
|
|
@ -1,6 +1,10 @@
|
|||
name : admin
|
||||
page_title : Administration de l'application
|
||||
description : Administration de l'application
|
||||
engine : blade
|
||||
params : params
|
||||
|
||||
engine : blade
|
||||
authentification : yes
|
||||
|
||||
ariane : {acceuil}
|
||||
arianelink : {index}
|
||||
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
name : beers
|
||||
page_title : module_title
|
||||
description : module_description
|
||||
params : module_params
|
||||
|
||||
engine : blade
|
||||
authentification : yes
|
||||
|
||||
ariane : {acceuil}
|
||||
arianelink : {index}
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
name : cgu
|
||||
page_title: Conditions Générale d'Utilisation de l'application
|
||||
description : abracadabla
|
||||
|
||||
engine : blade
|
||||
params : params
|
||||
authentification : yes
|
||||
|
||||
ariane : {acceuil}
|
||||
arianelink : {index}
|
||||
|
|
10
application/include/modeles/donate.model
Normal file
10
application/include/modeles/donate.model
Normal file
|
@ -0,0 +1,10 @@
|
|||
name : donate
|
||||
page_title : Be a sponsor
|
||||
description : Page permettant de devenir un sponsor du framework SAND
|
||||
|
||||
engine : blade
|
||||
authentification : yes
|
||||
|
||||
ariane : {acceuil}
|
||||
arianelink : {index}
|
||||
|
10
application/include/modeles/error-access-denied.model
Normal file
10
application/include/modeles/error-access-denied.model
Normal file
|
@ -0,0 +1,10 @@
|
|||
name : error-access-denied
|
||||
page_title : Page 403 (Accès restreint) de l'application
|
||||
description : Page 403 (Accès restreint) de l'application
|
||||
|
||||
engine : blade
|
||||
authentification : no
|
||||
|
||||
ariane : {acceuil}
|
||||
arianelink : {index}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
name : error-application-closed
|
||||
page_title : Page de fermeture de l'application
|
||||
description : UFC - Page de fermeture de l'application
|
||||
engine : blade
|
||||
authentification : no
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
name : error-application-maintained
|
||||
page_title : Page de maintenance de l'application
|
||||
description : UFC - Page de maintenance de l'application
|
||||
engine : blade
|
||||
authentification : no
|
||||
|
|
@ -1,5 +1,9 @@
|
|||
name : error
|
||||
page_title: Erreurs de l'application
|
||||
description : abracadabla
|
||||
page_title: Page 404 (Page Non Trouvé) de l'application
|
||||
description : Page 404 (Page Non Trouvé) de l'application
|
||||
|
||||
engine : blade
|
||||
params : params
|
||||
authentification : no
|
||||
|
||||
ariane : {acceuil}
|
||||
arianelink : {index}
|
||||
|
|
8
application/include/modeles/feedback.model
Normal file
8
application/include/modeles/feedback.model
Normal file
|
@ -0,0 +1,8 @@
|
|||
name : feedback
|
||||
page_title : Page de retour d'expérience utilisateur de l'application
|
||||
description : UFC - Page de retour d'expérience utilisateur de l'application
|
||||
engine : blade
|
||||
authentification : no
|
||||
ariane : {acceuil, retour d'expérience utilisateur}
|
||||
arianelink : {index, feedback}
|
||||
|
10
application/include/modeles/gitlist.model
Normal file
10
application/include/modeles/gitlist.model
Normal file
|
@ -0,0 +1,10 @@
|
|||
name : gitlist
|
||||
page_title : Dépot Git
|
||||
description : Le dépot de travail du framework
|
||||
|
||||
engine : blade
|
||||
authentification : yes
|
||||
|
||||
ariane : {acceuil, dépot git du framework}
|
||||
arianelink : {index, gitlist}
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
name : index
|
||||
page_title : Accueil de l'application
|
||||
description : zatou stra bracadabla
|
||||
engine : blade
|
||||
params : params
|
||||
|
||||
engine : twig
|
||||
authentification : yes
|
||||
|
||||
ariane : {acceuil}
|
||||
arianelink : {index}
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
name : policy
|
||||
page_title: Politique de Confidentialité de l'application
|
||||
description : abracadabla
|
||||
|
||||
engine : blade
|
||||
params : params
|
||||
authentification : yes
|
||||
|
||||
ariane : {acceuil}
|
||||
arianelink : {index}
|
||||
|
|
8
application/include/modeles/react.model
Normal file
8
application/include/modeles/react.model
Normal file
|
@ -0,0 +1,8 @@
|
|||
name : react
|
||||
page_title : module_title
|
||||
description : module_description
|
||||
engine : blade
|
||||
authentification : yes
|
||||
ariane : {acceuil, react}
|
||||
arianelink : {index, react}
|
||||
|
8
application/include/modeles/vuejs.model
Normal file
8
application/include/modeles/vuejs.model
Normal file
|
@ -0,0 +1,8 @@
|
|||
name : vuejs
|
||||
page_title : module_title
|
||||
description : module_description
|
||||
engine : blade
|
||||
authentification : yes
|
||||
ariane : {acceuil, vuejs}
|
||||
arianelink : {index, vuejs}
|
||||
|
15
application/include/vues/layout/body-nomenu.blade.php
Normal file
15
application/include/vues/layout/body-nomenu.blade.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
@extends('system')
|
||||
|
||||
@section('body')
|
||||
<!-- Body Inner -->
|
||||
<div class="body-inner">
|
||||
|
||||
<section id="page-content">
|
||||
<div class="container">
|
||||
@yield('content')
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
<!-- end: Body Inner -->
|
||||
@endsection
|
|
@ -8,10 +8,13 @@
|
|||
style="background: rgba(0, 0, 0, 0.59);">
|
||||
<div class="container">
|
||||
<ul class="top-menu">
|
||||
<li @if($name == 'policy') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Policy', []) }}">Policy</a></li>
|
||||
{{\MVC\Object\Environment::getTextEnvironment()}}
|
||||
<li @if($name == 'docs_route' || $name == 'docs_name_route') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'docs', []) }}">Documentation</a></li>
|
||||
<li @if($name == 'depots') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'gitlist/SAND-FrameWork', []) }}">Dépot</a></li>
|
||||
<li @if($name == 'donate') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Donate', []) }}">Donate</a></li>
|
||||
<li @if($name == 'cgu') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'CGU', []) }}"> CGU Terms</a></li>
|
||||
<li @if($name == 'docs') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'docs', []) }}">Documentation</a></li>
|
||||
<li @if($name == 'beers') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'beers', []) }}">Support</a></li>
|
||||
<li @if($name == 'policy') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Policy', []) }}">Policy</a></li>
|
||||
<li @if($name == 'feedback') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Feedback', []) }}">Feedback</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -21,14 +24,6 @@
|
|||
style="background: rgba(0, 0, 0, 0.59);">
|
||||
<div class="header-inner">
|
||||
<div class="container">
|
||||
<!--Logo-->
|
||||
<div id="logo">
|
||||
<a href="#">
|
||||
<span class="logo-default"></span>
|
||||
<span class="logo-dark"></span>
|
||||
</a>
|
||||
</div>
|
||||
<!--End: Logo-->
|
||||
<!--Navigation Resposnive Trigger-->
|
||||
<div id="mainMenu-trigger">
|
||||
<a class="lines-button x"><span class="lines"></span></a>
|
||||
|
@ -37,6 +32,13 @@
|
|||
<!--Navigation-->
|
||||
<div id="mainMenu">
|
||||
<div class="container">
|
||||
<!--Logo-->
|
||||
<div id="logo">
|
||||
<a href="#">
|
||||
SAND Framework
|
||||
</a>
|
||||
</div>
|
||||
<!--end: logo-->
|
||||
<nav>
|
||||
<ul>
|
||||
<li @if($name == 'index') class="actual" @endif ><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Index', []) }}">Index</a></li>
|
||||
|
@ -50,10 +52,52 @@
|
|||
</div>
|
||||
</header>
|
||||
<!-- end: Header -->
|
||||
<!-- Subbar -->
|
||||
@if(isset($authentification) && $authentification == 'yes')
|
||||
<div id="subbar" class="fullwidth">
|
||||
<div class="container">
|
||||
<span style="float:left;">Vous êtes connecté en tant que {{$_SESSION['user_login']}}</span>
|
||||
<span style="float:right;"><a href="{{ \MVC\Classe\Url::link_rewrite( false, 'Logout', []) }}">Se Deconnecter</a></span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<!-- end: Subbar -->
|
||||
|
||||
<!-- Breadcrumbs -->
|
||||
@if (isset($ariane))
|
||||
<div id="breadcrumbs" class="fullwidth">
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb-sand">
|
||||
@foreach($ariane as $value)
|
||||
@if($value == end($ariane))
|
||||
<li class="breadcrumb-item active" aria-current="page">{{$value}}</li>
|
||||
@else
|
||||
<li class="breadcrumb-item"><a href="{{\MVC\Classe\Url::link_rewrite(false,$arianelink[array_search($value,$ariane)])}}">{{$value}}</a></li>
|
||||
@endif
|
||||
@endforeach
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<!-- end: BreadCrumbs -->
|
||||
|
||||
<section id="page-content">
|
||||
<div class="container">
|
||||
|
||||
<!--Alerts-->
|
||||
@if(isset($_SESSION['alerts']))
|
||||
@foreach($_SESSION['alerts'] as $alert)
|
||||
<div class="alert alert-{{$alert['type']}} alert-dismissible fade show" role="alert">
|
||||
<strong>{{$alert['title']}}</strong> {{$alert['message']}}.
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<!--end: Alerts-->
|
||||
@yield('content')
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
@ -62,19 +106,34 @@
|
|||
<div class="footer-content">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-5">
|
||||
<div class="col-lg-3">
|
||||
<div class="widget">
|
||||
<div class="widget-title"></div>
|
||||
<p class="mb-5">
|
||||
<img src="{{ \MVC\Classe\Url::asset_rewrite('assets/img/beer.svg') }}" width="150">
|
||||
<img src="{{ \MVC\Classe\Url::asset_rewrite('assets/img/1007698-ffeb3b.svg') }}" width="150">
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9">
|
||||
<p>
|
||||
SAND FrameWork is an CC-licensed or MIT-licenced open source project and completely free to use.
|
||||
</p>
|
||||
<p>
|
||||
However, the amount of effort needed to maintain and develop new features for the project is not
|
||||
sustainable without proper financial backing.
|
||||
You can support its ongoing development by being a backer or a sponsor on
|
||||
<a href="https://www.patreon.com/">Patreon campaign</a>
|
||||
(recurring, with perks for different tiers), and get your company logo here.
|
||||
</p>
|
||||
<p>
|
||||
Also, you can make a <a href="https://www.paypal.me/">one time donation via PayPal</a>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="copyright-content">
|
||||
<div class="container">
|
||||
<div class="copyright-text text-center">© 2020-2021 Built with SAND Framework - Responsive FrameWork Template.</div>
|
||||
<div class="copyright-text text-center">© 2020-2021 Built with SAND Framework - Responsive SAND Template.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
140
application/include/vues/layout/body.html.twig
Normal file
140
application/include/vues/layout/body.html.twig
Normal file
|
@ -0,0 +1,140 @@
|
|||
{% extends "system.html.twig" %}
|
||||
|
||||
{% block body %}
|
||||
<!-- Body Inner -->
|
||||
<div class="body-inner">
|
||||
<!-- Topbar -->
|
||||
<div id="topbar" class="d-none d-xl-block d-lg-block topbar-transparent topbar-fullwidth dark"
|
||||
style="background: rgba(0, 0, 0, 0.59);">
|
||||
<div class="container">
|
||||
<ul class="top-menu">
|
||||
{{call('\\MVC\\Object\\Environment','getTextEnvironment',[]) | raw}}
|
||||
<li {% if name == 'docs_route' or name == 'docs_name_route' %} class="actual" {% endif %} ><a href="{{ call("\\MVC\\Classe\\Url","link_rewrite",[ false, 'docs', []]) }}">Documentation</a></li>
|
||||
<li {% if name == 'depots' %} class="actual" {% endif %} ><a href="{{ call("\\MVC\\Classe\\Url","link_rewrite",[ false, 'gitlist/SAND-FrameWork', []]) }}">Dépot</a></li>
|
||||
<li {% if name == 'donate' %} class="actual" {% endif %} ><a href="{{ call("\\MVC\\Classe\\Url","link_rewrite",[ false, 'Donate', []]) }}">Donate</a></li>
|
||||
<li {% if name == 'cgu' %} class="actual" {% endif %} ><a href="{{ call("\\MVC\\Classe\\Url","link_rewrite",[ false, 'CGU', []]) }}"> CGU Terms</a></li>
|
||||
<li {% if name == 'policy' %} class="actual" {% endif %} ><a href="{{ call("\\MVC\\Classe\\Url","link_rewrite",[ false, 'Policy', []]) }}">Policy</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end: Topbar -->
|
||||
<!-- Header -->
|
||||
<header id="header" class="dark" data-transparent="true" data-fullwidth="true"
|
||||
style="background: rgba(0, 0, 0, 0.59);">
|
||||
<div class="header-inner">
|
||||
<div class="container">
|
||||
<!--Navigation Resposnive Trigger-->
|
||||
<div id="mainMenu-trigger">
|
||||
<a class="lines-button x"><span class="lines"></span></a>
|
||||
</div>
|
||||
<!--end: Navigation Resposnive Trigger-->
|
||||
<!--Navigation-->
|
||||
<div id="mainMenu">
|
||||
<div class="container">
|
||||
<!--Logo-->
|
||||
<div id="logo">
|
||||
<a href="#">
|
||||
SAND Framework
|
||||
</a>
|
||||
</div>
|
||||
<!--end: logo-->
|
||||
<nav>
|
||||
<ul>
|
||||
<li {% if name == 'index' %} class="actual" {% endif %} ><a href="{{ call("\\MVC\\Classe\\Url","link_rewrite",[false, 'Index', []]) }}">Index</a></li>
|
||||
<li {% if name == 'admin' %} class="actual" {% endif %} ><a href="{{ call("\\MVC\\Classe\\Url","link_rewrite",[false, 'Admin', []]) }}">Admin</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<!--end: Navigation-->
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<!-- end: Header -->
|
||||
<!-- Subbar -->
|
||||
<div id="subbar" class="fullwidth">
|
||||
<div class="container">
|
||||
<span style="float:left;">Vous êtes connecté en tant que {{session('user_login')}}</span>
|
||||
<span style="float:right;"><a href="{{ call("\\MVC\\Classe\\Url","link_rewrite",[ false, 'Logout', []]) }}">Se Deconnecter</a></span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end: Subbar -->
|
||||
<!-- Breadcrumbs -->
|
||||
{%if ariane is defined %}
|
||||
<div id="breadcrumbs" class="fullwidth">
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
{% for value in ariane %}
|
||||
{% if value == ariane|last %}
|
||||
<li class="breadcrumb-item active" aria-current="page">{{value}}</li>
|
||||
{% else %}
|
||||
<li class="breadcrumb-item"><a href="{{call("\\MVC\\Classe\\Url","link_rewrite",[false,arianelink[value.index],[] ])}}">{{value}}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<section id="page-content">
|
||||
<div class="container">
|
||||
|
||||
<!--Alerts-->
|
||||
{% if not session('alerts') == null %}
|
||||
{% for alert in session('alerts') %}
|
||||
<div class="alert alert-{{alert.type}} alert-dismissible fade show" role="alert">
|
||||
<strong>{{alert.title}}</strong> {{alert.message}}.
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<!--end: Alerts-->
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer id="footer">
|
||||
<div class="footer-content">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<div class="widget">
|
||||
<div class="widget-title"></div>
|
||||
<p class="mb-5">
|
||||
<img src="{{ call("\\MVC\\Classe\\Url","asset_rewrite",['assets/img/1007698-ffeb3b.svg']) }}" width="150">
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9">
|
||||
<p>
|
||||
SAND FrameWork is an CC-licensed or MIT-licenced open source project and completely free to use.
|
||||
</p>
|
||||
<p>
|
||||
However, the amount of effort needed to maintain and develop new features for the project is not
|
||||
sustainable without proper financial backing.
|
||||
You can support its ongoing development by being a backer or a sponsor on
|
||||
<a href="https://www.patreon.com/">Patreon campaign</a>
|
||||
(recurring, with perks for different tiers), and get your company logo here.
|
||||
</p>
|
||||
<p>
|
||||
Also, you can make a <a href="https://www.paypal.me/">one time donation via PayPal</a>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="copyright-content">
|
||||
<div class="container">
|
||||
<div class="copyright-text text-center">© 2020-2021 Built with SAND Framework - Responsive SAND Template.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<!-- end: Footer -->
|
||||
|
||||
</div>
|
||||
<!-- end: Body Inner -->
|
||||
{% endblock %}
|
|
@ -1,3 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
@ -8,9 +9,31 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="description" lang="fr" content="{{$description}}"/>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
@section('top-css')
|
||||
<link rel="stylesheet" href="{{ \MVC\Classe\Url::asset_rewrite('assets/bootstrap-5.0.0-beta1-dist/css/bootstrap.min.css')}}">
|
||||
<link rel="stylesheet" href="{{ \MVC\Classe\Url::asset_rewrite('assets/css/custom.css')}}">
|
||||
@if(\MVC\Classe\Browser::get() == 'Internet Explorer')
|
||||
<link rel="stylesheet" href="{{\MVC\Classe\Url::asset_rewrite('assets/html5-simple-date-input-polyfill-master/html5-simple-date-input-polyfill.css')}}">
|
||||
<!--<link rel="stylesheet" href="{{\MVC\Classe\Url::asset_rewrite('assets/hyperform-0.12.0/css/hyperform.css')}}">-->
|
||||
@endif
|
||||
@show
|
||||
|
||||
</head>
|
||||
|
@ -18,6 +41,15 @@
|
|||
<body>
|
||||
|
||||
@section('top-javascript')
|
||||
@if(\MVC\Classe\Browser::get() == 'Internet Explorer')
|
||||
<!-- Polyfill.io will load polyfills your browser needs -->
|
||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=default%2CNumber.parseInt%2CNumber.parseFloat%2CArray.prototype.find%2CArray.prototype.includes"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.12.1/polyfill.min.js" integrity="sha512-uzOpZ74myvXTYZ+mXUsPhDF+/iL/n32GDxdryI2SJronkEyKC8FBFRLiBQ7l7U/PTYebDbgTtbqTa6/vGtU23A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
|
||||
<script src="{{\MVC\Classe\Url::asset_rewrite('assets/html5-simple-date-input-polyfill-master/html5-simple-date-input-polyfill.js')}}"></script>
|
||||
<script src="{{\MVC\Classe\Url::asset_rewrite('assets/hyperform-0.12.0/dist/hyperform.js')}}"></script>
|
||||
<script>hyperform(window);</script>
|
||||
@endif
|
||||
@show
|
||||
|
||||
@yield('body')
|
||||
|
@ -25,6 +57,35 @@
|
|||
@section('bottom-javascript')
|
||||
<script src="{{ \MVC\Classe\Url::asset_rewrite('assets/bootstrap-5.0.0-beta1-dist/js/bootstrap.min.js')}}"></script>
|
||||
<script src="{{ \MVC\Classe\Url::asset_rewrite('assets/js/custom.js')}}"></script>
|
||||
|
||||
@if(\MVC\Classe\Browser::get() !== 'Internet Explorer')
|
||||
<script>
|
||||
|
||||
/*
|
||||
SCRIPT JS permettant de ne valider qu'une seule fois un formulaire
|
||||
ATTENTION tous les formulaires sont affecté
|
||||
Lors d'une validation bootstrap personnalisé veuillez utilisé
|
||||
la class do-resubmit sur le formulaire afin de permettre
|
||||
l'activation supplémentaire du bouton.
|
||||
*/
|
||||
|
||||
window.onload = function() {
|
||||
let PreventAllforms = document.querySelectorAll("form");
|
||||
Array.prototype.slice.call(PreventAllforms)
|
||||
.forEach(function (PreventForm) {
|
||||
PreventForm.onsubmit = submitted.bind(PreventForm);
|
||||
});
|
||||
}
|
||||
|
||||
function submitted(event) {
|
||||
if (event.target.classList.contains('do-resubmit')) {
|
||||
event.submitter.disabled = false;
|
||||
}else{
|
||||
event.submitter.disabled = true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endif
|
||||
@show
|
||||
|
||||
</body>
|
||||
|
|
72
application/include/vues/system/system.html.twig
Normal file
72
application/include/vues/system/system.html.twig
Normal file
|
@ -0,0 +1,72 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% block head %}
|
||||
<title>{{page_title}}</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta name="author" content="" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="description" lang="fr" content="{{description}}"/>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
{% block topCss %}
|
||||
<link rel="stylesheet" href="{{ call("\\MVC\\Classe\\Url","asset_rewrite",['assets/bootstrap-5.0.0-beta1-dist/css/bootstrap.min.css'])}}">
|
||||
<link rel="stylesheet" href="{{ call("\\MVC\\Classe\\Url","asset_rewrite",['assets/css/custom.css'])}}">
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{% block topJavascript %}{% endblock %}
|
||||
|
||||
{% block body %}{% endblock %}
|
||||
|
||||
{% block bottomJavascript %}
|
||||
<script src="{{ call("\\MVC\\Classe\\Url","asset_rewrite",['assets/bootstrap-5.0.0-beta1-dist/js/bootstrap.min.js'])}}"></script>
|
||||
<script src="{{ call("\\MVC\\Classe\\Url","asset_rewrite",['assets/js/custom.js'])}}"></script>
|
||||
|
||||
{#
|
||||
SCRIPT JS permettant de ne valider qu'une seule fois un formulaire
|
||||
ATTENTION tous les formulaires sont affecté
|
||||
Lors d'une validation bootstrap personnalisé veuillez utilisé
|
||||
la class do-resubmit sur le formulaire afin de permettre
|
||||
l'activation supplémentaire du bouton.
|
||||
#}
|
||||
<script>
|
||||
window.onload = function() {
|
||||
let PreventAllforms = document.querySelectorAll("form");
|
||||
Array.prototype.slice.call(PreventAllforms)
|
||||
.forEach(function (PreventForm) {
|
||||
PreventForm.onsubmit = submitted.bind(PreventForm);
|
||||
});
|
||||
}
|
||||
|
||||
function submitted(event) {
|
||||
if (event.target.classList.contains('do-resubmit')) {
|
||||
event.submitter.disabled = false;
|
||||
}else{
|
||||
event.submitter.disabled = true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
1
application/include/vues/view/action.html.twig
Normal file
1
application/include/vues/view/action.html.twig
Normal file
|
@ -0,0 +1 @@
|
|||
{{var1}}::{{var2}}::{{var3}}
|
|
@ -5,8 +5,10 @@
|
|||
@endsection
|
||||
|
||||
@section('content')
|
||||
<h1>Admin</h1>
|
||||
<h1>Admin de l'url</h1>
|
||||
<h2> {{$_SERVER['SERVER_NAME']}}</h2>
|
||||
<br /><br /><br />
|
||||
<a href="{{ \MVC\Classe\Url::link_rewrite(false, 'authentification', []) }}">S'authentifier ?</a>
|
||||
|
||||
@endsection
|
||||
|
||||
|
|
|
@ -6,14 +6,22 @@
|
|||
|
||||
@section('content')
|
||||
@if (isset($files))
|
||||
|
||||
<h1>Sommaire:</h1>
|
||||
|
||||
@foreach( $files as $file)
|
||||
<a href="{{ \MVC\Classe\Url::link_rewrite( false, 'docs', ['file'=>$file]) }}">{{ $file }}</a> <br/>
|
||||
@endforeach
|
||||
@endif
|
||||
@if (isset($data))
|
||||
<div style="display:block;position:relative;width:450px;margin:auto;">
|
||||
@if (isset($previous))<a href="{{ \MVC\Classe\Url::link_rewrite( false, 'docs', ['file'=>$previous]) }}" class="btn btn-outline-info"> « Précedent</a>@endif
|
||||
<a href="{{ \MVC\Classe\Url::link_rewrite( false, 'docs', []) }}" class="btn btn-info">Sommaire</a>
|
||||
@if (isset($next))<a href="{{ \MVC\Classe\Url::link_rewrite( false, 'docs', ['file'=>$next]) }}" class="btn btn-outline-info">Suivant » </a>@endif
|
||||
</div>
|
||||
{{$data}}
|
||||
<div style="display:block;position:relative;width:450px;margin:auto;">
|
||||
@if (isset($previous))<a href="{{ \MVC\Classe\Url::link_rewrite( false, 'docs', ['file'=>$previous]) }}" class="btn btn-outline-info"> « Précedent</a>@endif
|
||||
<a href="{{ \MVC\Classe\Url::link_rewrite( false, 'docs', []) }}" class="btn btn-info">Sommaire</a>
|
||||
@if (isset($next))<a href="{{ \MVC\Classe\Url::link_rewrite( false, 'docs', ['file'=>$next]) }}" class="btn btn-outline-info">Suivant » </a>@endif
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
20
application/include/vues/view/donate.blade.php
Normal file
20
application/include/vues/view/donate.blade.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
@extends('body')
|
||||
|
||||
@section('sidebar')
|
||||
@parent
|
||||
|
||||
<p>This is appended to the master sidebar.</p>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="donate-description">
|
||||
<h2 class="section-title" id="donate">Become a Sponsor !</h2>
|
||||
</div>
|
||||
|
||||
<div class="donate-footer" style="margin:auto;">
|
||||
<a href="https://www.patreon.com/" class="beer-button button">Be a sponsor on Patreon</a>
|
||||
<a href="https://www.paypal.me/" class="beer-button button-secondary">Donate via PayPal</a>
|
||||
</div>
|
||||
|
||||
|
||||
@endsection
|
34
application/include/vues/view/error-access-denied.blade.php
Normal file
34
application/include/vues/view/error-access-denied.blade.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
{{-- Vue Blade de la page d'erreur 403 accès restreint--}}
|
||||
@extends('body-nomenu')
|
||||
|
||||
@section('content')
|
||||
<div id="access-denied">
|
||||
<div class="container">
|
||||
<h1>Accès non Autorisé</h1>
|
||||
<p>
|
||||
Vous ne possédez pas les accès à cette application.
|
||||
<br/>
|
||||
Si c'est une erreur : veuillez bien contacter l'administrateur de l'application afin qu'il vous alloue un accès
|
||||
<br/>
|
||||
<a href="mailto:administrateur@sand-framework.fr">administrateur@sand-framework.fr</a>
|
||||
</p>
|
||||
<br /><br />
|
||||
<div id="gears">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="120px" height="120px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-gears">
|
||||
<rect x="0" y="0" width="100" height="100" fill="none" class="bk"/>
|
||||
<g transform="translate(-20,-20)">
|
||||
<path d="M79.9,52.6C80,51.8,80,50.9,80,50s0-1.8-0.1-2.6l-5.1-0.4c-0.3-2.4-0.9-4.6-1.8-6.7l4.2-2.9c-0.7-1.6-1.6-3.1-2.6-4.5 L70,35c-1.4-1.9-3.1-3.5-4.9-4.9l2.2-4.6c-1.4-1-2.9-1.9-4.5-2.6L59.8,27c-2.1-0.9-4.4-1.5-6.7-1.8l-0.4-5.1C51.8,20,50.9,20,50,20 s-1.8,0-2.6,0.1l-0.4,5.1c-2.4,0.3-4.6,0.9-6.7,1.8l-2.9-4.1c-1.6,0.7-3.1,1.6-4.5,2.6l2.1,4.6c-1.9,1.4-3.5,3.1-5,4.9l-4.5-2.1 c-1,1.4-1.9,2.9-2.6,4.5l4.1,2.9c-0.9,2.1-1.5,4.4-1.8,6.8l-5,0.4C20,48.2,20,49.1,20,50s0,1.8,0.1,2.6l5,0.4 c0.3,2.4,0.9,4.7,1.8,6.8l-4.1,2.9c0.7,1.6,1.6,3.1,2.6,4.5l4.5-2.1c1.4,1.9,3.1,3.5,5,4.9l-2.1,4.6c1.4,1,2.9,1.9,4.5,2.6l2.9-4.1 c2.1,0.9,4.4,1.5,6.7,1.8l0.4,5.1C48.2,80,49.1,80,50,80s1.8,0,2.6-0.1l0.4-5.1c2.3-0.3,4.6-0.9,6.7-1.8l2.9,4.2 c1.6-0.7,3.1-1.6,4.5-2.6L65,69.9c1.9-1.4,3.5-3,4.9-4.9l4.6,2.2c1-1.4,1.9-2.9,2.6-4.5L73,59.8c0.9-2.1,1.5-4.4,1.8-6.7L79.9,52.6 z M50,65c-8.3,0-15-6.7-15-15c0-8.3,6.7-15,15-15s15,6.7,15,15C65,58.3,58.3,65,50,65z" fill="#8f7f59" transform="rotate(32.43 50 50)">
|
||||
<animateTransform attributeName="transform" type="rotate" from="90 50 50" to="0 50 50" dur="1s" repeatCount="indefinite"/>
|
||||
</path>
|
||||
</g>
|
||||
<g transform="translate(20,20) rotate(15 50 50)">
|
||||
<path d="M79.9,52.6C80,51.8,80,50.9,80,50s0-1.8-0.1-2.6l-5.1-0.4c-0.3-2.4-0.9-4.6-1.8-6.7l4.2-2.9c-0.7-1.6-1.6-3.1-2.6-4.5 L70,35c-1.4-1.9-3.1-3.5-4.9-4.9l2.2-4.6c-1.4-1-2.9-1.9-4.5-2.6L59.8,27c-2.1-0.9-4.4-1.5-6.7-1.8l-0.4-5.1C51.8,20,50.9,20,50,20 s-1.8,0-2.6,0.1l-0.4,5.1c-2.4,0.3-4.6,0.9-6.7,1.8l-2.9-4.1c-1.6,0.7-3.1,1.6-4.5,2.6l2.1,4.6c-1.9,1.4-3.5,3.1-5,4.9l-4.5-2.1 c-1,1.4-1.9,2.9-2.6,4.5l4.1,2.9c-0.9,2.1-1.5,4.4-1.8,6.8l-5,0.4C20,48.2,20,49.1,20,50s0,1.8,0.1,2.6l5,0.4 c0.3,2.4,0.9,4.7,1.8,6.8l-4.1,2.9c0.7,1.6,1.6,3.1,2.6,4.5l4.5-2.1c1.4,1.9,3.1,3.5,5,4.9l-2.1,4.6c1.4,1,2.9,1.9,4.5,2.6l2.9-4.1 c2.1,0.9,4.4,1.5,6.7,1.8l0.4,5.1C48.2,80,49.1,80,50,80s1.8,0,2.6-0.1l0.4-5.1c2.3-0.3,4.6-0.9,6.7-1.8l2.9,4.2 c1.6-0.7,3.1-1.6,4.5-2.6L65,69.9c1.9-1.4,3.5-3,4.9-4.9l4.6,2.2c1-1.4,1.9-2.9,2.6-4.5L73,59.8c0.9-2.1,1.5-4.4,1.8-6.7L79.9,52.6 z M50,65c-8.3,0-15-6.7-15-15c0-8.3,6.7-15,15-15s15,6.7,15,15C65,58.3,58.3,65,50,65z" fill="#9f9fab" transform="rotate(57.57 50 50)">
|
||||
<animateTransform attributeName="transform" type="rotate" from="0 50 50" to="90 50 50" dur="1s" repeatCount="indefinite"/>
|
||||
</path>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
165
application/include/vues/view/error-application-closed.blade.php
Normal file
165
application/include/vues/view/error-application-closed.blade.php
Normal file
|
@ -0,0 +1,165 @@
|
|||
{{-- Vue Blade de la page d'erreur lors d'une fermeture de l'application--}}
|
||||
@extends('body-nomenu')
|
||||
|
||||
@section('content')
|
||||
<div id="access-denied">
|
||||
<div class="container">
|
||||
<h1>:) Oops!</h1>
|
||||
<h2>Temporairement fermée</h2>
|
||||
<h3>L'application est de retour bientôt!</h3>
|
||||
<p>
|
||||
Désolé pour cette gêne mais il se trouve que l'application est fermée à ce moment !
|
||||
<br/>
|
||||
— Le service
|
||||
<br/>
|
||||
<a href="mailto:application@localhost.fr">application@localhost.fr</a>
|
||||
</p>
|
||||
<br /><br />
|
||||
<br /><br />
|
||||
<div id="gears">
|
||||
<svg version="1.1" id="svg-animation-example" class="svg-line-drawing rtl-magazine-animation" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="720" height="310" viewBox="0 0 720 310" xml:space="preserve" aria-hidden="true" >
|
||||
<defs>
|
||||
<clipPath id="mask-page">
|
||||
<path class="stroke-alt stroke-width linecap" d="m240,275 l240,0 0,-217 -240,0z" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
<!-- content page -->
|
||||
<g clip-path="url(#mask-page)">
|
||||
<g class="ani-move-page is-animated">
|
||||
<!-- section one -->
|
||||
<path class="stroke stroke-width linecap" d="m0,275 m254,-203 l212,0 0,112 -212,0z" fill="none" />
|
||||
<path class="stroke-alt stroke-width linecap" d="m0,275 m272,-172 a13 13 180 0 1 26,0 a13 13 180 0 1 -26,0" fill="none" />
|
||||
<path class="stroke stroke-width linecap" d="m0,275 m254,-203 m22,112 l34,-44 a9 9 180 0 1 13,-1 l15,16 38,-48 a5 5 180 0 1 8.4,0 l60,77" fill="none" />
|
||||
<path class="stroke stroke-width linecap" d="m0,275 m254,-67 l212,0 m-212,10 l54,0 m25,0 l54,0 m25,0 l54,0 m-212,10 l54,0 m25,0 l54,0 m25,0 l54,0" fill="none" />
|
||||
<!-- button section one -->
|
||||
<path class="stroke stroke-width linecap" d="m350,250 a10 10 180 0 1 20,0 a10 10 180 0 1 -20,0 m6.8,-1.7 l3.2,3.2 3.2,-3.2" fill="none" />
|
||||
<path class="stroke stroke-width linecap" d="m318,290 l0,430" fill="none" />
|
||||
<path class="stroke stroke-width linecap" d="m333,306 l54,0 m-54,10 l54,0 m-54,10 l133,0 m-133,10 l133,0" fill="none" />
|
||||
<path class="stroke stroke-width linecap" d="m333,356 l133,0 0,78 -133,0 0,-78 m0,90 l54,0 m-54,10 l54,0 m-54,20 133,0 0,78 -133,0 0,-78 m0,90 l54,0 m-54,10 l54,0 m-54,20 133,0 0,78 -133,0 0,-78 m0,90 l54,0 m-54,10 l54,0 m-54,20" fill="none" />
|
||||
<!-- section two -->
|
||||
<path class="stroke stroke-width linecap" d="m0,680 m0,275 m254,-203 l212,0 0,112 -212,0z" fill="none" />
|
||||
<path class="stroke-alt stroke-width linecap" d="m0,680 m0,275 m272,-172 a13 13 180 0 1 26,0 a13 13 180 0 1 -26,0" fill="none" />
|
||||
<path class="stroke stroke-width linecap" d="m0,680 m0,275 m254,-203 m22,112 l34,-44 a9 9 180 0 1 13,-1 l15,16 38,-48 a5 5 180 0 1 8.4,0 l60,77" fill="none" />
|
||||
<path class="stroke stroke-width linecap" d="m0,680 m0,275 m254,-67 l212,0 m-212,10 l54,0 m25,0 l54,0 m25,0 l54,0 m-212,10 l54,0 m25,0 l54,0 m25,0 l54,0" fill="none" />
|
||||
<!-- button section two -->
|
||||
<path class="stroke stroke-width linecap" d="m0,680 m350,250 a10 10 180 0 1 20,0 a10 10 180 0 1 -20,0 m6.8,-1.7 l3.2,3.2 3.2,-3.2" fill="none" />
|
||||
</g>
|
||||
<g class="ani-move-menu is-animated">
|
||||
<g>
|
||||
<path class="stroke stroke-width linecap" d="m254,306 l54,0 m-54,10 l54,0 m-54,10 l54,0 m-54,10 l54,0" fill="none" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<!-- fade button -->
|
||||
<g class="ani-fade-button is-animated" opacity="0" >
|
||||
<path class="stroke-background stroke-overlay linecap" d="m350,250 a10 10 180 0 1 20,0 a10 10 180 0 1 -20,0 m6.8,-1.7 l3.2,3.2 3.2,-3.2" fill="none" />
|
||||
<path class="stroke-alt stroke-width linecap" d="m350,250 a10 10 180 0 1 20,0 a10 10 180 0 1 -20,0 m6.8,-1.7 l3.2,3.2 3.2,-3.2" fill="none" />
|
||||
</g>
|
||||
<!-- baseline -->
|
||||
<path class="stroke stroke-width linecap" d="m0,275 l240,0 0,-230 a5 5 90 0 1 5,-5 l230,0 a5 5 90 0 1 5,5 l0,230 240,0" fill="none" />
|
||||
<path class="stroke stroke-width linecap" d="m0,275 m240,-217 l240,0" fill="none" />
|
||||
<path class="stroke stroke-width linecap" d="m0,275 m240,-226 m10,0 a4 4 180 0 1 8,0 a4 4 180 0 1 -8,0 m14,0 a4 4 180 0 1 8,0 a4 4 180 0 1 -8,0 m14,0 a4 4 180 0 1 8,0 a4 4 180 0 1 -8,0" fill="none" />
|
||||
<defs>
|
||||
<style>
|
||||
|
||||
.svg-line-drawing {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.svg-line-drawing .stroke-background {
|
||||
stroke: #eddd3e;
|
||||
}
|
||||
|
||||
.svg-line-drawing .stroke {
|
||||
stroke: #12353C;
|
||||
}
|
||||
|
||||
.svg-line-drawing .stroke-alt {
|
||||
stroke: #ffffff;
|
||||
}
|
||||
|
||||
.svg-line-drawing .stroke-width {
|
||||
stroke-width: 2;
|
||||
}
|
||||
|
||||
.svg-line-drawing .stroke-overlay {
|
||||
stroke-width: 3;
|
||||
}
|
||||
|
||||
.svg-line-drawing .linecap {
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
|
||||
.rtl-magazine-animation .ani-fade-button,
|
||||
.rtl-magazine-animation .ani-move-page,
|
||||
.rtl-magazine-animation .ani-move-menu {
|
||||
-webkit-animation-duration: 5500ms;
|
||||
animation-duration: 5500ms;
|
||||
-webkit-animation-timing-function: ease;
|
||||
animation-timing-function: ease;
|
||||
-webkit-animation-delay: 100ms;
|
||||
animation-delay: 100ms;
|
||||
-webkit-animation-iteration-count: infinite;
|
||||
animation-iteration-count: infinite;
|
||||
}
|
||||
|
||||
.rtl-magazine-animation .ani-fade-button {
|
||||
-webkit-animation-name: fade-button;
|
||||
animation-name: fade-button;
|
||||
}
|
||||
|
||||
.rtl-magazine-animation .ani-move-page {
|
||||
-webkit-animation-name: move-page;
|
||||
animation-name: move-page;
|
||||
}
|
||||
|
||||
.rtl-magazine-animation .ani-move-menu {
|
||||
-webkit-animation-name: move-menu;
|
||||
animation-name: move-menu;
|
||||
}
|
||||
|
||||
@-webkit-keyframes fade-button {
|
||||
0%, 12%, 100% { opacity: 0; }
|
||||
9%, 11% { opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes fade-button {
|
||||
0%, 12%, 100% { opacity: 0; }
|
||||
9%, 11% { opacity: 1; }
|
||||
}
|
||||
|
||||
@-webkit-keyframes move-page {
|
||||
0%, 14%, 100% { -webkit-transform: translateY(0px); -webkit-animation-timing-function: ease-in; }
|
||||
28% { -webkit-transform: translateY(-220px); -webkit-animation-timing-function: linear; }
|
||||
80%, 99.9999% { -webkit-transform: translateY(-680px); -webkit-animation-timing-function: linear; }
|
||||
}
|
||||
|
||||
@keyframes move-page {
|
||||
0%, 14%, 100% { transform: translateY(0px); animation-timing-function: ease-in; }
|
||||
28% { transform: translateY(-220px); animation-timing-function: linear; }
|
||||
80%, 99.9999% { transform: translateY(-680px); animation-timing-function: linear; }
|
||||
}
|
||||
|
||||
@-webkit-keyframes move-menu {
|
||||
0%, 14%, 100% { -webkit-transform: translateY(0px); -webkit-animation-timing-function: ease-in; }
|
||||
28%, 68.6957% { -webkit-transform: translateY(-220px); -webkit-animation-timing-function: linear; }
|
||||
80% { -webkit-transform: translateY(-320px); -webkit-animation-timing-function: linear; }
|
||||
99.9999% { -webkit-transform: translateY(-680px); -webkit-animation-timing-function: linear; }
|
||||
}
|
||||
|
||||
@keyframes move-menu {
|
||||
0%, 14%, 100% { transform: translateY(0px); animation-timing-function: ease-in; }
|
||||
28%, 68.6957% { transform: translateY(-220px); animation-timing-function: linear; }
|
||||
80% { transform: translateY(-320px); animation-timing-function: linear; }
|
||||
99.9999% { transform: translateY(-680px); animation-timing-function: linear; }
|
||||
}
|
||||
|
||||
</style>
|
||||
</defs>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
|
@ -0,0 +1,612 @@
|
|||
{{-- Vue Blade de la page d'erreur lors d'une maintenance de l'application--}}
|
||||
@extends('body-nomenu')
|
||||
|
||||
@section('top-css')
|
||||
@parent
|
||||
<style>
|
||||
.crane__list,
|
||||
.skyscrappers__list,
|
||||
.tree__container {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.advice {
|
||||
display: flex;
|
||||
height: 50vh;
|
||||
width: 100vw;
|
||||
flex-flow: column nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.advice__title {
|
||||
font-size: 3rem;
|
||||
text-align: center;
|
||||
}
|
||||
.advice__description {
|
||||
margin-top: 1rem;
|
||||
font-size: 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
.advice__description span:first-child {
|
||||
margin-right: -0.7rem;
|
||||
}
|
||||
.advice__description span:last-child {
|
||||
margin-left: -0.7rem;
|
||||
}
|
||||
|
||||
.city-stuff {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
bottom: 0;
|
||||
overflow: hidden;
|
||||
box-shadow: inset 0 -60px 0 -30px #969696;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.skyscrappers__list {
|
||||
width: 100%;
|
||||
height: 86.6666666667px;
|
||||
left: 0;
|
||||
}
|
||||
.skyscrappers__list .skyscrapper__item {
|
||||
position: absolute;
|
||||
height: inherit;
|
||||
bottom: 15%;
|
||||
width: 43.3333333333px;
|
||||
background: linear-gradient(115deg, #969696 73%, #7d7d7d 73%, #7d7d7d 100%);
|
||||
}
|
||||
.skyscrappers__list .skyscrapper__item::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
left: 10%;
|
||||
bottom: 10%;
|
||||
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAFElEQVQImWP4////fwYYIJKDEwAAfPsP8eFXG40AAAAASUVORK5CYII=") space;
|
||||
}
|
||||
.skyscrappers__list .skyscrapper__item:last-child:not(:only-child) {
|
||||
background: #969696;
|
||||
}
|
||||
.skyscrappers__list .skyscrapper-1 {
|
||||
width: 121.3333333333px;
|
||||
height: 138.6666666667px;
|
||||
right: 25%;
|
||||
bottom: 0;
|
||||
z-index: 10;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
@media screen and (max-width: 450px) {
|
||||
.skyscrappers__list .skyscrapper-1 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.skyscrappers__list .skyscrapper-2 {
|
||||
width: 60.6666666667px;
|
||||
height: 69.3333333333px;
|
||||
right: 35%;
|
||||
bottom: 0;
|
||||
z-index: 10;
|
||||
transform: rotate(180deg);
|
||||
bottom: 10%;
|
||||
}
|
||||
@media screen and (max-width: 900px) {
|
||||
.skyscrappers__list .skyscrapper-2 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 450px) {
|
||||
.skyscrappers__list .skyscrapper-1 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.skyscrappers__list .skyscrapper-3 {
|
||||
width: 40.4444444444px;
|
||||
height: 46.2222222222px;
|
||||
right: 45%;
|
||||
bottom: 0;
|
||||
z-index: 10;
|
||||
transform: rotate(180deg);
|
||||
height: 115.5555555556px;
|
||||
}
|
||||
@media screen and (max-width: 900px) {
|
||||
.skyscrappers__list .skyscrapper-3 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 450px) {
|
||||
.skyscrappers__list .skyscrapper-1 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.skyscrappers__list .skyscrapper-4 {
|
||||
width: 30.3333333333px;
|
||||
height: 34.6666666667px;
|
||||
right: 55%;
|
||||
bottom: 0;
|
||||
z-index: 10;
|
||||
transform: rotate(180deg);
|
||||
height: 86.6666666667px;
|
||||
}
|
||||
.skyscrappers__list .skyscrapper-4::after {
|
||||
width: 20%;
|
||||
height: 60%;
|
||||
left: 25%;
|
||||
}
|
||||
@media screen and (max-width: 450px) {
|
||||
.skyscrappers__list .skyscrapper-1 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.skyscrappers__list .skyscrapper-5 {
|
||||
width: 24.2666666667px;
|
||||
height: 27.7333333333px;
|
||||
right: 65%;
|
||||
bottom: 0;
|
||||
z-index: 10;
|
||||
transform: rotate(180deg);
|
||||
width: 7%;
|
||||
right: 67%;
|
||||
height: 50%;
|
||||
z-index: 11;
|
||||
}
|
||||
.skyscrappers__list .skyscrapper-5::after {
|
||||
height: 0;
|
||||
}
|
||||
@media screen and (max-width: 450px) {
|
||||
.skyscrappers__list .skyscrapper-1 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.crane-cabin, .crane-arm, .crane-picker {
|
||||
transform-origin: 80% center;
|
||||
-webkit-animation: crane__movement 12s infinite alternate;
|
||||
animation: crane__movement 12s infinite alternate;
|
||||
}
|
||||
|
||||
.crane__list {
|
||||
width: 260px;
|
||||
height: 173.3333333333px;
|
||||
z-index: 0;
|
||||
perspective: 600px;
|
||||
}
|
||||
.crane__list .crane__item {
|
||||
position: absolute;
|
||||
border: solid 1px #969696;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.crane__list .crane-cable {
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
border: none;
|
||||
outline: 1px solid transparent;
|
||||
background: #969696;
|
||||
z-index: 0;
|
||||
}
|
||||
.crane__list .crane-cable-1 {
|
||||
width: 60%;
|
||||
top: 0;
|
||||
left: 11%;
|
||||
transform-origin: right 0;
|
||||
-webkit-animation: cable-1__movement 12s infinite alternate;
|
||||
animation: cable-1__movement 12s infinite alternate;
|
||||
}
|
||||
.crane__list .crane-cable-2 {
|
||||
width: 19%;
|
||||
top: 0;
|
||||
right: 8%;
|
||||
transform-origin: top left;
|
||||
-webkit-animation: cable-2__movement 12s infinite alternate;
|
||||
animation: cable-2__movement 12s infinite alternate;
|
||||
}
|
||||
.crane__list .crane-cable-3 {
|
||||
height: 30%;
|
||||
top: 22%;
|
||||
left: 9%;
|
||||
transform-origin: right center;
|
||||
-webkit-animation: cable-3__movement 12s ease-in-out infinite alternate;
|
||||
animation: cable-3__movement 12s ease-in-out infinite alternate;
|
||||
}
|
||||
.crane__list .crane-cable-3::after {
|
||||
content: "";
|
||||
display: block;
|
||||
position: absolute;
|
||||
height: 0.2em;
|
||||
width: 9000%;
|
||||
bottom: 0;
|
||||
left: -4500%;
|
||||
background: #c9c9c9;
|
||||
border: 1px solid #969696;
|
||||
}
|
||||
.crane__list .crane-stand {
|
||||
width: 5%;
|
||||
height: 100%;
|
||||
right: 25%;
|
||||
z-index: 1;
|
||||
background: linear-gradient(to top, #969696, #e3e3e3);
|
||||
}
|
||||
.crane__list .crane-weight {
|
||||
width: 8%;
|
||||
height: 20%;
|
||||
right: 4%;
|
||||
top: 12%;
|
||||
z-index: 2;
|
||||
background: #d6d6d6;
|
||||
transform-origin: 0 center;
|
||||
-webkit-animation: crane-weight__movement 12s infinite alternate;
|
||||
animation: crane-weight__movement 12s infinite alternate;
|
||||
}
|
||||
.crane__list .crane-cabin {
|
||||
width: 12%;
|
||||
height: 9%;
|
||||
right: 24%;
|
||||
top: 20%;
|
||||
z-index: 2;
|
||||
background: #d6d6d6;
|
||||
}
|
||||
.crane__list .crane-cabin::after {
|
||||
content: "";
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 10%;
|
||||
top: 60%;
|
||||
left: 0;
|
||||
background: white;
|
||||
}
|
||||
.crane__list .crane-arm {
|
||||
width: 100%;
|
||||
height: 7%;
|
||||
top: 15%;
|
||||
border-top-left-radius: 10px;
|
||||
z-index: 3;
|
||||
background: #d6d6d6;
|
||||
}
|
||||
|
||||
.crane-1 {
|
||||
left: 20%;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.crane-2 {
|
||||
left: 30%;
|
||||
z-index: 10;
|
||||
bottom: -1rem;
|
||||
z-index: -1;
|
||||
transform: scale(0.75) scaleX(-1);
|
||||
}
|
||||
@media screen and (max-width: 900px) {
|
||||
.crane-2 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.crane-2 .crane-cable-3 {
|
||||
-webkit-animation-delay: 3s;
|
||||
animation-delay: 3s;
|
||||
}
|
||||
|
||||
.crane-3 {
|
||||
left: 40%;
|
||||
z-index: 10;
|
||||
bottom: -0.5rem;
|
||||
transform: scale(0.8);
|
||||
}
|
||||
@media screen and (max-width: 900px) {
|
||||
.crane-3 {
|
||||
z-index: -1;
|
||||
transform: scale(0.75) scaleX(-1);
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 900px) {
|
||||
.crane-3 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.crane-3 .crane-cable-3 {
|
||||
-webkit-animation-delay: 4.5s;
|
||||
animation-delay: 4.5s;
|
||||
}
|
||||
|
||||
.tree__container {
|
||||
width: 100%;
|
||||
height: 62.6666666667px;
|
||||
left: 0;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.tree__item {
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
position: absolute;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
left: 60%;
|
||||
}
|
||||
|
||||
.tree__trunk {
|
||||
order: 2;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 4px;
|
||||
height: 8px;
|
||||
margin-top: 8px;
|
||||
border-radius: 2px;
|
||||
background: #57473d;
|
||||
}
|
||||
|
||||
.tree__leaves {
|
||||
order: 1;
|
||||
position: relative;
|
||||
border-top: 0 solid transparent;
|
||||
border-right: 4px solid transparent;
|
||||
border-bottom: 32px solid #969696;
|
||||
border-left: 4px solid transparent;
|
||||
}
|
||||
.tree__leaves::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
left: -4px;
|
||||
border-top: 0;
|
||||
border-right: 0;
|
||||
border-bottom: 32px solid #7d7d7d;
|
||||
border-left: 4px solid transparent;
|
||||
}
|
||||
|
||||
.tree-1 {
|
||||
left: 66%;
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
.tree-1 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.tree-2 {
|
||||
left: 67%;
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
.tree-2 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.tree-4 {
|
||||
left: 57%;
|
||||
}
|
||||
|
||||
.tree-5 {
|
||||
left: 58%;
|
||||
}
|
||||
|
||||
.tree-7 {
|
||||
left: 51%;
|
||||
}
|
||||
@media screen and (max-width: 450px) {
|
||||
.tree-7 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.tree-8 {
|
||||
left: 52%;
|
||||
}
|
||||
@media screen and (max-width: 450px) {
|
||||
.tree-8 {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes cable-1__movement {
|
||||
0%, 20% {
|
||||
transform: rotateY(0) rotateZ(-10deg);
|
||||
}
|
||||
70%, 100% {
|
||||
transform: rotateY(45deg) rotateZ(-10deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes cable-1__movement {
|
||||
0%, 20% {
|
||||
transform: rotateY(0) rotateZ(-10deg);
|
||||
}
|
||||
70%, 100% {
|
||||
transform: rotateY(45deg) rotateZ(-10deg);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes cable-2__movement {
|
||||
0%, 20% {
|
||||
transform: rotateY(0) rotateZ(29deg);
|
||||
}
|
||||
70%, 100% {
|
||||
transform: rotateY(15deg) rotateZ(29deg);
|
||||
}
|
||||
}
|
||||
@keyframes cable-2__movement {
|
||||
0%, 20% {
|
||||
transform: rotateY(0) rotateZ(29deg);
|
||||
}
|
||||
70%, 100% {
|
||||
transform: rotateY(15deg) rotateZ(29deg);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes cable-3__movement {
|
||||
0% {
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
20% {
|
||||
transform: translate(2500%, -18%);
|
||||
}
|
||||
60% {
|
||||
transform: translate(11000%, -25%);
|
||||
}
|
||||
70% {
|
||||
height: 30%;
|
||||
transform: translate(9100%, -25%);
|
||||
}
|
||||
90%, 100% {
|
||||
height: 80%;
|
||||
transform: translate(9100%, -15%);
|
||||
}
|
||||
}
|
||||
@keyframes cable-3__movement {
|
||||
0% {
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
20% {
|
||||
transform: translate(2500%, -18%);
|
||||
}
|
||||
60% {
|
||||
transform: translate(11000%, -25%);
|
||||
}
|
||||
70% {
|
||||
height: 30%;
|
||||
transform: translate(9100%, -25%);
|
||||
}
|
||||
90%, 100% {
|
||||
height: 80%;
|
||||
transform: translate(9100%, -15%);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes crane__movement {
|
||||
0%, 20% {
|
||||
transform: rotateY(0);
|
||||
}
|
||||
70%, 100% {
|
||||
transform: rotateY(45deg);
|
||||
}
|
||||
}
|
||||
@keyframes crane__movement {
|
||||
0%, 20% {
|
||||
transform: rotateY(0);
|
||||
}
|
||||
70%, 100% {
|
||||
transform: rotateY(45deg);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes crane-weight__movement {
|
||||
0%, 20% {
|
||||
transform: rotateY(0) translateX(0);
|
||||
}
|
||||
70%, 100% {
|
||||
transform: rotateY(45deg) translateX(-50%);
|
||||
}
|
||||
}
|
||||
@keyframes crane-weight__movement {
|
||||
0%, 20% {
|
||||
transform: rotateY(0) translateX(0);
|
||||
}
|
||||
70%, 100% {
|
||||
transform: rotateY(45deg) translateX(-50%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div id="access-denied" style="overflow: hidden;">
|
||||
<div class="container">
|
||||
<h1>:) Oops!</h1>
|
||||
<br /><br />
|
||||
<h2>Temporairement fermée pour maintenance</h2>
|
||||
@if(\MVC\Classe\Application::is_under_update())
|
||||
<pre>{{MAINTENANCE_MESSAGE}}</pre>
|
||||
@endif
|
||||
<br /><br />
|
||||
<h3>L'application est de retour bientôt!</h3>
|
||||
<p>
|
||||
Désolé pour cette gêne mais il se trouve que l'application est en maintenance à ce moment !
|
||||
<br/>
|
||||
— Le service
|
||||
<br/>
|
||||
<a href="mailto:application@localhost.fr">application@localhost.fr</a>
|
||||
</p>
|
||||
<br /><br />
|
||||
<br /><br />
|
||||
<br /><br />
|
||||
<br /><br />
|
||||
<br /><br />
|
||||
<br /><br />
|
||||
<div id="gears">
|
||||
<section class="city-stuff">
|
||||
<ul class="skyscrappers__list">
|
||||
<li class="skyscrapper__item skyscrapper-1"></li>
|
||||
<li class="skyscrapper__item skyscrapper-2"></li>
|
||||
<li class="skyscrapper__item skyscrapper-3"></li>
|
||||
<li class="skyscrapper__item skyscrapper-4"></li>
|
||||
<li class="skyscrapper__item skyscrapper-5"></li>
|
||||
</ul>
|
||||
<ul class="tree__container">
|
||||
<li class="tree__list">
|
||||
<ul class="tree__item tree-1">
|
||||
<li class="tree__trunk"></li>
|
||||
<li class="tree__leaves"></li>
|
||||
</ul>
|
||||
<ul class="tree__item tree-2">
|
||||
<li class="tree__trunk"></li>
|
||||
<li class="tree__leaves"></li>
|
||||
</ul>
|
||||
<ul class="tree__item tree-3">
|
||||
<li class="tree__trunk"></li>
|
||||
<li class="tree__leaves"></li>
|
||||
</ul>
|
||||
<ul class="tree__item tree-4">
|
||||
<li class="tree__trunk"></li>
|
||||
<li class="tree__leaves"></li>
|
||||
</ul>
|
||||
<ul class="tree__item tree-5">
|
||||
<li class="tree__trunk"></li>
|
||||
<li class="tree__leaves"></li>
|
||||
</ul>
|
||||
<ul class="tree__item tree-6">
|
||||
<li class="tree__trunk"></li>
|
||||
<li class="tree__leaves"></li>
|
||||
</ul>
|
||||
<ul class="tree__item tree-7">
|
||||
<li class="tree__trunk"></li>
|
||||
<li class="tree__leaves"></li>
|
||||
</ul>
|
||||
<ul class="tree__item tree-8">
|
||||
<li class="tree__trunk"></li>
|
||||
<li class="tree__leaves"></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="crane__list crane-1">
|
||||
<li class="crane__item crane-cable crane-cable-1"></li>
|
||||
<li class="crane__item crane-cable crane-cable-2"></li>
|
||||
<li class="crane__item crane-cable crane-cable-3"></li>
|
||||
<li class="crane__item crane-stand"></li>
|
||||
<li class="crane__item crane-weight"></li>
|
||||
<li class="crane__item crane-cabin"></li>
|
||||
<li class="crane__item crane-arm"></li>
|
||||
</ul>
|
||||
<ul class="crane__list crane-2">
|
||||
<li class="crane__item crane-cable crane-cable-1"></li>
|
||||
<li class="crane__item crane-cable crane-cable-2"></li>
|
||||
<li class="crane__item crane-cable crane-cable-3"></li>
|
||||
<li class="crane__item crane-stand"></li>
|
||||
<li class="crane__item crane-weight"></li>
|
||||
<li class="crane__item crane-cabin"></li>
|
||||
<li class="crane__item crane-arm"></li>
|
||||
</ul>
|
||||
<ul class="crane__list crane-3">
|
||||
<li class="crane__item crane-cable crane-cable-1"></li>
|
||||
<li class="crane__item crane-cable crane-cable-2"></li>
|
||||
<li class="crane__item crane-cable crane-cable-3"></li>
|
||||
<li class="crane__item crane-stand"></li>
|
||||
<li class="crane__item crane-weight"></li>
|
||||
<li class="crane__item crane-cabin"></li>
|
||||
<li class="crane__item crane-arm"></li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
@section('bottom-javascript')
|
||||
@parent
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://cdn.3up.dk/in-view@0.6.1"></script>
|
||||
<script type="text/javascript">
|
||||
var formatThousandsNoRounding = function(n, dp){
|
||||
|
|
51
application/include/vues/view/feedback.blade.php
Normal file
51
application/include/vues/view/feedback.blade.php
Normal file
|
@ -0,0 +1,51 @@
|
|||
@extends('body')
|
||||
|
||||
|
||||
@section('content')
|
||||
<div class="flex-center-container">
|
||||
De 1 à 10, combien d'étoiles donneriez-vous pour le framework SAND?
|
||||
<br/><br/><br/>
|
||||
<div class="form-field box">
|
||||
<form method="POST" action="{{\MVC\Classe\Url::link_rewrite(true,"send-feedback")}}">
|
||||
<select name="glsr-custom-options" id="glsr-custom-options" class="star-rating" data-options='{"clearable":false, "tooltip":true}'>
|
||||
<option value="">Select a rating</option>
|
||||
<option value="10">10</option>
|
||||
<option value="9">9</option>
|
||||
<option value="8" selected>8</option>
|
||||
<option value="7">7</option>
|
||||
<option value="6">6</option>
|
||||
<option value="5">5</option>
|
||||
<option value="4">4</option>
|
||||
<option value="3">3</option>
|
||||
<option value="2">2</option>
|
||||
<option value="1">1</option>
|
||||
</select>
|
||||
<br/>
|
||||
<input type="submit" class="btn btn-outline-primary" value="Noter">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<center>
|
||||
<br/><br/>
|
||||
<br/><br/>
|
||||
<br/><br/>
|
||||
Un bug, une question ? envoyez-moi un courriel !
|
||||
</center>
|
||||
@endsection
|
||||
|
||||
@section('top-css')
|
||||
@parent
|
||||
<link rel="stylesheet" href="{{\MVC\Classe\Url::asset_rewrite('assets/star-rating.js-master/dist/star-rating.css')}}">
|
||||
@endsection
|
||||
|
||||
@section('top-javascript')
|
||||
@parent
|
||||
<script src="{{\MVC\Classe\Url::asset_rewrite('assets/star-rating.js-master/dist/star-rating.js')}}"></script>
|
||||
@endsection
|
||||
|
||||
@section('bottom-javascript')
|
||||
@parent
|
||||
<script>
|
||||
var stars = new StarRating('.star-rating');
|
||||
</script>
|
||||
@endsection
|
11
application/include/vues/view/gitlist.blade.php
Normal file
11
application/include/vues/view/gitlist.blade.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
@extends('body')
|
||||
|
||||
@section('sidebar')
|
||||
@parent
|
||||
|
||||
<p>This is appended to the master sidebar.</p>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
{{$app->load('gitlist')}}
|
||||
@endsection
|
|
@ -10,12 +10,11 @@
|
|||
<h1>Accueil de l'url</h1>
|
||||
<h2> {{$_SERVER['SERVER_NAME']}}</h2>
|
||||
<br /><br /><br />
|
||||
<a href="{{ \MVC\Classe\Url::link_rewrite(false, 'authentification', []) }}">S'authentifier ?</a>
|
||||
<hr/>
|
||||
{{$templating_a}}::{{$templating_b}}::{{$templating_c}}
|
||||
|
||||
{{\MVC\Classe\ControlleurAction::inserer('default',[])}}
|
||||
{{\MVC\Classe\ControlleurAction::inserer('default.default',[4,5,6])}}
|
||||
{{\MVC\Classe\ControlleurAction::inserer('default.defaultBlade',[4,5,6])}}
|
||||
{{\MVC\Classe\ControlleurAction::inserer('default.variableSlug',['var1','var2','var3'])}}
|
||||
|
||||
@endsection
|
||||
|
|
|
@ -1 +1,10 @@
|
|||
INDEX
|
||||
{% extends "body.html.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Accueil de l'url</h1>
|
||||
<h2> {{server('SERVER_NAME')}}</h2>
|
||||
<br /><br /><br />
|
||||
<hr/>
|
||||
{{templating_a}}::{{templating_b}}::{{templating_c}}
|
||||
{{ action('default.defaultTwig',[4,5,6]) }}
|
||||
{% endblock %}
|
|
@ -11,12 +11,7 @@
|
|||
<br/>
|
||||
<p>1. Ce FrameWork est le fruit d'un travail personnel.</p><br/>
|
||||
<p>2. Certaines Parties du Framework sont le fruit d'un travail aboutit d'autres personnes</p><br/>
|
||||
<p>3. Ce Framework sera publié en open-source sous <a href="https://creativecommons.org/publicdomain/zero/1.0/deed.fr">licence CC Universal</a> ou <a href="https://creativecommons.org/licenses/by/4.0/deed.fr">licence CC-by-SA</a> suivant la disponibilité de l'auteur. </p>
|
||||
<p>3. Ce Framework sera publié en open-source sous <a href="https://creativecommons.org/publicdomain/zero/1.0/deed.fr">licence CC Universal</a>, <a href="https://creativecommons.org/licenses/by/4.0/deed.fr">licence CC-by-SA</a> ou <a href="https://choosealicense.com/licenses/mit/">MIT Licence</a> suivant la disponibilité de l'auteur, ainsi que les licences le composant. </p>
|
||||
<br/>
|
||||
...
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<p>Si cela ne vous plait pas veuillez envoyer un courriel à l'auteur et nous en parlerons le plus calmement possible.</p>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
|
69
application/include/vues/view/react.blade.php
Normal file
69
application/include/vues/view/react.blade.php
Normal file
|
@ -0,0 +1,69 @@
|
|||
@extends('body')
|
||||
|
||||
@section('top-javascript')
|
||||
@parent
|
||||
<script src="https://unpkg.com/react@^16/umd/react.production.min.js"></script>
|
||||
<script src="https://unpkg.com/react-dom@16.13.0/umd/react-dom.production.min.js"></script>
|
||||
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<h1>%PAGE% - REACT.js Controlleur</h1>
|
||||
<br/><br/><br/>
|
||||
<div id="root"></div>
|
||||
@endsection
|
||||
|
||||
@section('bottom-javascript')
|
||||
@parent
|
||||
<script type="text/babel">
|
||||
class App extends React.Component {
|
||||
state = {
|
||||
data: [],
|
||||
}
|
||||
|
||||
// Code is invoked after the component is mounted/inserted into the DOM tree.
|
||||
componentDidMount() {
|
||||
const url =
|
||||
'https://ghibliapi.herokuapp.com/films'
|
||||
|
||||
fetch(url)
|
||||
.then((result) => result.json())
|
||||
.then((result) => {
|
||||
this.setState({
|
||||
data: result,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const {data} = this.state
|
||||
|
||||
const result = data.map(obj => {
|
||||
return (
|
||||
<a href="#" key="{obj.id}">
|
||||
<div>
|
||||
<div>
|
||||
<h2>
|
||||
{obj.title}
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
{obj.description.slice(0, 300) + "..." }
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<span>Year : {obj.release_date }</span>
|
||||
<span>Director : {obj.director }</span>
|
||||
<span>Producer : {obj.producer }</span>
|
||||
</div>
|
||||
</a>);
|
||||
})
|
||||
return <div>{result}</div>
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('root'))
|
||||
</script>
|
||||
@endsection
|
82
application/include/vues/view/vuejs.blade.php
Normal file
82
application/include/vues/view/vuejs.blade.php
Normal file
|
@ -0,0 +1,82 @@
|
|||
@extends('body')
|
||||
|
||||
@section('top-javascript')
|
||||
@parent
|
||||
<script src="https://unpkg.com/vue@2.6.12/dist/vue.js"></script>
|
||||
<script src="https://unpkg.com/axios@0.21.1/dist/axios.min.js"></script>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<h1>%PAGE% - VUE.js Controlleur</h1>
|
||||
<br/><br/><br/>
|
||||
<div id="app">
|
||||
<div>
|
||||
<input v-model="searchText" placeholder="Search...">
|
||||
</div>
|
||||
<div v-if="is_loading">
|
||||
<div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div>
|
||||
</div>
|
||||
<div v-if="items" >
|
||||
<a href="#" v-for="item in itemsSearched" :key="item.id">
|
||||
<div>
|
||||
<div>
|
||||
<h2>
|
||||
@{{ item.title }}
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p>
|
||||
@{{ item.description.slice(0, 300) + "..." }}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<span>Year : @{{ item.release_date }}</span>
|
||||
<span>Director : @{{ item.director }}</span>
|
||||
<span>Producer : @{{ item.producer }}</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('bottom-javascript')
|
||||
@parent
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
items: [],
|
||||
searchText: '',
|
||||
is_loading: true,
|
||||
},
|
||||
mounted() {
|
||||
axios
|
||||
.get('https://ghibliapi.herokuapp.com/films')
|
||||
.then(response => {
|
||||
this.items = response.data;
|
||||
this.is_loading = false
|
||||
})
|
||||
.catch(error => console.log(error))
|
||||
},
|
||||
computed : {
|
||||
itemsSearched : function(){
|
||||
var self = this;
|
||||
if( this.searchText == ''){
|
||||
return this.items;
|
||||
}
|
||||
return this.items.filter(function(item){
|
||||
// https://www.reddit.com/r/vuejs/comments/62kfae/how_do_i_create_very_simple_instant_search_filter/
|
||||
// Must be of string type
|
||||
return item.title.toLowerCase().indexOf(self.searchText) >= 0 ||
|
||||
item.producer.toLowerCase().indexOf(self.searchText) >= 0 ||
|
||||
item.director.toLowerCase().indexOf(self.searchText) >= 0 ||
|
||||
item.release_date.toString().indexOf(self.searchText) >= 0;
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endsection
|
1
application/modules/gitlist/.gitignore
vendored
Normal file
1
application/modules/gitlist/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
!/vendor
|
14
application/modules/gitlist/.htaccess
Normal file
14
application/modules/gitlist/.htaccess
Normal file
|
@ -0,0 +1,14 @@
|
|||
<IfModule mod_rewrite.c>
|
||||
Options -MultiViews +SymLinksIfOwnerMatch
|
||||
|
||||
RewriteEngine On
|
||||
#RewriteBase /path/to/gitlist/
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^(.*)$ index.php/$1 [L,NC]
|
||||
</IfModule>
|
||||
<Files config.ini>
|
||||
order allow,deny
|
||||
deny from all
|
||||
</Files>
|
96
application/modules/gitlist/INSTALL.md
Normal file
96
application/modules/gitlist/INSTALL.md
Normal file
|
@ -0,0 +1,96 @@
|
|||
# GitList Installation
|
||||
* Download GitList from [gitlist.org](http://gitlist.org/) and decompress to your `/var/www/gitlist` folder, or anywhere else you want to place GitList.
|
||||
* Rename the `config.ini-example` file to `config.ini`.
|
||||
* Open up the `config.ini` and configure your installation. You'll have to provide where your repositories are located and the base GitList URL (in our case, http://localhost/gitlist).
|
||||
* Create the cache folder and give read/write permissions to your web server user:
|
||||
|
||||
```
|
||||
cd /var/www/gitlist
|
||||
mkdir cache
|
||||
chmod 777 cache
|
||||
```
|
||||
|
||||
That's it, installation complete!
|
||||
|
||||
## Webserver configuration
|
||||
Apache is the "default" webserver for GitList. You will find the configuration inside the `.htaccess` file. However, nginx and lighttpd are also supported.
|
||||
|
||||
### nginx server.conf
|
||||
|
||||
```
|
||||
server {
|
||||
server_name MYSERVER;
|
||||
access_log /var/log/nginx/MYSERVER.access.log combined;
|
||||
error_log /var/log/nginx/MYSERVER.error.log error;
|
||||
|
||||
root /var/www/DIR;
|
||||
index index.php;
|
||||
|
||||
# auth_basic "Restricted";
|
||||
# auth_basic_user_file .htpasswd;
|
||||
|
||||
location = /robots.txt {
|
||||
allow all;
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location ~* ^/index.php.*$ {
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
|
||||
# if you're using php5-fpm via tcp
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
|
||||
# if you're using php5-fpm via socket
|
||||
#fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
|
||||
include /etc/nginx/fastcgi_params;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri @gitlist;
|
||||
}
|
||||
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
|
||||
add_header Vary "Accept-Encoding";
|
||||
expires max;
|
||||
try_files $uri @gitlist;
|
||||
tcp_nodelay off;
|
||||
tcp_nopush on;
|
||||
}
|
||||
|
||||
# location ~* \.(git|svn|patch|htaccess|log|route|plist|inc|json|pl|po|sh|ini|sample|kdev4)$ {
|
||||
# deny all;
|
||||
# }
|
||||
|
||||
location @gitlist {
|
||||
rewrite ^/.*$ /index.php;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### lighttpd
|
||||
|
||||
```
|
||||
# GitList is located in /var/www/gitlist
|
||||
server.document-root = "/var/www"
|
||||
|
||||
url.rewrite-once = (
|
||||
"^/gitlist/web/.+" => "$0",
|
||||
"^/gitlist/favicon\.ico$" => "$0",
|
||||
"^/gitlist(/[^\?]*)(\?.*)?" => "/gitlist/index.php$1$2"
|
||||
)
|
||||
```
|
||||
|
||||
### hiawatha
|
||||
|
||||
```
|
||||
UrlToolkit {
|
||||
ToolkitID = gitlist
|
||||
RequestURI isfile Return
|
||||
# If you have example.com/gitlist/ ; Otherwise remove "/gitlist" below
|
||||
Match ^/gitlist/.* Rewrite /gitlist/index.php
|
||||
Match ^/gitlist/.*\.ini DenyAccess
|
||||
}
|
||||
```
|
9
application/modules/gitlist/LICENSE.txt
Normal file
9
application/modules/gitlist/LICENSE.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
Copyright (c) 2012, Klaus Silveira and contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
Neither the name of GitList nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
86
application/modules/gitlist/README.md
Normal file
86
application/modules/gitlist/README.md
Normal file
|
@ -0,0 +1,86 @@
|
|||
<p align="left"><img src="logo/horizontal.png" alt=gitlist" height="120px"></p>
|
||||
|
||||
# GitList: an elegant git repository viewer
|
||||
[![Build Status](https://secure.travis-ci.org/klaussilveira/gitlist.png)](http://travis-ci.org/klaussilveira/gitlist)
|
||||
|
||||
GitList is an elegant and modern web interface for interacting with multiple git repositories. It allows you to browse repositories using your favorite browser, viewing files under different revisions, commit history, diffs. It also generates RSS feeds for each repository, allowing you to stay up-to-date with the latest changes anytime, anywhere. GitList was written in PHP, on top of the [Silex](http://silex.sensiolabs.org/) microframework and powered by the Twig template engine. This means that GitList is easy to install and easy to customize. Also, the GitList gorgeous interface was made possible due to [Bootstrap](http://twitter.github.com/bootstrap/).
|
||||
|
||||
## Features
|
||||
* Multiple repository support
|
||||
* Multiple branch support
|
||||
* Multiple tag support
|
||||
* Commit history, blame, diff
|
||||
* RSS feeds
|
||||
* Syntax highlighting
|
||||
* Repository statistics
|
||||
|
||||
## Screenshots
|
||||
![Screenshot 1](https://raw.githubusercontent.com/klaussilveira/gitlist/gh-pages/img/roller/1.png)
|
||||
![Screenshot 2](https://raw.githubusercontent.com/klaussilveira/gitlist/gh-pages/img/roller/2.png)
|
||||
![Screenshot 3](https://raw.githubusercontent.com/klaussilveira/gitlist/gh-pages/img/roller/3.png)
|
||||
![Screenshot 4](https://raw.githubusercontent.com/klaussilveira/gitlist/gh-pages/img/roller/4.png)
|
||||
![Screenshot 5](https://raw.githubusercontent.com/klaussilveira/gitlist/gh-pages/img/roller/5.png)
|
||||
![Screenshot 6](https://raw.githubusercontent.com/klaussilveira/gitlist/gh-pages/img/roller/6.png)
|
||||
![Screenshot 7](https://raw.githubusercontent.com/klaussilveira/gitlist/gh-pages/img/roller/7.png)
|
||||
![Screenshot 8](https://raw.githubusercontent.com/klaussilveira/gitlist/gh-pages/img/roller/8.png)
|
||||
![Screenshot 9](https://raw.githubusercontent.com/klaussilveira/gitlist/gh-pages/img/roller/9.png)
|
||||
![Screenshot 10](https://raw.githubusercontent.com/klaussilveira/gitlist/gh-pages/img/roller/10.png)
|
||||
|
||||
## Requirements
|
||||
In order to run GitList on your server, you'll need:
|
||||
|
||||
* PHP 5.3+
|
||||
* git
|
||||
* Webserver (Apache, nginx, lighttpd)
|
||||
|
||||
## Installation
|
||||
* Download GitList from [gitlist.org](http://gitlist.org/) and decompress to your `/var/www/gitlist` folder, or anywhere else you want to place GitList.
|
||||
* Do not download a branch or tag from GitHub, unless you want to use the development version. The version available for download at the website already has all dependencies bundled, so you don't have to use composer or any other tool
|
||||
* Rename the `config.ini-example` file to `config.ini`.
|
||||
* Open up the `config.ini` and configure your installation. You'll have to provide where your repositories are located.
|
||||
* In case GitList isn't accessed through the root of the website, open .htaccess and edit RewriteBase (for example, /gitlist/ if GitList is accessed through http://localhost/gitlist/).
|
||||
* Create the cache folder and give read/write permissions to your web server user:
|
||||
|
||||
```
|
||||
cd /var/www/gitlist
|
||||
mkdir cache
|
||||
chmod 777 cache
|
||||
```
|
||||
|
||||
That's it, installation complete! If you're having problems, check the [Troubleshooting](https://github.com/klaussilveira/gitlist/wiki/Troubleshooting) page.
|
||||
|
||||
|
||||
## Authors and contributors
|
||||
* [Klaus Silveira](http://www.klaussilveira.com) (Creator, developer)
|
||||
|
||||
## License
|
||||
[New BSD license](http://www.opensource.org/licenses/bsd-license.php)
|
||||
|
||||
## Development
|
||||
GitList uses [Composer](http://getcomposer.org/) to manage dependencies and [Ant](http://ant.apache.org/) to build the project.
|
||||
|
||||
Once you have all the dependencies set, you can clone the repository and run Ant:
|
||||
|
||||
```
|
||||
git clone https://github.com/klaussilveira/gitlist.git
|
||||
ant
|
||||
```
|
||||
|
||||
If you just want to get the project dependencies, instead of building everything:
|
||||
|
||||
```
|
||||
git clone https://github.com/klaussilveira/gitlist.git
|
||||
curl -s http://getcomposer.org/installer | php
|
||||
php composer.phar install
|
||||
```
|
||||
|
||||
If you have Composer in your path, things get easier. But you know the drill.
|
||||
|
||||
## Contributing
|
||||
If you are a developer, we need your help. GitList is a young project and we have lots of stuff to do. Some developers are contributing with new features, others with bug fixes. But you can also dedicate yourself to refactoring the current codebase and improving what we already have. This is very important, we want GitList to be a state-of-the-art application, and we need your help for that.
|
||||
|
||||
* Stay tuned to possible bugs, suboptimal code, duplicated code, overcomplicated expressions and unused code
|
||||
* Improve the test coverage by creating unit and functional tests
|
||||
|
||||
## Further information
|
||||
If you want to know more about customizing GitList, check the [Customization](https://github.com/klaussilveira/gitlist/wiki/Customizing) page on the wiki. Also, if you're having problems with GitList, check the [Troubleshooting](https://github.com/klaussilveira/gitlist/wiki/Troubleshooting) page. Don't forget to report issues and suggest new features! :)
|
16
application/modules/gitlist/boot.php
Normal file
16
application/modules/gitlist/boot.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
define('MODULE_NAME','gitlist');
|
||||
|
||||
// Startup and configure Silex application
|
||||
$app = new GitList\Application($config, __DIR__);
|
||||
|
||||
// Mount the controllers
|
||||
$app->mount('', new GitList\Controller\MainController());
|
||||
$app->mount('', new GitList\Controller\BlobController());
|
||||
$app->mount('', new GitList\Controller\CommitController());
|
||||
$app->mount('', new GitList\Controller\TreeController());
|
||||
$app->mount('', new GitList\Controller\NetworkController());
|
||||
$app->mount('', new GitList\Controller\TreeGraphController());
|
||||
|
||||
return $app;
|
2
application/modules/gitlist/cache/archives/.gitignore
vendored
Normal file
2
application/modules/gitlist/cache/archives/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
2
application/modules/gitlist/cache/views/.gitignore
vendored
Normal file
2
application/modules/gitlist/cache/views/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*
|
||||
!.gitignore
|
58
application/modules/gitlist/config.ini
Normal file
58
application/modules/gitlist/config.ini
Normal file
|
@ -0,0 +1,58 @@
|
|||
[git]
|
||||
client = '/usr/bin/git' ; Your git executable path
|
||||
default_branch = 'master' ; Default branch when HEAD is detached
|
||||
repositories[] = '/home/git/repositories/' ; Path to your repositories
|
||||
; If you wish to add more repositories, just add a new line
|
||||
|
||||
; WINDOWS USERS
|
||||
;client = '"C:\Program Files (x86)\Git\bin\git.exe"' ; Your git executable path
|
||||
;repositories[] = 'C:\Path\to\Repos\' ; Path to your repositories
|
||||
|
||||
; You can hide repositories from GitList, just copy this for each repository you want to hide or add a regex (including delimiters), eg. hidden[] = '/(.+)\.git/'
|
||||
; hidden[] = '/home/git/repositories/BetaTest'
|
||||
|
||||
[app]
|
||||
debug = false
|
||||
cache = true
|
||||
theme = "default_without_html"
|
||||
title = ""
|
||||
|
||||
[clone_button]
|
||||
; ssh remote
|
||||
show_ssh_remote = false ; display remote URL for SSH
|
||||
ssh_host = '' ; host to use for cloning via HTTP (default: none => uses gitlist web host)
|
||||
ssh_url_subdir = '' ; if cloning via SSH is triggered using special dir (e.g. ssh://example.com/git/repo.git)
|
||||
; has to end with trailing slash
|
||||
ssh_port = '' ; port to use for cloning via SSH (default: 22 => standard ssh port)
|
||||
ssh_user = 'git' ; user to use for cloning via SSH
|
||||
ssh_user_dynamic = false ; when enabled, ssh_user is set to $_SERVER['PHP_AUTH_USER']
|
||||
|
||||
; http remote
|
||||
show_http_remote = false ; display remote URL for HTTP
|
||||
http_host = '' ; host to use for cloning via HTTP (default: none => uses gitlist web host)
|
||||
use_https = true ; generate URL with https://
|
||||
http_url_subdir = 'git/' ; if cloning via HTTP is triggered using virtual dir (e.g. https://example.com/git/repo.git)
|
||||
; has to end with trailing slash
|
||||
http_user = '' ; user to use for cloning via HTTP (default: none)
|
||||
http_user_dynamic = false ; when enabled, http_user is set to $_SERVER['PHP_AUTH_USER']
|
||||
|
||||
; If you need to specify custom filetypes for certain extensions, do this here
|
||||
[filetypes]
|
||||
; extension = type
|
||||
; dist = xml
|
||||
|
||||
; If you need to set file types as binary or not, do this here
|
||||
[binary_filetypes]
|
||||
; extension = true
|
||||
; svh = false
|
||||
; map = true
|
||||
|
||||
; set the timezone
|
||||
[date]
|
||||
; timezone = UTC
|
||||
; format = 'd/m/Y H:i:s'
|
||||
|
||||
; custom avatar service
|
||||
[avatar]
|
||||
; url = '//gravatar.com/avatar/'
|
||||
; query[] = 'd=identicon'
|
30
application/modules/gitlist/index.php
Normal file
30
application/modules/gitlist/index.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* GitList: an elegant and modern git repository viewer
|
||||
* http://gitlist.org
|
||||
*/
|
||||
|
||||
if (!ini_get('date.timezone')) {
|
||||
date_default_timezone_set('UTC');
|
||||
}
|
||||
|
||||
if (php_sapi_name() == 'cli-server' && file_exists(substr($_SERVER['REQUEST_URI'], 1))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_writable(__DIR__ . DIRECTORY_SEPARATOR . 'cache')) {
|
||||
die(sprintf('The "%s" folder must be writable for GitList to run.', __DIR__ . DIRECTORY_SEPARATOR . 'cache'));
|
||||
}
|
||||
|
||||
require dirname(__FILE__).DIRECTORY_SEPARATOR.'vendor/autoload.php';
|
||||
|
||||
$config = GitList\Config::fromFile(dirname(__FILE__).DIRECTORY_SEPARATOR.'config.ini');
|
||||
|
||||
if ($config->get('date', 'timezone')) {
|
||||
date_default_timezone_set($config->get('date', 'timezone'));
|
||||
}
|
||||
|
||||
$app = require 'boot.php';
|
||||
$app->run();
|
||||
|
1670
application/modules/gitlist/logo/editablefile.ai
Normal file
1670
application/modules/gitlist/logo/editablefile.ai
Normal file
File diff suppressed because one or more lines are too long
BIN
application/modules/gitlist/logo/horizontal.png
Normal file
BIN
application/modules/gitlist/logo/horizontal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
78
application/modules/gitlist/logo/horizontal.svg
Normal file
78
application/modules/gitlist/logo/horizontal.svg
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="2165.567px" height="641.871px" viewBox="0 0 2165.567 641.871" enable-background="new 0 0 2165.567 641.871"
|
||||
xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#F05133" d="M575.515,304.458L340.734,69.677c-9.099-9.1-23.853-9.1-32.955,0.002l-36.356,36.354l75.334,75.334
|
||||
c12.273-2.876,25.697,0.431,35.268,9.999c14.716,14.716,14.716,38.577,0,53.293c-14.716,14.716-38.578,14.716-53.291,0
|
||||
c-9.571-9.568-12.877-22.997-10.001-35.271l-75.332-75.332L72.999,304.46c-9.1,9.097-9.1,23.853,0,32.952l234.781,234.78
|
||||
c9.102,9.103,23.856,9.1,32.953,0l37.87-37.867L244.737,400.457l24.993-24.996l133.868,133.865l42.027-42.024L311.757,333.434
|
||||
l24.996-24.995l133.868,133.867l42.024-42.027L378.781,266.412l24.999-24.996l133.865,133.867l37.87-37.87
|
||||
C584.615,328.313,584.615,313.557,575.515,304.458z M247.981,378.705c-14.718,14.716-38.58,14.714-53.296,0
|
||||
c-14.716-14.719-14.713-38.577,0-53.292c14.719-14.716,38.578-14.716,53.296,0C262.697,340.128,262.697,363.989,247.981,378.705z
|
||||
M315.002,311.683c-14.716,14.716-38.577,14.716-53.291,0c-14.719-14.718-14.716-38.577,0-53.293
|
||||
c14.716-14.716,38.575-14.716,53.291,0C329.718,273.106,329.718,296.967,315.002,311.683z"/>
|
||||
<path fill="#FFFFFF" d="M328.735,191.367c5.146-5.146,11.42-8.452,18.022-9.999l-75.334-75.334l-28.021,28.023l75.332,75.332
|
||||
C320.28,202.79,323.586,196.515,328.735,191.367z"/>
|
||||
<path fill="#FFFFFF" d="M261.711,258.39c-14.716,14.716-14.719,38.575,0,53.293c14.713,14.716,38.575,14.716,53.291,0
|
||||
c14.716-14.716,14.716-38.577,0-53.293C300.286,243.674,276.427,243.674,261.711,258.39z"/>
|
||||
|
||||
<rect x="296.53" y="370.195" transform="matrix(-0.7071 -0.7071 0.7071 -0.7071 393.5369 938.7476)" fill="#FFFFFF" width="189.318" height="35.35"/>
|
||||
<path fill="#FFFFFF" d="M330.224,220.88l-11.491-11.491c-2.876,12.273,0.431,25.703,10.001,35.271
|
||||
c14.713,14.716,38.574,14.716,53.291,0c14.716-14.716,14.716-38.577,0-53.293c-9.571-9.568-22.995-12.875-35.268-9.999
|
||||
l11.488,11.488L330.224,220.88z"/>
|
||||
<path fill="#FFFFFF" d="M318.733,209.389l11.491,11.491l28.021-28.024l-11.488-11.488c-6.603,1.546-12.877,4.853-18.022,9.999
|
||||
C323.586,196.515,320.28,202.79,318.733,209.389z"/>
|
||||
|
||||
<rect x="363.555" y="303.171" transform="matrix(-0.7071 -0.7071 0.7071 -0.7071 555.3423 871.726)" fill="#FFFFFF" width="189.315" height="35.352"/>
|
||||
<path fill="#FFFFFF" d="M194.685,325.413c-14.713,14.715-14.716,38.573,0,53.292c14.716,14.714,38.578,14.716,53.296,0
|
||||
c14.716-14.716,14.716-38.577,0-53.292C233.263,310.697,209.404,310.697,194.685,325.413z"/>
|
||||
|
||||
<rect x="229.509" y="437.216" transform="matrix(-0.7071 -0.7071 0.7071 -0.7071 231.7255 1005.7686)" fill="#FFFFFF" width="189.316" height="35.352"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#F05133" d="M873.918,439.349v-8.16c-22.252,11.372-45.748,17.062-70.473,17.062c-21.514,0-41.483-3.959-59.901-11.87
|
||||
c-18.423-7.91-34.437-18.729-48.034-32.454c-13.603-13.725-24.238-29.795-31.899-48.218
|
||||
c-7.667-18.418-11.499-38.262-11.499-59.531c0-20.771,3.895-40.43,11.686-58.975c7.789-18.545,18.545-34.802,32.268-48.776
|
||||
c13.725-13.966,29.794-24.972,48.221-33.009c18.418-8.033,38.26-12.057,59.53-12.057c22.749,0,44.324,4.885,64.725,14.651
|
||||
c20.4,9.773,38.141,23.555,53.228,41.358l-63.056,41.914c-7.667-7.661-16.135-13.538-25.407-17.619
|
||||
c-9.273-4.081-19.104-6.12-29.489-6.12c-10.884,0-20.955,2.167-30.228,6.491c-9.272,4.331-17.313,10.077-24.11,17.248
|
||||
c-6.803,7.174-12.119,15.521-15.948,25.037c-3.837,9.522-5.749,19.599-5.749,30.228c0,10.635,1.912,20.771,5.749,30.416
|
||||
c3.83,9.642,9.208,18.051,16.135,25.222c6.919,7.174,15.022,12.923,24.294,17.245c9.273,4.33,19.344,6.491,30.228,6.491
|
||||
c11.621,0,22.684-2.594,33.196-7.788c10.508-5.191,19.347-12.484,26.521-21.885h-50.815v-69.359h126.483v162.459H873.918z"/>
|
||||
<path fill="#F05133" d="M973.32,439.349V194.917h71.584v244.432H973.32z"/>
|
||||
<path fill="#F05133" d="M1279.319,258.344h-63.057v181.005h-69.731V258.344h-63.056l-5.934-5.933v-57.494h207.711v57.494
|
||||
L1279.319,258.344z"/>
|
||||
<path fill="#F05133" d="M1308.244,439.349V151.522h79.746v216.611h151.333v71.216H1308.244z"/>
|
||||
<path fill="#F05133" d="M1558.61,439.349V194.917h71.584v244.432H1558.61z"/>
|
||||
<path fill="#F05133" d="M1770.021,447.137c-16.078,0-31.961-1.982-47.663-5.934c-15.704-3.953-30.727-9.395-45.065-16.321
|
||||
c-0.249,0-0.62-0.122-1.113-0.371c-0.498-0.241-1.113-0.49-1.855-0.739c-1.24-0.742-2.166-1.544-2.781-2.413
|
||||
c-0.62-0.864-0.926-1.541-0.926-2.039c0-0.244,1.356-2.903,4.078-7.976c2.719-5.064,5.937-10.813,9.644-17.248
|
||||
c3.461-5.685,6.679-11.185,9.644-16.504c2.969-5.315,5.438-9.581,7.421-12.798c2.716,1.24,4.758,2.169,6.12,2.783
|
||||
c1.354,0.62,2.654,1.298,3.895,2.04c10.878,5.44,21.754,9.644,32.638,12.611c10.879,2.966,22.256,4.449,34.125,4.449
|
||||
c1.729,0,3.396,0,5.008,0c1.605,0,3.274-0.122,5.007-0.371c3.71,0,7.047-0.492,10.015-1.483c2.969-1.232,5.501-2.966,7.604-5.191
|
||||
c2.099-2.227,3.152-5.565,3.152-10.015c0-3.212-1.24-5.75-3.71-7.604c-2.473-1.855-5.069-3.396-7.789-4.637
|
||||
c-1.732-0.742-3.336-1.356-4.82-1.854c-4.208-1.726-8.474-3.025-12.798-3.895c-4.328-0.864-8.715-1.79-13.167-2.781
|
||||
c-5.934-1.235-11.748-2.532-17.433-3.895c-5.692-1.356-11.255-2.781-16.69-4.266c-5.692-1.728-11.006-3.645-15.95-5.749
|
||||
c-4.948-2.099-9.644-4.509-14.094-7.232c-9.153-5.684-16.448-13.167-21.884-22.439c-5.443-9.273-8.16-21.57-8.16-36.907
|
||||
c0-10.878,2.346-21.386,7.047-31.528c4.693-9.887,10.691-17.99,17.99-24.294c7.29-6.305,15.393-11.312,24.295-15.022
|
||||
c8.901-3.71,18.174-6.242,27.817-7.604c9.644-1.354,19.287-2.039,28.931-2.039c15.821,0,31.585,1.982,47.292,5.933
|
||||
c15.699,3.959,31.093,10.635,46.179,20.029c-5.691,9.644-11.005,18.859-15.95,27.634c-4.948,8.78-10.264,17.99-15.948,27.634
|
||||
c-12.611-6.426-24.422-11.434-35.422-15.022c-11.006-3.583-22.811-5.378-35.423-5.378c-2.476,0-5.257,0.063-8.347,0.185
|
||||
c-3.092,0.13-5.934,0.685-8.53,1.671c-2.597,0.991-4.82,2.475-6.676,4.449c-1.854,1.982-2.781,4.823-2.781,8.531
|
||||
c0,2.226,0.612,4.33,1.853,6.307c0.986,1.982,3.155,3.65,6.491,5.007c3.34,1.362,7.849,2.781,13.538,4.265
|
||||
c5.438,1.484,11.437,2.909,17.99,4.266c6.548,1.362,13.289,3.03,20.216,5.007c6.92,1.733,13.966,3.772,21.143,6.121
|
||||
c7.169,2.354,13.909,5.319,20.214,8.902c6.305,3.588,11.991,7.788,17.061,12.611c5.067,4.821,9.089,10.57,12.057,17.247
|
||||
c2.224,4.947,3.768,10.264,4.637,15.948c0.863,5.689,1.297,11.255,1.297,16.689c0,16.322-3.279,29.674-9.828,40.059
|
||||
c-6.556,10.386-15.087,18.676-25.594,24.853c-10.514,6.183-22.256,10.442-35.235,12.796
|
||||
C1795.799,445.962,1782.876,447.137,1770.021,447.137z"/>
|
||||
<path fill="#F05133" d="M2093.46,258.344h-63.056v181.005h-69.731V258.344h-63.057l-5.934-5.933v-57.494h207.711v57.494
|
||||
L2093.46,258.344z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 6.8 KiB |
BIN
application/modules/gitlist/logo/logomark.png
Normal file
BIN
application/modules/gitlist/logo/logomark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
25
application/modules/gitlist/logo/logomark.svg
Normal file
25
application/modules/gitlist/logo/logomark.svg
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="1480px" height="1416px" viewBox="0 0 1480 1416" enable-background="new 0 0 1480 1416" xml:space="preserve">
|
||||
<path fill="#F05133" d="M1341.738,668.538L779.462,106.262c-21.791-21.793-57.125-21.793-78.924,0.006l-87.07,87.064L793.887,373.75
|
||||
c29.393-6.888,61.542,1.031,84.463,23.945c35.243,35.243,35.243,92.389,0,127.632c-35.243,35.244-92.389,35.244-127.625,0
|
||||
c-22.921-22.914-30.84-55.076-23.952-84.47L546.36,260.445L138.262,668.544c-21.793,21.785-21.793,57.125,0,78.916l562.276,562.275
|
||||
c21.799,21.8,57.133,21.792,78.918,0l90.695-90.688L549.558,898.446l59.856-59.863l320.601,320.594l100.651-100.645L710.065,737.932
|
||||
l59.863-59.859l320.601,320.598l100.644-100.651L870.579,577.421l59.87-59.863l320.594,320.598l90.695-90.695
|
||||
C1363.531,725.669,1363.531,690.329,1341.738,668.538z M557.327,846.353c-35.249,35.243-92.395,35.238-127.639,0
|
||||
c-35.242-35.25-35.235-92.389,0-127.629c35.25-35.243,92.39-35.243,127.639,0C592.571,753.964,592.571,811.109,557.327,846.353z
|
||||
M717.836,685.841c-35.243,35.244-92.389,35.244-127.626,0c-35.25-35.248-35.242-92.388,0-127.631
|
||||
c35.243-35.244,92.383-35.244,127.626,0C753.078,593.453,753.078,650.599,717.836,685.841z"/>
|
||||
<path fill="#FFFFFF" d="M590.21,558.21c-35.242,35.243-35.25,92.383,0,127.631c35.237,35.244,92.383,35.244,127.626,0
|
||||
c35.242-35.242,35.242-92.388,0-127.631C682.593,522.966,625.453,522.966,590.21,558.21z"/>
|
||||
<rect x="673.599" y="825.971" transform="matrix(-0.7071 -0.7071 0.7071 -0.7071 922.9224 2118.8887)" fill="#FFFFFF" width="453.398" height="84.659"/>
|
||||
<path fill="#FFFFFF" d="M878.35,397.695c-22.921-22.914-55.07-30.833-84.463-23.945L613.468,193.332l-67.107,67.113l180.412,180.412
|
||||
c-6.888,29.394,1.031,61.556,23.952,84.47c35.236,35.244,92.382,35.244,127.625,0C913.593,490.084,913.593,432.938,878.35,397.695z"
|
||||
/>
|
||||
<polygon fill="#FFFFFF" points="870.579,577.421 1191.173,898.019 1251.043,838.155 930.449,517.558 "/>
|
||||
<path fill="#FFFFFF" d="M429.688,718.724c-35.235,35.24-35.242,92.379,0,127.629c35.244,35.238,92.39,35.243,127.639,0
|
||||
c35.244-35.243,35.244-92.389,0-127.629C522.078,683.48,464.938,683.48,429.688,718.724z"/>
|
||||
<polygon fill="#FFFFFF" points="549.558,898.446 870.151,1219.047 930.015,1159.177 609.414,838.583 "/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
BIN
application/modules/gitlist/logo/vertical.png
Normal file
BIN
application/modules/gitlist/logo/vertical.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
66
application/modules/gitlist/logo/vertical.svg
Normal file
66
application/modules/gitlist/logo/vertical.svg
Normal file
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="1344px" height="1225.566px" viewBox="0 0 1344 1225.566" enable-background="new 0 0 1344 1225.566" xml:space="preserve">
|
||||
<path fill="#F05133" d="M1044.531,401.631L699.165,56.259c-13.387-13.387-35.089-13.387-48.481,0.003l-53.479,53.479
|
||||
l110.818,110.821c18.055-4.233,37.798,0.632,51.876,14.707c21.649,21.647,21.649,56.748,0,78.397
|
||||
c-21.647,21.647-56.742,21.647-78.392,0c-14.078-14.078-18.938-33.832-14.708-51.888L555.982,150.963L305.315,401.634
|
||||
c-13.384,13.384-13.384,35.089,0,48.476l345.369,345.368c13.393,13.39,35.095,13.384,48.473,0l55.708-55.704L557.948,542.848
|
||||
l36.765-36.768L791.635,703l61.826-61.818L656.539,444.256l36.771-36.77l196.922,196.922l61.821-61.824L755.128,345.662
|
||||
l36.779-36.771l196.916,196.925l55.708-55.707C1057.917,436.723,1057.917,415.018,1044.531,401.631z M562.723,510.852
|
||||
c-21.656,21.647-56.754,21.645-78.4,0c-21.647-21.649-21.647-56.747,0-78.395c21.646-21.649,56.744-21.649,78.4,0
|
||||
C584.369,454.104,584.369,489.202,562.723,510.852z M661.311,412.258c-21.646,21.646-56.753,21.646-78.391,0
|
||||
c-21.656-21.652-21.647-56.748,0-78.397c21.647-21.647,56.745-21.647,78.391,0C682.958,355.51,682.958,390.611,661.311,412.258z"/>
|
||||
<path fill="#FFFFFF" d="M582.919,333.86c-21.647,21.649-21.656,56.745,0,78.397c21.638,21.646,56.745,21.646,78.391,0
|
||||
c21.647-21.646,21.647-56.748,0-78.397C639.664,312.213,604.566,312.213,582.919,333.86z"/>
|
||||
<rect x="634.139" y="498.33" transform="matrix(-0.7071 -0.7071 0.7071 -0.7071 949.4833 1441.9585)" fill="#FFFFFF" width="278.492" height="52.003"/>
|
||||
<path fill="#FFFFFF" d="M759.899,235.269c-14.078-14.075-33.821-18.94-51.876-14.707L597.205,109.74l-41.223,41.223L666.8,261.778
|
||||
c-4.229,18.056,0.63,37.81,14.708,51.888c21.649,21.647,56.744,21.647,78.392,0C781.549,292.017,781.549,256.916,759.899,235.269z"
|
||||
/>
|
||||
<polygon fill="#FFFFFF" points="755.128,345.662 952.053,542.584 988.823,505.816 791.907,308.892 "/>
|
||||
<path fill="#FFFFFF" d="M484.322,432.457c-21.647,21.647-21.647,56.745,0,78.395c21.646,21.645,56.744,21.647,78.4,0
|
||||
c21.646-21.649,21.646-56.747,0-78.395C541.066,410.808,505.969,410.808,484.322,432.457z"/>
|
||||
<polygon fill="#FFFFFF" points="557.948,542.848 754.864,739.773 791.635,703 594.712,506.08 "/>
|
||||
<g>
|
||||
<g>
|
||||
<path fill="#F05133" d="M231.721,1150.067v-7.206c-19.649,10.042-40.404,15.065-62.235,15.065
|
||||
c-19.002,0-36.642-3.495-52.903-10.48c-16.271-6.983-30.413-16.542-42.419-28.663c-12.016-12.121-21.408-26.313-28.173-42.584
|
||||
c-6.772-16.264-10.154-33.792-10.154-52.577c0-18.346,3.438-35.704,10.317-52.084c6.881-16.374,16.377-30.733,28.497-43.074
|
||||
c12.118-12.335,26.316-22.054,42.586-29.154c16.269-7.095,33.79-10.647,52.576-10.647c20.087,0,39.145,4.314,57.161,12.938
|
||||
c18.012,8.636,33.686,20.804,47.008,36.527l-55.687,37.02c-6.771-6.771-14.252-11.963-22.444-15.563
|
||||
c-8.183-3.605-16.866-5.404-26.038-5.404c-9.617,0-18.508,1.91-26.698,5.729c-8.191,3.825-15.291,8.901-21.29,15.237
|
||||
c-6.008,6.333-10.708,13.703-14.086,22.11c-3.394,8.406-5.075,17.306-5.075,26.69c0,9.397,1.682,18.349,5.075,26.864
|
||||
c3.379,8.518,8.127,15.943,14.246,22.276c6.11,6.336,13.267,11.415,21.457,15.232c8.19,3.825,17.082,5.729,26.698,5.729
|
||||
c10.262,0,20.031-2.29,29.321-6.871c9.274-4.594,17.082-11.029,23.415-19.333h-44.871v-61.256h111.704v143.479H231.721z"/>
|
||||
<path fill="#F05133" d="M319.513,1150.067V934.196h63.215v215.871H319.513z"/>
|
||||
<path fill="#F05133" d="M589.756,990.212h-55.684v159.855h-61.589V990.212h-55.685l-5.243-5.243v-50.772h183.442v50.772
|
||||
L589.756,990.212z"/>
|
||||
<path fill="#F05133" d="M615.299,1150.067v-254.2h70.433v191.311h133.646v62.89H615.299z"/>
|
||||
<path fill="#F05133" d="M836.413,1150.067V934.196h63.222v215.871H836.413z"/>
|
||||
<path fill="#F05133" d="M1023.121,1156.945c-14.197,0-28.229-1.752-42.09-5.243c-13.873-3.485-27.139-8.293-39.808-14.412
|
||||
c-0.214,0-0.542-0.104-0.979-0.327c-0.439-0.215-0.981-0.434-1.644-0.65c-1.09-0.656-1.91-1.365-2.451-2.133
|
||||
c-0.551-0.762-0.82-1.362-0.82-1.799c0-0.217,1.201-2.566,3.6-7.045c2.405-4.473,5.243-9.549,8.519-15.234
|
||||
c3.058-5.021,5.902-9.877,8.515-14.576c2.622-4.692,4.807-8.459,6.559-11.301c2.399,1.096,4.197,1.916,5.401,2.455
|
||||
c1.195,0.551,2.344,1.148,3.442,1.805c9.61,4.804,19.21,8.515,28.826,11.137c9.607,2.621,19.655,3.928,30.133,3.928
|
||||
c1.529,0,3.006,0,4.423,0c1.418,0,2.892-0.103,4.421-0.325c3.283,0,6.225-0.437,8.846-1.307c2.619-1.095,4.859-2.624,6.717-4.593
|
||||
c1.854-1.963,2.789-4.909,2.789-8.84c0-2.839-1.102-5.077-3.275-6.721c-2.191-1.634-4.479-2.993-6.884-4.089
|
||||
c-1.532-0.655-2.949-1.2-4.256-1.638c-3.72-1.525-7.481-2.674-11.307-3.441c-3.814-0.768-7.695-1.582-11.623-2.455
|
||||
c-5.243-1.089-10.376-2.237-15.402-3.441c-5.018-1.195-9.936-2.455-14.739-3.77c-5.027-1.521-9.714-3.217-14.087-5.074
|
||||
c-4.364-1.851-8.516-3.983-12.446-6.391c-8.079-5.021-14.523-11.623-19.327-19.813s-7.202-19.052-7.202-32.597
|
||||
c0-9.607,2.07-18.887,6.221-27.845c4.146-8.729,9.441-15.888,15.889-21.454c6.438-5.57,13.592-9.991,21.456-13.269
|
||||
c7.865-3.275,16.056-5.51,24.57-6.714c8.519-1.198,17.036-1.805,25.546-1.805c13.976,0,27.895,1.752,41.773,5.243
|
||||
c13.864,3.498,27.455,9.395,40.777,17.687c-5.029,8.519-9.722,16.656-14.086,24.406c-4.368,7.757-9.069,15.892-14.087,24.403
|
||||
c-11.14-5.674-21.567-10.094-31.281-13.267c-9.719-3.163-20.142-4.748-31.281-4.748c-2.19,0-4.643,0.056-7.376,0.164
|
||||
c-2.727,0.114-5.234,0.606-7.53,1.474c-2.294,0.879-4.253,2.188-5.896,3.931c-1.641,1.752-2.452,4.26-2.452,7.534
|
||||
c0,1.963,0.542,3.825,1.632,5.571c0.87,1.746,2.788,3.223,5.738,4.42c2.946,1.204,6.922,2.458,11.951,3.771
|
||||
c4.804,1.31,10.103,2.568,15.885,3.764c5.785,1.204,11.737,2.678,17.856,4.421c6.11,1.528,12.332,3.336,18.677,5.406
|
||||
c6.324,2.08,12.276,4.699,17.845,7.862c5.571,3.17,10.59,6.878,15.068,11.137c4.479,4.26,8.031,9.339,10.653,15.232
|
||||
c1.96,4.37,3.321,9.068,4.095,14.089c0.756,5.021,1.14,9.937,1.14,14.74c0,14.412-2.894,26.205-8.679,35.373
|
||||
c-5.791,9.174-13.319,16.494-22.603,21.951c-9.282,5.457-19.654,9.222-31.12,11.301
|
||||
C1045.884,1155.908,1034.475,1156.945,1023.121,1156.945z"/>
|
||||
<path fill="#F05133" d="M1308.772,990.212h-55.693v159.855h-61.581V990.212h-55.693l-5.234-5.243v-50.772h183.437v50.772
|
||||
L1308.772,990.212z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 6.3 KiB |
187
application/modules/gitlist/src/Application.php
Normal file
187
application/modules/gitlist/src/Application.php
Normal file
|
@ -0,0 +1,187 @@
|
|||
<?php
|
||||
|
||||
namespace GitList;
|
||||
|
||||
use GitList\Provider\GitServiceProvider;
|
||||
use GitList\Provider\RepositoryUtilServiceProvider;
|
||||
use GitList\Provider\RoutingUtilServiceProvider;
|
||||
use GitList\Provider\ViewUtilServiceProvider;
|
||||
use Silex\Application as SilexApplication;
|
||||
use Silex\Provider\TwigServiceProvider;
|
||||
use Silex\Provider\UrlGeneratorServiceProvider;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
|
||||
/**
|
||||
* GitList application.
|
||||
*/
|
||||
class Application extends SilexApplication
|
||||
{
|
||||
protected $path;
|
||||
|
||||
/**
|
||||
* Constructor initialize services.
|
||||
*
|
||||
* @param Config $config
|
||||
* @param string $root Base path of the application files (views, cache)
|
||||
*/
|
||||
public function __construct(Config $config, $root = null)
|
||||
{
|
||||
parent::__construct();
|
||||
$app = $this;
|
||||
$this->path = realpath($root);
|
||||
|
||||
$this['debug'] = $config->get('app', 'debug');
|
||||
$this['theme'] = $config->get('app', 'theme') ? $config->get('app', 'theme') : 'default';
|
||||
$this['date.format'] = $config->get('date', 'format') ? $config->get('date', 'format') : 'd/m/Y H:i:s';
|
||||
$this['filetypes'] = $config->getSection('filetypes');
|
||||
$this['binary_filetypes'] = $config->getSection('binary_filetypes');
|
||||
$this['cache.archives'] = $this->getCachePath() . 'archives';
|
||||
$this['avatar.url'] = $config->get('avatar', 'url');
|
||||
$this['avatar.query'] = $config->get('avatar', 'query');
|
||||
|
||||
// Register services
|
||||
$this->register(new TwigServiceProvider(), array(
|
||||
'twig.path' => array($this->getThemePath($this['theme']), $this->getThemePath('default')),
|
||||
'twig.options' => $config->get('app', 'cache') ?
|
||||
array('cache' => $this->getCachePath() . 'views') : array(),
|
||||
));
|
||||
|
||||
$repositories = $config->get('git', 'repositories');
|
||||
$this['git.projects'] = $config->get('git', 'project_list') ?
|
||||
$this->parseProjectList($config->get('git', 'project_list')) :
|
||||
false;
|
||||
|
||||
$this->register(new GitServiceProvider(), array(
|
||||
'git.client' => $config->get('git', 'client'),
|
||||
'git.repos' => $repositories,
|
||||
'ini.file' => 'config.ini',
|
||||
'git.hidden' => $config->get('git', 'hidden') ?
|
||||
$config->get('git', 'hidden') : array(),
|
||||
'git.default_branch' => $config->get('git', 'default_branch') ?
|
||||
$config->get('git', 'default_branch') : 'master',
|
||||
));
|
||||
|
||||
$this->register(new ViewUtilServiceProvider());
|
||||
$this->register(new RepositoryUtilServiceProvider());
|
||||
$this->register(new RoutingUtilServiceProvider());
|
||||
$this->register(new UrlGeneratorServiceProvider());
|
||||
|
||||
$this['twig'] = $this->share($this->extend('twig', function ($twig, $app) use ($config) {
|
||||
$twig->addFilter(new \Twig_SimpleFilter('htmlentities', 'htmlentities'));
|
||||
$twig->addFilter(new \Twig_SimpleFilter('md5', 'md5'));
|
||||
$twig->addFilter(new \Twig_SimpleFilter('format_date', array($app, 'formatDate')));
|
||||
$twig->addFilter(new \Twig_SimpleFilter('format_size', array($app, 'formatSize')));
|
||||
$twig->addFunction(new \Twig_SimpleFunction('avatar', array($app, 'getAvatar')));
|
||||
$twig->addGlobal('theme', $app['theme']);
|
||||
$twig->addGlobal('title', $config->get('app', 'title') ? $config->get('app', 'title') : 'GitList');
|
||||
$twig->addGlobal('show_http_remote', $config->get('clone_button', 'show_http_remote'));
|
||||
$twig->addGlobal('use_https', $config->get('clone_button', 'use_https'));
|
||||
$twig->addGlobal('http_url_subdir', $config->get('clone_button', 'http_url_subdir'));
|
||||
$twig->addGlobal('http_user', $config->get('clone_button', 'http_user_dynamic') ? $_SERVER['PHP_AUTH_USER'] : $config->get('clone_button', 'http_user'));
|
||||
$twig->addGlobal('http_host', $config->get('clone_button', 'http_host'));
|
||||
$twig->addGlobal('show_ssh_remote', $config->get('clone_button', 'show_ssh_remote'));
|
||||
$twig->addGlobal('ssh_user', $config->get('clone_button', 'ssh_user_dynamic') ? $_SERVER['PHP_AUTH_USER'] : $config->get('clone_button', 'ssh_user'));
|
||||
$twig->addGlobal('ssh_url_subdir', $config->get('clone_button', 'ssh_url_subdir'));
|
||||
$twig->addGlobal('ssh_host', $config->get('clone_button', 'ssh_host'));
|
||||
$twig->addGlobal('ssh_port', $config->get('clone_button', 'ssh_port'));
|
||||
|
||||
return $twig;
|
||||
}));
|
||||
|
||||
$this['escaper.argument'] = $this->share(function() {
|
||||
return new Escaper\ArgumentEscaper();
|
||||
});
|
||||
|
||||
// Handle errors
|
||||
$this->error(function (\Exception $e, $code) use ($app) {
|
||||
if ($app['debug']) {
|
||||
return;
|
||||
}
|
||||
|
||||
return $app['twig']->render('error.twig', array(
|
||||
'message' => $e->getMessage(),
|
||||
));
|
||||
});
|
||||
|
||||
$this->finish(function () use ($app, $config) {
|
||||
if (!$config->get('app', 'cache')) {
|
||||
$fs = new Filesystem();
|
||||
$fs->remove($app['cache.archives']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function formatDate($date)
|
||||
{
|
||||
return $date->format($this['date.format']);
|
||||
}
|
||||
|
||||
public function formatSize($size)
|
||||
{
|
||||
$mod = 1000;
|
||||
$units = array('B', 'kB', 'MB', 'GB');
|
||||
for ($i = 0; $size > $mod; $i++) {
|
||||
$size /= $mod;
|
||||
}
|
||||
|
||||
return round($size, 2) . $units[$i];
|
||||
}
|
||||
|
||||
public function getAvatar($email, $size)
|
||||
{
|
||||
$url = $this['avatar.url'] ? $this['avatar.url'] : '//gravatar.com/avatar/';
|
||||
$query = array("s=$size");
|
||||
if (is_string($this['avatar.query'])) {
|
||||
$query[] = $this['avatar.query'];
|
||||
} elseif (is_array($this['avatar.query'])) {
|
||||
$query = array_merge($query, $this['avatar.query']);
|
||||
}
|
||||
$id = md5(strtolower($email));
|
||||
|
||||
return $url . $id . '?' . implode('&', $query);
|
||||
}
|
||||
|
||||
public function getPath()
|
||||
{
|
||||
return $this->path . DIRECTORY_SEPARATOR;
|
||||
}
|
||||
|
||||
public function setPath($path)
|
||||
{
|
||||
$this->path = $path;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCachePath()
|
||||
{
|
||||
return $this->path
|
||||
. DIRECTORY_SEPARATOR
|
||||
. 'cache'
|
||||
. DIRECTORY_SEPARATOR;
|
||||
}
|
||||
|
||||
public function getThemePath($theme)
|
||||
{
|
||||
return $this->path
|
||||
. DIRECTORY_SEPARATOR
|
||||
. 'themes'
|
||||
. DIRECTORY_SEPARATOR
|
||||
. $theme
|
||||
. DIRECTORY_SEPARATOR
|
||||
. 'twig'
|
||||
. DIRECTORY_SEPARATOR;
|
||||
}
|
||||
|
||||
public function parseProjectList($project_list)
|
||||
{
|
||||
$projects = array();
|
||||
$file = fopen($project_list, 'r');
|
||||
while ($file && !feof($file)) {
|
||||
$projects[] = trim(fgets($file));
|
||||
}
|
||||
fclose($file);
|
||||
|
||||
return $projects;
|
||||
}
|
||||
}
|
77
application/modules/gitlist/src/Config.php
Normal file
77
application/modules/gitlist/src/Config.php
Normal file
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
namespace GitList;
|
||||
|
||||
class Config
|
||||
{
|
||||
protected $data;
|
||||
|
||||
public function __construct($data = array())
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
public static function fromFile($file)
|
||||
{
|
||||
if (!file_exists($file)) {
|
||||
die(sprintf('Please, create the %1$s file.', $file));
|
||||
}
|
||||
|
||||
$data = parse_ini_file($file, true);
|
||||
$config = new static($data);
|
||||
$config->validateOptions();
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
public function get($section, $option)
|
||||
{
|
||||
if (!array_key_exists($section, $this->data)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!array_key_exists($option, $this->data[$section])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->data[$section][$option];
|
||||
}
|
||||
|
||||
public function getSection($section)
|
||||
{
|
||||
if (!array_key_exists($section, $this->data)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->data[$section];
|
||||
}
|
||||
|
||||
public function set($section, $option, $value)
|
||||
{
|
||||
$this->data[$section][$option] = $value;
|
||||
}
|
||||
|
||||
protected function validateOptions()
|
||||
{
|
||||
$repositories = $this->get('git', 'repositories');
|
||||
|
||||
$atLeastOneOk = false;
|
||||
$atLeastOneWrong = false;
|
||||
|
||||
foreach ($repositories as $directory) {
|
||||
if (!$directory || !is_dir($directory)) {
|
||||
$atLeastOneWrong = true;
|
||||
} else {
|
||||
$atLeastOneOk = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$atLeastOneOk) {
|
||||
die('Please, edit the config file and provide your repositories directory');
|
||||
}
|
||||
|
||||
if ($atLeastOneWrong) {
|
||||
die('One or more of the supplied repository paths appears to be wrong. Please, check the config file');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
<?php
|
||||
|
||||
namespace GitList\Controller;
|
||||
|
||||
use Silex\ControllerProviderInterface;
|
||||
use Silex\Application;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class BlobController implements ControllerProviderInterface
|
||||
{
|
||||
public function connect(Application $app)
|
||||
{
|
||||
$route = $app['controllers_factory'];
|
||||
|
||||
$route->get(MODULE_NAME.'/{repo}/blob/{commitishPath}', function ($repo, $commitishPath) use ($app) {
|
||||
$repository = $app['git']->getRepositoryFromName($app['git.repos'], $repo);
|
||||
|
||||
list($branch, $file) = $app['util.routing']
|
||||
->parseCommitishPathParam($commitishPath, $repo);
|
||||
|
||||
list($branch, $file) = $app['util.repository']->extractRef($repository, $branch, $file);
|
||||
|
||||
$blob = $repository->getBlob("$branch:\"$file\"");
|
||||
$breadcrumbs = $app['util.view']->getBreadcrumbs($file);
|
||||
$fileType = $app['util.repository']->getFileType($file);
|
||||
|
||||
if ($fileType !== 'image' && $app['util.repository']->isBinary($file)) {
|
||||
return $app->redirect($app['url_generator']->generate('blob_raw', array(
|
||||
'repo' => $repo,
|
||||
'commitishPath' => $commitishPath,
|
||||
)));
|
||||
}
|
||||
|
||||
return $app['twig']->render('file.twig', array(
|
||||
'file' => $file,
|
||||
'fileType' => $fileType,
|
||||
'blob' => $blob->output(),
|
||||
'repo' => $repo,
|
||||
'branch' => $branch,
|
||||
'breadcrumbs' => $breadcrumbs,
|
||||
'branches' => $repository->getBranches(),
|
||||
'tags' => $repository->getTags(),
|
||||
));
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('commitishPath', '.+')
|
||||
->convert('commitishPath', 'escaper.argument:escape')
|
||||
->bind('blob');
|
||||
|
||||
$route->get(MODULE_NAME.'/{repo}/raw/{commitishPath}', function ($repo, $commitishPath) use ($app) {
|
||||
$repository = $app['git']->getRepositoryFromName($app['git.repos'], $repo);
|
||||
|
||||
list($branch, $file) = $app['util.routing']
|
||||
->parseCommitishPathParam($commitishPath, $repo);
|
||||
|
||||
list($branch, $file) = $app['util.repository']->extractRef($repository, $branch, $file);
|
||||
|
||||
$blob = $repository->getBlob("$branch:\"$file\"")->output();
|
||||
|
||||
$headers = array();
|
||||
if ($app['util.repository']->isBinary($file)) {
|
||||
$headers['Content-Disposition'] = 'attachment; filename="' . $file . '"';
|
||||
$headers['Content-Type'] = 'application/octet-stream';
|
||||
} else {
|
||||
$headers['Content-Type'] = 'text/plain';
|
||||
}
|
||||
|
||||
return new Response($blob, 200, $headers);
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('commitishPath', $app['util.routing']->getCommitishPathRegex())
|
||||
->convert('commitishPath', 'escaper.argument:escape')
|
||||
->bind('blob_raw');
|
||||
|
||||
$route->get(MODULE_NAME.'/{repo}/logpatch/{commitishPath}', function ($repo, $commitishPath) use ($app) {
|
||||
$repository = $app['git']->getRepositoryFromName($app['git.repos'], $repo);
|
||||
|
||||
list($branch, $file) = $app['util.routing']
|
||||
->parseCommitishPathParam($commitishPath, $repo);
|
||||
|
||||
$filePatchesLog = $repository->getCommitsLogPatch($file);
|
||||
$breadcrumbs = $app['util.view']->getBreadcrumbs($file);
|
||||
|
||||
return $app['twig']->render('logpatch.twig', array(
|
||||
'branch' => $branch,
|
||||
'repo' => $repo,
|
||||
'breadcrumbs' => $breadcrumbs,
|
||||
'commits' => $filePatchesLog,
|
||||
));
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('commitishPath', '.+')
|
||||
->convert('commitishPath', 'escaper.argument:escape')
|
||||
->bind('logpatch');
|
||||
|
||||
return $route;
|
||||
}
|
||||
}
|
132
application/modules/gitlist/src/Controller/CommitController.php
Normal file
132
application/modules/gitlist/src/Controller/CommitController.php
Normal file
|
@ -0,0 +1,132 @@
|
|||
<?php
|
||||
|
||||
namespace GitList\Controller;
|
||||
|
||||
use Silex\ControllerProviderInterface;
|
||||
use Silex\Application;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class CommitController implements ControllerProviderInterface
|
||||
{
|
||||
public function connect(Application $app)
|
||||
{
|
||||
$route = $app['controllers_factory'];
|
||||
|
||||
$route->get(MODULE_NAME.'/{repo}/commits/search', function (Request $request, $repo) use ($app) {
|
||||
$subRequest = Request::create(
|
||||
'/' . $repo . '/commits/master/search',
|
||||
'POST',
|
||||
array('query' => $request->get('query'))
|
||||
);
|
||||
|
||||
return $app->handle($subRequest, \Symfony\Component\HttpKernel\HttpKernelInterface::SUB_REQUEST);
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex());
|
||||
|
||||
$route->get(MODULE_NAME.'/{repo}/commits/{commitishPath}', function (Request $request, $repo, $commitishPath) use ($app) {
|
||||
$repository = $app['git']->getRepositoryFromName($app['git.repos'], $repo);
|
||||
|
||||
if ($commitishPath === null) {
|
||||
$commitishPath = $repository->getHead();
|
||||
}
|
||||
|
||||
list($branch, $file) = $app['util.routing']
|
||||
->parseCommitishPathParam($commitishPath, $repo);
|
||||
|
||||
list($branch, $file) = $app['util.repository']->extractRef($repository, $branch, $file);
|
||||
|
||||
$type = $file ? "$branch -- \"$file\"" : $branch;
|
||||
$pager = $app['util.view']->getPager($request->get('page'), $repository->getTotalCommits($type));
|
||||
$commits = $repository->getPaginatedCommits($type, $pager['current']);
|
||||
$categorized = array();
|
||||
|
||||
foreach ($commits as $commit) {
|
||||
$date = $commit->getCommiterDate();
|
||||
$date = $date->format('Y-m-d');
|
||||
$categorized[$date][] = $commit;
|
||||
}
|
||||
|
||||
$template = $request->isXmlHttpRequest() ? 'commits_list.twig' : 'commits.twig';
|
||||
|
||||
return $app['twig']->render($template, array(
|
||||
'page' => 'commits',
|
||||
'pager' => $pager,
|
||||
'repo' => $repo,
|
||||
'branch' => $branch,
|
||||
'branches' => $repository->getBranches(),
|
||||
'tags' => $repository->getTags(),
|
||||
'commits' => $categorized,
|
||||
'file' => $file,
|
||||
));
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('commitishPath', $app['util.routing']->getCommitishPathRegex())
|
||||
->value('commitishPath', null)
|
||||
->convert('commitishPath', 'escaper.argument:escape')
|
||||
->bind('commits');
|
||||
|
||||
$route->post(MODULE_NAME.'/{repo}/commits/{branch}/search', function (Request $request, $repo, $branch = '') use ($app) {
|
||||
$repository = $app['git']->getRepositoryFromName($app['git.repos'], $repo);
|
||||
$query = $request->get('query');
|
||||
|
||||
$commits = $repository->searchCommitLog($query, $branch);
|
||||
$categorized = array();
|
||||
|
||||
foreach ($commits as $commit) {
|
||||
$date = $commit->getCommiterDate();
|
||||
$date = $date->format('Y-m-d');
|
||||
$categorized[$date][] = $commit;
|
||||
}
|
||||
|
||||
return $app['twig']->render('searchcommits.twig', array(
|
||||
'repo' => $repo,
|
||||
'branch' => $branch,
|
||||
'file' => '',
|
||||
'commits' => $categorized,
|
||||
'branches' => $repository->getBranches(),
|
||||
'tags' => $repository->getTags(),
|
||||
'query' => $query,
|
||||
));
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('branch', $app['util.routing']->getBranchRegex())
|
||||
->convert('branch', 'escaper.argument:escape')
|
||||
->bind('searchcommits');
|
||||
|
||||
$route->get(MODULE_NAME.'/{repo}/commit/{commit}', function ($repo, $commit) use ($app) {
|
||||
$repository = $app['git']->getRepositoryFromName($app['git.repos'], $repo);
|
||||
$commit = $repository->getCommit($commit);
|
||||
$branch = $repository->getHead();
|
||||
|
||||
return $app['twig']->render('commit.twig', array(
|
||||
'branch' => $branch,
|
||||
'repo' => $repo,
|
||||
'commit' => $commit,
|
||||
));
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('commit', '[a-f0-9^]+')
|
||||
->bind('commit');
|
||||
|
||||
$route->get(MODULE_NAME.'/{repo}/blame/{commitishPath}', function ($repo, $commitishPath) use ($app) {
|
||||
$repository = $app['git']->getRepositoryFromName($app['git.repos'], $repo);
|
||||
|
||||
list($branch, $file) = $app['util.routing']
|
||||
->parseCommitishPathParam($commitishPath, $repo);
|
||||
|
||||
list($branch, $file) = $app['util.repository']->extractRef($repository, $branch, $file);
|
||||
|
||||
$blames = $repository->getBlame("$branch -- \"$file\"");
|
||||
|
||||
return $app['twig']->render('blame.twig', array(
|
||||
'file' => $file,
|
||||
'repo' => $repo,
|
||||
'branch' => $branch,
|
||||
'branches' => $repository->getBranches(),
|
||||
'tags' => $repository->getTags(),
|
||||
'blames' => $blames,
|
||||
));
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('commitishPath', $app['util.routing']->getCommitishPathRegex())
|
||||
->convert('commitishPath', 'escaper.argument:escape')
|
||||
->bind('blame');
|
||||
|
||||
return $route;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
namespace GitList\Controller;
|
||||
|
||||
use Silex\ControllerProviderInterface;
|
||||
use Silex\Application;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class MainController implements ControllerProviderInterface
|
||||
{
|
||||
public function connect(Application $app)
|
||||
{
|
||||
$route = $app['controllers_factory'];
|
||||
|
||||
$route->get(MODULE_NAME.'/', function () use ($app) {
|
||||
$repositories = $app['git']->getRepositories($app['git.repos']);
|
||||
|
||||
return $app['twig']->render('index.twig', array(
|
||||
'repositories' => $repositories,
|
||||
));
|
||||
})->bind('homepage');
|
||||
|
||||
$route->get(MODULE_NAME.'/refresh', function (Request $request) use ($app) {
|
||||
// Go back to calling page
|
||||
return $app->redirect($request->headers->get('Referer'));
|
||||
})->bind('refresh');
|
||||
|
||||
$route->get(MODULE_NAME.'/{repo}/stats/{branch}', function ($repo, $branch) use ($app) {
|
||||
$repository = $app['git']->getRepositoryFromName($app['git.repos'], $repo);
|
||||
|
||||
if ($branch === null) {
|
||||
$branch = $repository->getHead();
|
||||
}
|
||||
|
||||
$stats = $repository->getBranchStatistics($branch);
|
||||
$authors = $repository->getAuthorStatistics($branch);
|
||||
|
||||
return $app['twig']->render('stats.twig', array(
|
||||
'repo' => $repo,
|
||||
'branch' => $branch,
|
||||
'branches' => $repository->getBranches(),
|
||||
'tags' => $repository->getTags(),
|
||||
'stats' => $stats,
|
||||
'authors' => $authors,
|
||||
));
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('branch', $app['util.routing']->getBranchRegex())
|
||||
->value('branch', null)
|
||||
->convert('branch', 'escaper.argument:escape')
|
||||
->bind('stats');
|
||||
|
||||
$route->get(MODULE_NAME.'/{repo}/{branch}/rss/', function ($repo, $branch) use ($app) {
|
||||
$repository = $app['git']->getRepositoryFromName($app['git.repos'], $repo);
|
||||
|
||||
if ($branch === null) {
|
||||
$branch = $repository->getHead();
|
||||
}
|
||||
|
||||
$commits = $repository->getPaginatedCommits($branch);
|
||||
|
||||
$html = $app['twig']->render('rss.twig', array(
|
||||
'repo' => $repo,
|
||||
'branch' => $branch,
|
||||
'commits' => $commits,
|
||||
));
|
||||
|
||||
return new Response($html, 200, array('Content-Type' => 'application/rss+xml'));
|
||||
})->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('branch', $app['util.routing']->getBranchRegex())
|
||||
->value('branch', null)
|
||||
->convert('branch', 'escaper.argument:escape')
|
||||
->bind('rss');
|
||||
|
||||
return $route;
|
||||
}
|
||||
}
|
129
application/modules/gitlist/src/Controller/NetworkController.php
Normal file
129
application/modules/gitlist/src/Controller/NetworkController.php
Normal file
|
@ -0,0 +1,129 @@
|
|||
<?php
|
||||
|
||||
namespace GitList\Controller;
|
||||
|
||||
use GitList\Git\Repository;
|
||||
use Gitter\Model\Commit\Commit;
|
||||
use Silex\ControllerProviderInterface;
|
||||
use Silex\Application;
|
||||
|
||||
class NetworkController implements ControllerProviderInterface
|
||||
{
|
||||
public function connect(Application $app)
|
||||
{
|
||||
$route = $app['controllers_factory'];
|
||||
|
||||
$route->get(
|
||||
MODULE_NAME.'/{repo}/network/{commitishPath}/{page}.json',
|
||||
function ($repo, $commitishPath, $page) use ($app) {
|
||||
/** @var Repository $repository */
|
||||
$repository = $app['git']->getRepositoryFromName($app['git.repos'], $repo);
|
||||
|
||||
if ($commitishPath === null) {
|
||||
$commitishPath = $repository->getHead();
|
||||
}
|
||||
|
||||
$pager = $app['util.view']->getPager($page, $repository->getTotalCommits($commitishPath));
|
||||
$commits = $repository->getPaginatedCommits($commitishPath, $pager['current']);
|
||||
|
||||
$jsonFormattedCommits = array();
|
||||
|
||||
foreach ($commits as $commit) {
|
||||
$detailsUrl = $app['url_generator']->generate(
|
||||
'commit',
|
||||
array(
|
||||
'repo' => $repo,
|
||||
'commit' => $commit->getHash(),
|
||||
)
|
||||
);
|
||||
|
||||
$jsonFormattedCommits[$commit->getHash()] = array(
|
||||
'hash' => $commit->getHash(),
|
||||
'parentsHash' => $commit->getParentsHash(),
|
||||
'date' => $commit->getDate()->format('U'),
|
||||
'message' => htmlentities($commit->getMessage()),
|
||||
'details' => $detailsUrl,
|
||||
'author' => array(
|
||||
'name' => $commit->getAuthor()->getName(),
|
||||
'email' => $commit->getAuthor()->getEmail(),
|
||||
'image' => $app->getAvatar($commit->getAuthor()->getEmail(), 40),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$nextPageUrl = null;
|
||||
|
||||
if ($pager['last'] !== $pager['current']) {
|
||||
$nextPageUrl = $app['url_generator']->generate(
|
||||
'networkData',
|
||||
array(
|
||||
'repo' => $repo,
|
||||
'commitishPath' => $commitishPath,
|
||||
'page' => $pager['next'],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// when no commits are given, return an empty response - issue #369
|
||||
if (count($commits) === 0) {
|
||||
return $app->json(
|
||||
array(
|
||||
'repo' => $repo,
|
||||
'commitishPath' => $commitishPath,
|
||||
'nextPage' => null,
|
||||
'start' => null,
|
||||
'commits' => $jsonFormattedCommits,
|
||||
),
|
||||
200
|
||||
);
|
||||
}
|
||||
|
||||
return $app->json(
|
||||
array(
|
||||
'repo' => $repo,
|
||||
'commitishPath' => $commitishPath,
|
||||
'nextPage' => $nextPageUrl,
|
||||
'start' => $commits[0]->getHash(),
|
||||
'commits' => $jsonFormattedCommits,
|
||||
),
|
||||
200
|
||||
);
|
||||
}
|
||||
)->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('commitishPath', $app['util.routing']->getCommitishPathRegex())
|
||||
->value('commitishPath', null)
|
||||
->convert('commitishPath', 'escaper.argument:escape')
|
||||
->assert('page', '\d+')
|
||||
->value('page', '0')
|
||||
->bind('networkData');
|
||||
|
||||
$route->get(
|
||||
MODULE_NAME.'/{repo}/network/{commitishPath}',
|
||||
function ($repo, $commitishPath) use ($app) {
|
||||
$repository = $app['git']->getRepositoryFromName($app['git.repos'], $repo);
|
||||
|
||||
if ($commitishPath === null) {
|
||||
$commitishPath = $repository->getHead();
|
||||
}
|
||||
|
||||
list($branch, $file) = $app['util.routing']->parseCommitishPathParam($commitishPath, $repo);
|
||||
list($branch, $file) = $app['util.repository']->extractRef($repository, $branch, $file);
|
||||
|
||||
return $app['twig']->render(
|
||||
'network.twig',
|
||||
array(
|
||||
'repo' => $repo,
|
||||
'branch' => $branch,
|
||||
'commitishPath' => $commitishPath,
|
||||
)
|
||||
);
|
||||
}
|
||||
)->assert('repo', $app['util.routing']->getRepositoryRegex())
|
||||
->assert('commitishPath', $app['util.routing']->getCommitishPathRegex())
|
||||
->value('commitishPath', null)
|
||||
->convert('commitishPath', 'escaper.argument:escape')
|
||||
->bind('network');
|
||||
|
||||
return $route;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue