Пример #1
0
 /**
  * Build a new instance.
  */
 public function __construct()
 {
     $this->systemBaseDir = realpath('.');
     $this->reflection = new ReflectionObject($this);
     $p = explode('_', get_class($this));
     $this->name = $p[0];
     $this->directory = $this->name;
     // legacy handling
     $this->baseDir = realpath(dirname($this->reflection->getFileName()) . '/../..');
     $this->libBaseDir = realpath($this->baseDir . '/lib/' . $this->name);
     $this->type = ModUtil::getModuleBaseDir($this->name) == 'system' ? ModUtil::TYPE_SYSTEM : ModUtil::TYPE_MODULE;
     if ($this->type == ModUtil::TYPE_MODULE) {
         $this->domain = ZLanguage::getModuleDomain($this->name);
     }
     Zikula_ClassProperties::load($this, $this->getMetaData());
     // Load configuration of any hook bundles.
     $this->setupHookBundles();
 }
Пример #2
0
 /**
  * Build a new instance.
  */
 public function __construct($bundle = null)
 {
     $this->systemBaseDir = realpath('.');
     if (null !== $bundle) {
         $this->name = $bundle->getName();
         $this->baseDir = $bundle->getPath();
         // this is a work around for how the core constructs relative paths in some places
         // using the module path stored in the db. This is the old way since bundles provide
         // the information anyhow now.
         $this->directory = explode('/', $bundle->getRelativePath());
         array_shift($this->directory);
         $this->directory = implode('/', $this->directory);
     } else {
         $this->reflection = new ReflectionObject($this);
         $separator = false === strpos(get_class($this), '_') ? '\\' : '_';
         $p = explode($separator, get_class($this));
         $this->name = $p[0];
         $this->directory = $this->name;
         // legacy handling
         $this->baseDir = $this->libBaseDir = realpath(dirname($this->reflection->getFileName()) . '/../..');
         if (realpath($this->baseDir . '/lib/' . $this->name)) {
             $this->libBaseDir = realpath($this->baseDir . '/lib/' . $this->name);
         }
     }
     $this->type = ModUtil::getModuleBaseDir($this->name) == 'system' ? ModUtil::TYPE_SYSTEM : ModUtil::TYPE_MODULE;
     if ($this->type == ModUtil::TYPE_MODULE) {
         $this->domain = ZLanguage::getModuleDomain($this->name);
     }
     Zikula_ClassProperties::load($this, $this->getMetaData());
     // Load configuration of any hook bundles.
     $this->setupHookBundles();
 }
Пример #3
0
 /**
  * Build a new instance.
  */
 public function __construct($bundle)
 {
     $this->name = $bundle->getName();
     $this->baseDir = $bundle->getPath();
     $this->domain = ZLanguage::getThemeDomain($this->name);
     Zikula_ClassProperties::load($this, $this->getMetaData());
 }