-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Stack overflow :: spl_autoload_register + class_exists($name) (drupal install) #947
Description
Stack overflow produced by class_exists function when use spl_autoload_register
HipHop Fatal error: Stack overflow in /drupal/includes/bootstrap.inc on line 3027
spl_autoload_register('drupal_autoload_class');
function drupal_autoload_class($class) {
return _registry_check_code('class', $class);
}
function _registry_check_code($type, $name = NULL) {
static $lookup_cache, $cache_update_needed;
if ($type == 'class' && class_exists($name) || $type == 'interface' && interface_exists($name)) {
return TRUE;
}
etc...
You can reproduce this case with drupal installation (I use version 7.22)
if you want reproduce it, in drupa/modules/system/system.install
comment line 114 spl and filter extension required (cf #946 )
//akuma
$required_extensions = array(
'date',
'dom',
//'filter',
'gd',
'hash',
'json',
'pcre',
'pdo',
'session',
'SimpleXML',
//'SPL',
'xml',
);
workaround:
function _registry_check_code($type, $name = NULL) {
static $lookup_cache, $cache_update_needed;
//akuma
if ($type == 'class') {
$cl=get_declared_classes();
if(isset($cl[$name])){return TRUE;}
}
if ($type == 'interface') {
$i=get_declared_interfaces();
if(isset($i[$name])){return TRUE;}
}
/* if ($type == 'class' && class_exists($name) || $type == 'interface' && interface_exists($name)) {
return TRUE;
}*/
etc...