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

Problem mit Plugin-Import?

 
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
Uwe82
Smarty n00b


Joined: 28 Jan 2005
Posts: 4

PostPosted: Fri Jan 28, 2005 5:10 pm    Post subject: Problem mit Plugin-Import? Reply with quote

Ich hab wohl ein include-Problem, die Berechtigungen sind auf "alle Rechte für Jeden" gesetzt.

Ich hab Smarty zuerst in meinem Projektordner gehabt, es aber dann nach c:\php\PEAR verschoben (das steht auch im include-Pfad der php.ini drin).

Mit folgendem Code versuche ich nun ein Template zu befüllen und anzeigen zu lassen:
[php:1:fc17ce856c]<?php require("./config.inc.php");
require("Smarty.class.php");


$template=new Smarty;
$template->compile_check=true;
$template->debugging=true;
$template->caching=0;

$template->display('./templates/login.tpl')
?>[/php:1:fc17ce856c]
Nur bekomm ich dabei folgende Meldungen:
Quote:

Warning: smarty_core_load_resource_plugin(c:\php\PEAR\): failed to open stream: Permission denied in c:\php\PEAR\internals\core.load_resource_plugin.php on line 35

Warning: smarty_core_load_resource_plugin(): Failed opening 'c:\php\PEAR\' for inclusion (include_path='.;c:\php\PEAR') in c:\php\PEAR\internals\core.load_resource_plugin.php on line 35

Fatal error: Smarty error: [plugin] function smarty_resource__source() not found in c:\php\PEAR\ (core.load_resource_plugin.php, line 43) in c:\php\PEAR\Smarty.class.php on line 585

Ich versteh vor allem nicht, warum der einen Ordner includen möchte, überall, wo ich diese Meldung fand, wurde eine Datei includet.
Weiß jmd Rat?
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:15 pm    Post subject: Reply with quote

Hi,
hast du $template_dir, $cache_dir und $compile_dir gesetzt? Die werden ohne explzite Angabe einfach "relativ" zur Smarty Klasse agenommen und dort darf vermutlich eben keiner schreiben.
Wenn du Smarty in einem Unterverzeichnis von PEAR hast, dann musst du die Datei mit
require_once "smarty/libs/Smarty.class.php"
bw. dem entsprechenden *relativen Pfad* innerhalb des PEAR Verzeichnisses angeben.
Nach der Initialisierung von Smarty ($template), setze die entsprechenden Eigenschaften:
Code:
$template->template_dir = "/absoluter/pfad/zu/templates";
$template->cache_dir = "/absoluter/pfad/zu/cache";
$template->compile_dir = "/absoluter/pfad/zu/templates_c";
Wobei die beiden letzeren Verzeichnisse mindestes CHMOD 666 oder gar 777 brauchen, je nach Server Konfig.
Der Pfad zum template in display() ist mmer relativ zum Verzeichnis $template_dir, und sollte daher eher
Code:
$template->display('login.tpl')

lauten.
Falls das nicht funzt, poste mal die Verzeichnisstruktur for PEAR, Smarty und wo du die Templates abgelegt hast. Vielleicht findet sich dann etwas.

Viel Spaß,
CirTap
Back to top
View user's profile Send private message
Uwe82
Smarty n00b


Joined: 28 Jan 2005
Posts: 4

PostPosted: Mon Feb 07, 2005 11:28 am    Post subject: Reply with quote

Danke für den Tipp, aber eben hat sich das Problem gelöst.

Zu Deinen Vermutungen:
- Ich habe auch die Variablen explizit gesetzt
- Ich habe für jeden Schreibrechte in dem Pfad gegeben
- Das require von Smarty_class.php funktionierte einwandfrei, ohne display(...) kam kein Fehler (was ja kommen würde, wenn er sie nicht finden würde

Die Lösung war ganz einfach: Ein Update auf die aktuelle Version 2.6.7 hat das Problem gelöst. Ich weiß nicht woran es lag, aber irgendwas wurde wohl geändert.
Back to top
View user's profile Send private message
CirTap
Smarty Pro


Joined: 04 Jun 2003
Posts: 106

PostPosted: Tue Feb 08, 2005 1:49 pm    Post subject: Reply with quote

na dann: auch gut Smile

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