update de l'application pour le dev de la documentation

This commit is contained in:
Emmanuel ROY 2020-12-18 17:44:09 +01:00
commit 6efdffc05c
31 changed files with 329 additions and 253 deletions

View file

@ -2,13 +2,14 @@
namespace MVC\Classe;
class Modular{
class Modular
{
private $app = "";
private $subapp_dir = "";
private $subfile = "index.php";
public function __construct($appName,$type = 'symfony',$options = array()){
public function __construct($appName, $type = 'symfony', $options = array())
{
//Dumper::dump($options);die();
@ -17,18 +18,18 @@ class Modular{
case "symfony":
break;
case "wordpress":
if(isset($options[0])) {
if (isset($options[0])) {
switch ($options[0]) {
case 'wp-admin':
$this->subapp_dir = DIRECTORY_SEPARATOR . $options[0];
if(isset($options[1])) {
if (isset($options[1])) {
switch ($options[1]) {
case 'setup-config.php':
case 'install.php':
$this->subfile = $options[1];
break;
default:
if(preg_match('#(.)*\.php#',$options[1])){
if (preg_match('#(.)*\.php#', $options[1])) {
$this->subfile = $options[1];
}
}
@ -42,7 +43,7 @@ class Modular{
}
break;
case "prestashop":
if(isset($options[0])) {
if (isset($options[0])) {
switch ($options[0]) {
case 'admin-dev':
case 'install-dev':
@ -53,20 +54,20 @@ class Modular{
}
break;
case "phplist":
if(isset($options[0])) {
if (isset($options[0])) {
switch ($options[0]) {
case 'admin':
$this->subapp_dir = DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . 'lists'. DIRECTORY_SEPARATOR . $options[0] ;
break;
default:
}
}else{
} else {
$this->subapp_dir = DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . 'lists';
}
break;
case "wanewsletter":
$this->subfile = "install.php";
if(isset($options[0])) {
if (isset($options[0])) {
switch ($options[0]) {
case 'admin':
$this->subapp_dir = DIRECTORY_SEPARATOR . $options[0] ;
@ -82,11 +83,13 @@ class Modular{
}
}
public function getAppName(){
public function getAppName()
{
return $this->app;
}
public function load($type = "symfony"){
public function load($type = "symfony")
{
switch ($type) {
case "symfony":
require MODULES_PATH . DIRECTORY_SEPARATOR . $this->getAppName() . DIRECTORY_SEPARATOR . "public" . DIRECTORY_SEPARATOR . "index.php";
@ -108,4 +111,4 @@ class Modular{
break;
}
}
}
}