|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
DabuLeader Smarty n00b
Joined: 20 Jan 2005 Posts: 3
|
Posted: Tue Feb 01, 2005 10:23 am Post subject: clear_cache? |
|
|
Hallo zusammen,
ich besitze ein Newsscript für den Adminstrator, da alle meine Seiten gecacht sind muss ich die gecachte Seite zuerst löschen.
Aber ich bekomme folgende fehlermeldung:
clear_cache(./Smarty/internals/core.rm_auto.php): failed to open stream: No such file or directory in /Smarty/Smarty.class.php on line 957
kann mir jemand helfen? hier mein Scipt
<-news.php->
if($NewsEntfernen) {
mysql_query("DELETE FROM News WHERE ID='$ID'");
require_once 'Director.php';
Director::action();
require '/Smarty/Smarty.class.php';
$smarty = new Smarty;
$smarty->template_dir = TEMPLATE_DIR;
$smarty->compile_dir = COMPILE_DIR;
$smarty->config_dir = CONFIG_DIR;
$smarty->cache_dir = CACHE_DIR;
if(!$smarty->is_cached('startseite.tpl',"startseite")) {
$smarty->caching = 1;
$smarty->clear_cache ('startseite.tpl',"startseite");
$smarty->display ( 'startseite.tpl',"startseite");
}
} |
|
Back to top |
|
CirTap Smarty Pro
Joined: 04 Jun 2003 Posts: 106
|
Posted: Tue Feb 01, 2005 3:06 pm Post subject: |
|
|
Hi,
bist du sicher, daß dies hier funktioniert?
Code: | require '/Smarty/Smarty.class.php';
$smarty = new Smarty; |
Du hast hier nämlich einen absoluten Pfad angegeben. Ändere das mal in require_once() und aktiviere error_reporting(E_ALL) um zu sehen ob da nicht schon vorher etwas schief läuft.
Ich nehme an die XXX_DIR sind Konstanten mit Strings auf die richtigen Verzeichnisse.
Die Angabe von $smarty->clear_cache() in einem if-Block, der ausgeführt wird wenn nix gecached ist -- ! is_cached() --, macht nicht wirklich Sinn.
Warum auch immer diese Fehlermeldung erscheint (ich vermute falsche Pfadangaben oder keinen richtigen "include_path"): auf einer Admin-Seite wäre es sinnvoll, sicherer und einfachar
Code: | $smarty->force_compile = 1;
$smarty->cache_lifetime = 0; |
zu verwenden, dann sparts du dir das händische Saubermachen.
Viel Spaß,
CirTap |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|