Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote branch 'lsmith77/classcollectionloader'

* lsmith77/classcollectionloader:
  make it possible to define the file extension
  • Loading branch information...
commit f6ee7c818a6377ea5f5a09f595ec4f897127e347 2 parents a1dbe36 + 5822ece
Fabien Potencier fabpot authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 ClassCollectionLoader.php
5 ClassCollectionLoader.php
View
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.