Saving compiled template fails. file_exists() problem?
| From: | Craig H. Anderson | Date: | Sat, 28 Dec 2002 20:28:46 +0000 |
| Subject: | Saving compiled template fails. file_exists() problem? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6958@lists.php.net to get a copy of this message | ||
Help please. This is my first attempt with Smarty.
This is on a Linux system. I am using these versions:
php 4.2.3
Smarty Version: 2.3.1The Smarty url file is at: /var/www/apache2-default/craig/php/foodbank01/HouseholdQryPage.php The template file is at: /var/www/apache2-default/craig/php/foodbank01/templates
-rw-r--r-- 1 craig craig 805 Dec 28 02:35 HouseholdQryPage.tplThere are 3 sub directories /var/www/apache2-default/craig/php/foodbank01/
drwxr-xr-x 3 craig craig 4096 Dec 28 01:31 configs drwxr-xr-x 3 craig craig 4096 Dec 28 02:35 templates drwxr-xr-x 3 www-data www-data 4096 Dec 28 02:01 templates_cfile_exists() fails on templates_c relative to the current directory. file_exists() succeeds when given the full path. Some output I added to /usr/local/lib/smarty/Smarty.class.php: function _create_dir_structure($dir)
$fp = posix_getcwd();
$fp .= '/';
$fp .= $_new_dir;
if (@file_exists($fp)) /* debug cha */
$fpe = 'true';
else
$fpe = 'false';
$cwd = posix_getcwd();
if (@file_exists($_new_dir)) /* debug cha */
$fe = 'true';
else
$fe = 'false';
if (@file_exists('/tmp')) /* debug cha */
$tmp_e = 'true';
else
$tmp_e = 'false';
error_log("_create_dir_structure cwd $cwd _new_dir $_new_dir fe $fe tmp_e $tmp_e fpe $fpe",0); /* debug cha */
output in log file.
_create_dir_structure cwd /var/www/apache2-default/craig/php/foodbank01 _new_dir templates_c fe false tmp_e true fpe true