Strange Register Resource Problem
| From: | Markus Inger | Date: | Mon, 18 Nov 2002 15:43:26 +0000 |
| Subject: | Strange Register Resource Problem | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6467@lists.php.net to get a copy of this message | ||
Hiya,
i have a little problem with registering a new Resource in Smarty.
i use a file called: "resource.memory.php" in Smartys plugin dir,
to define a Resource type "memory".
Everything is working fine. But on one System im testing, i got the following error:
Warning: Invalid argument supplied for foreach() in Smarty.class.php on line 1906
when i var_dump() the $plugin Var in function _load_resource_plugin()
i got a:
string(0) ""
(PHP 4.1.2)
When i var_dump() it on another System (where everything works right) i got a:
&NULL
(PHP 4.2.1)
So i wonder if this is a Smarty Bug or a PHP Bug... or maybe im to Silly *G*
Hope someone can help :)
Ciao
Markus
file: resource.memory.php
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* File: resource.memory.php * Type: resource * Name: memory* Purpose: Fetches templates from ram * ------------------------------------------------------------- */ function smarty_resource_memory_source($tpl_name, &$tpl_source, &$smarty) {
global $content;
$tpl_source = $content;
return true;
}
function smarty_resource_memory_timestamp($tpl_name, &$tpl_timestamp, &$smarty)
{
return true;} function smarty_resource_memory_secure($tpl_name, &$smarty) {
// assume all templates are secure
return true;
}
function smarty_resource_memory_trusted($tpl_name, &$smarty)
{
// not used for templates} ?> -- Markus Inger