poueeeeeeeeeeeeeeeeeeeeeeeeeet

This commit is contained in:
2018-12-18 09:50:36 +01:00
parent 0fa9b575cd
commit 3ecfa1f568
5 changed files with 378 additions and 5 deletions

View File

@ -2,8 +2,6 @@
ini_set('display_errors', 'On');
// var_dump($_SERVER);
//renvoie vers le fichier css si il est demandé
if(endsWith($_GET["page"], ".css")) {
echo file_get_contents("../css/style.css");
@ -94,7 +92,7 @@ function endsWith($haystack, $needle)
* isLoaded: boolean
*
* functions:
* __construct(id, title, regex)
* abstract __construct()
* absract loadPage()
*
*/

View File

@ -0,0 +1,119 @@
<?php
/**
* classe Pages
* a constructor to load additionnal pages and initialize the whole class and load the pages
*/
/**
* Class Pages
*
* attributes
* pageList : Array
*
* functions
*
* __construct($pages = array())
* # load the pages list from db and static files (index/search)
* loadPage($url)
* # return a class of type Page (see below)
*/
/**
* class Page
* contain the Page to load (on init only a light version but when using loadPage the whole page is in the class)
* here it contains three extended classes (Index/Search/Post where we will add functions to the loadPage)
*/
/**
* abstract Class Page
*
* attributes
* id
* title
* regex
* content
* isLoaded: boolean
*
* functions:
* abstract __construct()
* absract loadPage()
*
*/
/**
* class Post
* contains a post
* with basics informations at first and when loadPost is launche the whole class will be usable
*/
/**
* class Post
*
* attributes
* id
* authorName
* authorLinkedin
* content
* isloaded: false
*
* __construct(id);
*
* loadPost()
*
*/
abstract class Pages {
private $pageList = array();
public function __construct($pages = array()) {
$pouet = array();
$pages = array_merge($pouet, $pages);
}
}
abstract class Page {
private $id;
private $title;
private $regex;
private $content;
private $isLoaded = false;
abstract function loadPage();
}
interface Page {
public function __construct();
public function loadPage();
public function getId();
public function getTitle();
public function getRegex();
}
class Post {
private $id;
private $authorName;
private $authorLinkedin;
private $content;
private $isLoaded = false;
public function __construct($id) {
$this->id = $id;
}
public function loadPost() {
}
}
class Posts implements Page {
public function __construct() {}
}