Permalink
Browse files

FIX Avoid get_parent_class in ConfigStaticManifest (was loading all c…

…lasses)
  • Loading branch information...
1 parent 943b5cf commit 7f58730904bf6b712ac5d5f8d018ef7865d0daae Hamish Friedlander committed Mar 12, 2013
Showing with 7 additions and 14 deletions.
  1. +7 −14 core/manifest/ConfigStaticManifest.php
@@ -63,7 +63,7 @@ public function get($class, $name, $default) {
if (isset($this->index[$class])) {
$info = $this->index[$class];
- if ($details = $this->cache->load($this->key.'_'.$info['base'])) {
+ if ($details = $this->cache->load($this->key.'_'.$info['key'])) {
$this->statics += $details;
}
@@ -109,33 +109,26 @@ public function regenerate($cache = true) {
if($cache) {
$index = array('$statics' => array());
- $bases = array();
+ $keysets = array();
foreach ($this->statics as $class => $details) {
if (in_array($class, self::$initial_classes)) {
$index['$statics'][$class] = $details;
}
else {
- $base = $class;
-
- do {
- $parent = get_parent_class($base);
- }
- while ($parent != 'Object' && $parent != 'ViewableData' && $parent && ($base = $parent));
-
- $base = sha1($base);
- $bases[$base][$class] = $details;
+ $key = sha1($class);
+ $keysets[$key][$class] = $details;
$index[$class] = array(
- 'base' => $base,
+ 'key' => $key,
'path' => $details['path'],
'mtime' => filemtime($details['path']),
);
}
}
- foreach ($bases as $base => $details) {
- $this->cache->save($details, $this->key.'_'.$base);
+ foreach ($keysets as $key => $details) {
+ $this->cache->save($details, $this->key.'_'.$key);
}
$this->cache->save($index, $this->key);

0 comments on commit 7f58730

Please sign in to comment.