Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add custom file extension support to ClassCollectionLoader #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from
Mar 9, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Symfony/Component/ClassLoader/ClassCollectionLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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])) {
Expand All @@ -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;
Expand Down