Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

clear_cache?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
DabuLeader
Smarty n00b


Joined: 20 Jan 2005
Posts: 3

PostPosted: Tue Feb 01, 2005 10:23 am    Post subject: clear_cache? Reply with quote

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
View user's profile Send private message
CirTap
Smarty Pro


Joined: 04 Jun 2003
Posts: 106

PostPosted: Tue Feb 01, 2005 3:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP