public function envoyer() { // Yeeeeeeeeeeeeeeeeeeeeeeha ! Et on envoie ! if ($this->type == "page") { echo Squelette::enrober($this); } else { if ($this->type == "sendfile") { Système_fichiers::envoyer_fichier_directement($this->sendfile_fichier); } else { if ($this->type == "sendprop") { Stockage::get_prop_sendfile($this->sendprop_chemin, $this->sendprop_prop); } else { if ($this->type == "raw") { header("Content-Type: " . $this->raw_mime); echo $this->raw_données; } else { if ($this->type == "redirect") { header("Location: " . $this->redirect_destination); /*echo "TODO : Redirection vers <a href=\"" . $this->redirect_destination . "\">" . $this->redirect_destination . "</a>";*/ } } } } } // TODO : else erreur }
public static function get_prop_sendfile($chemin, $prop) { // Envoie tout le conctenu de $prop sur le réseau. // Équivalent à appeller sendfile sur le fichier qui contient $prop. if (Permissions::vérifier_permission($chemin, "get_prop")) { return Système_fichiers::envoyer_fichier_directement(self::fichier_prop($chemin, $prop)); } else { return Erreur::lecture("Permission non accordée pour la lecture de chemin: " . $chemin->get() . " propriété: " . $prop); } }