Re: [SMARTY] smarty template read problem ?
| From: | messju mohr | Date: | Tue, 31 Aug 2004 09:11:40 +0000 |
| Subject: | Re: [SMARTY] smarty template read problem ? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11745@lists.php.net to get a copy of this message | ||
On Tue, Aug 31, 2004 at 10:57:56AM +0200, Gy?rvári Gábor wrote:
> Hi,
>
> Yesterday i switched on a server from 2.6.1 to 2.6.3 and i noticed a
> problem.
>
> fetch from test/test.txt
> fetch return:
> Warning: Smarty error: unable to read resource: "test/test.txt" in
> /raid/development/scr34m/smarty_test/libs-263/Smarty.class.php on line 1083
>
> This is a bug or not ? i need to put ../test/test.txt ? every where not
> enough to use test/test.txt ?
>
> Or maybee this was a bug in prevously versions ?
prior to Smarty-2.6.3 php's include-path was searched for
smarty-templates. this was fixed in 2.6.3.
> Sample scripts below
>
> -----------------------------------------------------------------
>
> Smarty 2.6.3
> fetch from templates/test.txt
> fetch return: inside templates dir
>
> fetch from ../test.txt
> fetch return: outside
>
> fetch from test/test.txt
> fetch return:
> Warning: Smarty error: unable to read resource: "test/test.txt" in
> /raid/development/scr34m/smarty_test/libs-263/Smarty.class.php on line 1083
>
> <?php
> require_once 'libs-263/Smarty.class.php';
>
> $tpl = new Smarty;
>
> echo 'Smarty 2.6.3<br>';
> echo 'fetch from templates/test.txt<br>';
> echo 'fetch return:
> '.$tpl->fetch('test.txt').'<br><br>';
>
> echo 'fetch from ../test.txt<br>';
> echo 'fetch return:
> '.$tpl->fetch('../test.txt').'<br><br>';
>
> echo 'fetch from test/test.txt<br>';
> echo 'fetch return:
> '.$tpl->fetch('test/test.txt').'<br><br>';
> ?>
>
> -----------------------------------------------------------------
>
> Smarty 2.6.2
> fetch from templates/test.txt
> fetch return: inside templates dir
>
> fetch from ../test.txt
> fetch return: outside
>
> fetch from test/test.txt
> fetch return: test directory test.txt file
>
> <?php
> require_once 'libs-262/Smarty.class.php';
>
> $tpl = new Smarty;
>
> echo 'Smarty 2.6.2<br>';
> echo 'fetch from templates/test.txt<br>';
> echo 'fetch return:
> '.$tpl->fetch('test.txt').'<br><br>';
>
> echo 'fetch from ../test.txt<br>';
> echo 'fetch return:
> '.$tpl->fetch('../test.txt').'<br><br>';
>
> echo 'fetch from test/test.txt<br>';
> echo 'fetch return:
> '.$tpl->fetch('test/test.txt').'<br><br>';
> ?>
>
> -----------------------------------------------------------------
>
> Smarty 2.6.1
> fetch from templates/test.txt
> fetch return: inside templates dir
>
> fetch from ../test.txt
> fetch return: outside
>
> fetch from test/test.txt
> fetch return: test directory test.txt file
>
> <?php
> require_once 'libs-261/Smarty.class.php';
>
> $tpl = new Smarty;
>
> echo 'Smarty 2.6.1<br>';
> echo 'fetch from templates/test.txt<br>';
> echo 'fetch return:
> '.$tpl->fetch('test.txt').'<br><br>';
>
> echo 'fetch from ../test.txt<br>';
> echo 'fetch return:
> '.$tpl->fetch('../test.txt').'<br><br>';
>
> echo 'fetch from test/test.txt<br>';
> echo 'fetch return:
> '.$tpl->fetch('test/test.txt').'<br><br>';
>
> ?>
>
> --
> Scr34m kign!
> http://frontember.hu -
> mailto:scr34m@frontember.hu - icq:12502783
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php