Skip to content

Commit

Permalink
[Foundation] added the env and debug information in the project conta…
Browse files Browse the repository at this point in the history
…iner class name to avoid potential clashes if you manipulate several container in the same PHP script
  • Loading branch information
fabpot committed May 25, 2010
1 parent 632ef95 commit abe86d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Foundation/Kernel.php
Expand Up @@ -254,7 +254,7 @@ public function getLogDir()

protected function initializeContainer()
{
$class = $this->name.'ProjectContainer';
$class = $this->name.ucfirst($this->environment).($this->debug ? 'Debug' : '').'ProjectContainer';
$location = $this->getCacheDir().'/'.$class;
$reload = $this->debug ? $this->needsReload($class, $location) : false;

Expand Down

2 comments on commit abe86d2

@xdissent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If $this->name contains invalid PHP class name characters everything will obviously break. Since the name property is derived from the project's directory, perhaps sanitizing name either here or in the constructor would be appropriate? I've been using a simple hotfix because I often use hyphens in my project shortnames and therefore in the directory names as well.

@fabpot
Copy link
Member Author

@fabpot fabpot commented on abe86d2 Jun 1, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 1a3790a

Please sign in to comment.