Permalink
Browse files

make it possible to define the file extension

  • Loading branch information...
1 parent 186667b commit 5822ecea34ad9de7cede172ca7c35da4968057c9 @lsmith77 lsmith77 committed Feb 26, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 ClassCollectionLoader.php
@@ -28,10 +28,11 @@ class ClassCollectionLoader
* @param string $name The cache name prefix
* @param Boolean $autoReload Whether to flush the cache when the cache is stale or not
* @param Boolean $adaptive Whether to remove already declared classes or not
+ * @param string $extension File extension of the resulting file
*
* @throws \InvalidArgumentException When class can't be loaded
*/
- static public function load($classes, $cacheDir, $name, $autoReload, $adaptive = false)
+ static public function load($classes, $cacheDir, $name, $autoReload, $adaptive = false, $extension = '.php')
{
// each $name can only be loaded once per PHP process
if (isset(self::$loaded[$name])) {
@@ -50,7 +51,7 @@ static public function load($classes, $cacheDir, $name, $autoReload, $adaptive =
$name = $name.'-'.substr(md5(implode('|', $classes)), 0, 5);
}
- $cache = $cacheDir.'/'.$name.'.php';
+ $cache = $cacheDir.'/'.$name.$extension;
// auto-reload
$reload = false;

0 comments on commit 5822ece

Please sign in to comment.