Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- copyright: Pro Fusion
- author: Pro Fusion
- --------------------------
- you can find the licence at pro-fusion.ch
- */
- class ExtensionCall {
- /*
- @extensions
- */
- private $extensions = null;
- /*
- @init
- */
- private function init() {
- $extensionsFolder = CORE_ROOT.'lib'.DS.'extensions'.DS;
- $extensionFolder = opendir($extensionsFolder);
- while ($extension = readdir($extensionFolder)) {
- if (('.' == $extension) || ('..' == $extension)) continue;
- $path = $extensionsFolder.$extension.DS.ucfirst($extension).'Extension.class.php';
- if ((false == is_file($path))) continue;
- require_once($path);
- $className = ucfirst($extension).'Extension';
- if ((false == class_exists($className))) {
- Core::doLog('Unable to find class "'.$className.'"', __CLASS__, __METHOD__, __FILE__, __LINE__);
- }
- $object = new $className();
- $this->extensions->$extension = $object;
- }
- }
- /*
- @call
- */
- public function call($args) {
- if ($this->extensions == null) $this->init();
- return $this->extensions;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement