cvs: smarty / Smarty.class.php
| From: | Andrei Zmievski | Date: | Mon, 15 Apr 2002 19:32:55 +0000 |
| Subject: | cvs: smarty / Smarty.class.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-62@lists.php.net to get a copy of this message | ||
andrei Mon Apr 15 15:32:55 2002 EDT
Modified files:
/smarty Smarty.class.php
Log:
Fixed _get_php_resource() to take include_path into account.
Index: smarty/Smarty.class.php
diff -u smarty/Smarty.class.php:1.266 smarty/Smarty.class.php:1.267
--- smarty/Smarty.class.php:1.266 Mon Apr 15 13:28:46 2002
+++ smarty/Smarty.class.php Mon Apr 15 15:32:54 2002
@@ -755,10 +755,17 @@
* Find out if the resource exists.
*/
- $readable = true;
- if ($resource_type == 'file' && !@is_file($resource_name)) {
+ if ($resource_type == 'file') {
$readable = false;
+ $include_paths = preg_split('![:;]!', ini_get('include_path'));
+ foreach ($include_paths as $path) {
+ if (@is_file($path . DIRECTORY_SEPARATOR . $resource_name)) {
+ $readable = true;
+ break;
+ }
+ }
} else if ($resource_type != 'file') {
+ $readable = true;
$resource_func = $this->_plugins['resource'][$resource_type][0][0];
$readable = $resource_func($resource_name, $template_source, $this);
}