Permalink
Browse files

Merge remote branch 'lsmith77/classcollectionloader'

* lsmith77/classcollectionloader:
  make it possible to define the file extension
  • Loading branch information...
2 parents a1dbe36 + 5822ece commit f6ee7c818a6377ea5f5a09f595ec4f897127e347 @fabpot fabpot committed Mar 9, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 ClassCollectionLoader.php
View
5 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 f6ee7c8

Please sign in to comment.