cvs: smarty / NEWS /libs/core core.assemble_plugin_filepath.php

"Messju Mohr" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmessju1073567584@cvsserver>
messju		Thu Jan  8 08:13:04 2004 EDT

  Modified files:              
    /smarty	NEWS 
    /smarty/libs/core	core.assemble_plugin_filepath.php 
  Log:
  added caching of requested paths to smarty_core_assemble_plugin_filepath()
  
  
  
Index: smarty/NEWS
diff -u smarty/NEWS:1.423 smarty/NEWS:1.424
--- smarty/NEWS:1.423	Thu Jan  8 07:47:12 2004
+++ smarty/NEWS	Thu Jan  8 08:12:51 2004
@@ -1,3 +1,4 @@
+  - add caching of requested paths to _assemble_plugin_filepath() (messju)
   - fix handling of comments inside {php}- and {literal}-blocks (messju)
   - fix bug handling triple-quotes in config-files (BRDude, messju)
   - change default of request_use_auto_globals to true - $_SERVER is
Index: smarty/libs/core/core.assemble_plugin_filepath.php
diff -u smarty/libs/core/core.assemble_plugin_filepath.php:1.6 smarty/libs/core/core.assemble_plugin_filepath.php:1.7
--- smarty/libs/core/core.assemble_plugin_filepath.php:1.6	Sat Oct 11 04:55:53 2003
+++ smarty/libs/core/core.assemble_plugin_filepath.php	Thu Jan  8 08:13:04 2004
@@ -14,8 +14,12 @@
  */
 function smarty_core_assemble_plugin_filepath($params, &$smarty)
 {
+    static $_filepaths_cache = array();
 
     $_plugin_filename = $params['type'] . '.' . $params['name'] . '.php';
+    if (isset($_filepaths_cache[$_plugin_filename])) {
+        return $_filepaths_cache[$_plugin_filename];
+    }
     $_return = false;
 
     foreach ((array)$smarty->plugins_dir as $_plugin_dir) {
@@ -53,7 +57,7 @@
             }
         }
     }
-
+    $_filepaths_cache[$_plugin_filename] = $_return;
     return $_return;
 }
 

-- 
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.