/home/twimmo/webprod-frontend/App/Lib/Twimmo/Serveur/Reponse.php
}
public function getStatut(){
return $this->statut;
}
public function getStatutTexte(){
return $this->statut_texte;
}
// Au navigateur
public function sendContenu(){
echo $this->contenu;
return $this;
}
public function sendEntetes(){
header(sprintf('HTTP/%s %s %s', $this->getVersion(), $this->getStatut(), $this->getStatutTexte()));
foreach ($this->entetes as $key => $value){
header($key.': '.$value, false);
}
return $this;
}
public function send(){
$this->sendEntetes();
$this->sendContenu();
return true;
}
// ---------------
public function __toString() {
$entetes = "";
foreach ($this->entetes as $key => $entete) {
$entetes .= sprintf("%s %s\r\n", $key.':', $entete);
}
return
sprintf('HTTP/%s %s %s', $this->version, $this->statut, $this->statut_texte) . "\r\n" .
/home/twimmo/webprod-frontend/App/Lib/Twimmo/Serveur/Reponse.php
}
public function getStatut(){
return $this->statut;
}
public function getStatutTexte(){
return $this->statut_texte;
}
// Au navigateur
public function sendContenu(){
echo $this->contenu;
return $this;
}
public function sendEntetes(){
header(sprintf('HTTP/%s %s %s', $this->getVersion(), $this->getStatut(), $this->getStatutTexte()));
foreach ($this->entetes as $key => $value){
header($key.': '.$value, false);
}
return $this;
}
public function send(){
$this->sendEntetes();
$this->sendContenu();
return true;
}
// ---------------
public function __toString() {
$entetes = "";
foreach ($this->entetes as $key => $entete) {
$entetes .= sprintf("%s %s\r\n", $key.':', $entete);
}
return
sprintf('HTTP/%s %s %s', $this->version, $this->statut, $this->statut_texte) . "\r\n" .
/home/twimmo/webprod-frontend/App/Lib/Twimmo/Serveur/Reponse.php
public function getStatutTexte(){
return $this->statut_texte;
}
// Au navigateur
public function sendContenu(){
echo $this->contenu;
return $this;
}
public function sendEntetes(){
header(sprintf('HTTP/%s %s %s', $this->getVersion(), $this->getStatut(), $this->getStatutTexte()));
foreach ($this->entetes as $key => $value){
header($key.': '.$value, false);
}
return $this;
}
public function send(){
$this->sendEntetes();
$this->sendContenu();
return true;
}
// ---------------
public function __toString() {
$entetes = "";
foreach ($this->entetes as $key => $entete) {
$entetes .= sprintf("%s %s\r\n", $key.':', $entete);
}
return
sprintf('HTTP/%s %s %s', $this->version, $this->statut, $this->statut_texte) . "\r\n" .
$entetes . "\r\n" .
$this->getContenu();
}
}
/home/twimmo/webprod-frontend/App/Application/Model/URL.php
$uri = $this->getPath();
if($this->_lang){
$uri = "/".$this->_lang.$uri;
}
$getParams = implode('&', array_map(function($v, $k){
return $k . '=' . implode(',', (array)$v);
}, $this->getParam(), array_keys($this->getParam())));
if(is_array($tableauredirection) and count($tableauredirection) > 0 ){
foreach ($tableauredirection as $key => $value) {
$key = urldecode($key);
$uri = urldecode($uri);
$uriGet = urldecode($uri . '?' . $getParams);
if($key == $uri || $key == $uriGet){
$reponse = new Reponse();
$reponse->redirection($value);
$reponse->send();
exit;
}
}
//exit;
}
}
public function getParamRouting($tableaurouting, $uri = FALSE){
if(!$uri){
$uri = $this->getPath();
}
$router = new Router();
$router->setUri($uri)
->setLang($this->getLang())
->setURLRewriting($tableaurouting);
/home/twimmo/webprod-frontend/App/Application/Controller/Init.php
private $_cache = false;
private $_systemeDico = false;
public function __construct(TwCache $cache){
$this->_cache = $cache;
$this->_url = new URL();
$config = new ConfigurationApplication("WebFrontend");
$config->setFichier(_APPLICATION_.'/Config/application_'.APPLICATION_ENV.'.ini')
->init($cache);
//CONFIG SITE LOCAL
$this->configSite = new ConfigurationEspace($config, $cache);
$this->configSite->setURL($this->_url)
->init();
//REDIRECTIONS
$this->_url->getRedirection($this->configSite->getRedirections());
//ECHANGEUR
$this->_echangeur = $this->configSite->getEchangeur();
//DICO
$this->_systemeDico = new Gettext(
$this->_cache,
$this->configSite->getKey().'$'.$this->configSite->getLang()
);
$this->_systemeDico->setFichier(
$this->configSite->getPathMoLang($this->_echangeur)
);
$this->_url->setDico($this->_systemeDico);
//ROUTING
$isRouting = $this->_url->getParamRouting($this->configSite->getRouting());
if($isRouting){
$this->_typePage = $this->_url->getTypePage();
}
/home/twimmo/webprod-frontend/App/www/index.php
$whoops = new Run();
$whoops->pushHandler(new PrettyPageHandler());
$whoops->register();
}
//Syst??me de cache
$config = array(
"serveur" => array(
array("127.0.0.1",11211,1),
)
);
$cache = new Twimmo\TwCache($config);
//Lancement de l'application
if(isset($_GET["command"])){
$methode = "get".ucfirst($_GET["command"]);
Init::$methode();
exit;
}
$controller = new Init($cache);
$controller->go();
$fin = microtime(true);
?>