Modification sur la pseudo-réécriture d'URL.

This commit is contained in:
Georges Dupéron 2010-08-02 01:01:31 +02:00
parent 10eef9a593
commit 59cd53a52c
3 changed files with 8 additions and 7 deletions

View File

@ -4,7 +4,7 @@ require_once(dirname(__FILE__) . "/config.php");
require_once(dirname(__FILE__) . "/include.php");
class CMS {
public function cms($chemin_str) {
public static function page($chemin_str) {
// TODO : appeller Modules::action($chemin, $action, $paramètres);
$chemin = new Chemin($chemin_str);

View File

@ -20,10 +20,11 @@ class Stockage {
// Imitation de l'url rewriting lorsque ce n'est pas disponible sur
// le serveur.
public function activer_réécriture($chemin_vers) {
$php_str = "<?php\n=";
$php_str .= "require_once(" . Path::combine($config_chemin_base, "cms.php") . ");\n";
$php_str .= "CMS::cms(" . $chemin_vers->get() . ");\n";
$php_str .= "?>\n";
// TODO : échapper les " dans le require_once et l'appel à cms.
$php_str = "<?php\n\n";
$php_str .= "require_once(\"" . Path::combine($config_chemin_base, "cms.php") . "\");\n\n";
$php_str .= "CMS::page(\"" . $chemin_vers->get() . "\");\n\n";
$php_str .= "?>";
return SystemeFichiers::écrire($chemin_vers->get_fs_public(), $php_str);
}

View File

@ -1,7 +1,7 @@
<?php
require_once("__cms__/cms.php");
require_once("/home/js/github/2010-moteur-site-simple/__cms__/cms.php");
CMS::affiche('/', $_GET);
CMS::page("/");
?>