cvs: smarty /libs Smarty.class.php /libs/core core.rm_auto.php

"Messju Mohr" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmessju1063630506@cvsserver>
messju		Mon Sep 15 08:55:06 2003 EDT

  Modified files:              
    /smarty/libs	Smarty.class.php 
    /smarty/libs/core	core.rm_auto.php 
  Log:
  fixed clear_compiled_tpl with explicit $tpl_file given
  fixed return value of smarty_core_rm_auto() + Smarty::_unlink()
  
  
Index: smarty/libs/Smarty.class.php
diff -u smarty/libs/Smarty.class.php:1.447 smarty/libs/Smarty.class.php:1.448
--- smarty/libs/Smarty.class.php:1.447	Mon Sep 15 08:26:23 2003
+++ smarty/libs/Smarty.class.php	Mon Sep 15 08:55:06 2003
@@ -43,7 +43,7 @@
  * @version 2.6.0-RC1-cvs
  */
 
-/* $Id: Smarty.class.php,v 1.447 2003/09/15 12:26:23 messju Exp $ */
+/* $Id: Smarty.class.php,v 1.448 2003/09/15 12:55:06 messju Exp $ */
 
 /**
  * DIR_SEP isn't used anymore, but third party apps might
@@ -1095,7 +1095,8 @@
 		$_params = array('auto_base' => $this->compile_dir,
 						'auto_source' => $tpl_file,
 						'auto_id' => $compile_id,
-						'exp_time' => $exp_time);
+                        'exp_time' => $exp_time,
+                        'extensions' => array('.inc', '.php'));
 		require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.rm_auto.php');
 		return smarty_core_rm_auto($_params, $this);		
     }
@@ -1897,11 +1898,11 @@
     function _unlink($resource, $exp_time = null)
     {
         if(isset($exp_time)) {
-            if(time() - filemtime($resource) >= $exp_time) {
-                @unlink($resource);
+            if(time() - @filemtime($resource) >= $exp_time) {
+                return @unlink($resource);
             }
         } else {            
-            @unlink($resource);
+            return @unlink($resource);
         }
     }
 
Index: smarty/libs/core/core.rm_auto.php
diff -u smarty/libs/core/core.rm_auto.php:1.3 smarty/libs/core/core.rm_auto.php:1.4
--- smarty/libs/core/core.rm_auto.php:1.3	Sat Jun 21 23:13:25 2003
+++ smarty/libs/core/core.rm_auto.php	Mon Sep 15 08:55:06 2003
@@ -34,7 +34,13 @@
         $_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']);
 
         if(isset($params['auto_source'])) {
-            $_res = $smarty->_unlink($_tname);
+            if (isset($params['extensions'])) {
+                $_res = false;
+                foreach ((array)$params['extensions'] as $_extension)
+                    $_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']);
+            } else {
+                $_res = $smarty->_unlink($_tname, $params['exp_time']);
+            }
         } elseif ($smarty->use_sub_dirs) {
 			$_params = array(
 				'dirname' => $_tname,

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.