Created
August 11, 2010 15:16
-
-
Save fprochazka/519136 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
private function getExtension($name) | |
{ | |
if( !isset($this->extensions[$name]) ){ | |
$classes = array_keys($this->getRobotLoader()->indexedClasses); | |
foreach( $classes AS $item ){ //echo "<hr>"; _dump($item); | |
if( $match = String::match($item, '~^kdyby\\\\(?P<type>modifications|addons)\\\\(?P<name>[^\\\\]+)\\\\loader$~i') ){ | |
$extension = array('name' => $match['name']); | |
switch($match['type']){ | |
case 'addons': | |
$extension['type'] = self::ADDON; | |
$extension['loader'] = $this->formatAddonLoader($extension['name']); | |
break; | |
case 'modifications': | |
$extension['type'] = self::MODIFICATION; | |
$extension['loader'] = $this->formatModificationLoader($extension['name']); | |
break; | |
default: | |
continue; | |
} | |
$this->extensions[$extension['name']] = (object)$extension; | |
} | |
} | |
_dump($this->extensions); die(); | |
if( !isset($this->extensions[$name]) ){ | |
throw new ExtensionException("Extension with key '$name' was not found."); | |
} | |
} | |
return $this->extensions[$name]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment