www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 2e9553be2760fed8878c76288af19414f8ebaa3b
parent f6a9c3617a835719a05054265be6519ce09c9825
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date:   Thu,  5 Aug 2010 01:37:18 +0200

Nouvelle page et redirection.

Diffstat:
M__cms__/code/cms/page.php | 5+++--
M__cms__/code/stockage/systeme-fichiers.php | 7+++++--
2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/__cms__/code/cms/page.php b/__cms__/code/cms/page.php @@ -64,9 +64,10 @@ class Page { header("Content-Type: " . $this->raw_mime); echo $this->raw_données; } else if ($this->type == "redirect") { - echo "TODO : Redirection vers <a href=\"" + header("Location: " . $this->redirect_destination); + /*echo "TODO : Redirection vers <a href=\"" . $this->redirect_destination . "\">" - . $this->redirect_destination . "</a>"; + . $this->redirect_destination . "</a>";*/ } // TODO : else erreur } diff --git a/__cms__/code/stockage/systeme-fichiers.php b/__cms__/code/stockage/systeme-fichiers.php @@ -4,7 +4,9 @@ class Système_fichiers { public static function créer_dossier($chemin_fs) { - mkdir($chemin_fs); + $d = dirname($chemin_fs); + if (!is_dir($d)) self::créer_dossier($d); + if (!is_dir($chemin_fs)) mkdir($chemin_fs); } /*public static function créer_fichier($chemin_fs) { @@ -30,7 +32,8 @@ class Système_fichiers { } public static function écrire($chemin_fs, $données) { - if (!is_dir(dirname($chemin_fs))) return false; + $d = dirname($chemin_fs); + if (!is_dir($d)) self::créer_dossier($d); return file_put_contents($chemin_fs, $données); }