static public function isRemoveable($name, array $required, array $replaces)
{
if ($name == 'contao-community-alliance/composer') {
return false;
}
if (isset($required[$name])) {
return true;
}
if (isset($replaces[$name])) {
return static::isRemoveable($replaces[$name], $required, $replaces);
}
return false;
}
The last if may cause an infinite loop, in my case it definitely does:
[11-Nov-2013 09:33:47 UTC] PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 261900 bytes) in /var/www/users/example.com/htdocs/system/modules/!composer/ContaoCommunityAlliance/Contao/Composer/TemplateFunctions.php on line 41
[11-Nov-2013 09:34:18 UTC] PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 261900 bytes) in /var/www/users/example.com/htdocs/system/modules/!composer/ContaoCommunityAlliance/Contao/Composer/TemplateFunctions.php on line 41
[11-Nov-2013 09:36:54 UTC] PHP Fatal error: Allowed memory size of -2147483648 bytes exhausted (tried to allocate 261900 bytes) in /var/www/users/example.com/htdocs/system/modules/!composer/ContaoCommunityAlliance/Contao/Composer/TemplateFunctions.php on line 41
I tried debuggin it by modifying the method like this:
class TemplateFunctions
{
static $counter = 0;
static public function isRemoveable($name, array $required, array $replaces)
{
if ($name == 'contao-community-alliance/composer') {
return false;
}
if (isset($required[$name])) {
return true;
}
if (isset($replaces[$name])) {
static::$counter++;
var_dump($replaces, $name);
echo "\n";
if(100 < static::$counter) {
exit();
}
return static::isRemoveable($replaces[$name], $required, $replaces);
}
return false;
}
The resulting debug info from the BE (do=composer) is
Hi,
ContaoCommunityAlliance\Contao\Composer\TemplateFunctions
The last if may cause an infinite loop, in my case it definitely does:
I tried debuggin it by modifying the method like this:
The resulting debug info from the BE (do=composer) is
As you can see, this continues endlessly for the contao-event-dispatcher package name.