public function addPackage($package, $options = null) { if (!$package instanceof Engine_Package_Manifest_Entity_Package) { if (!isset($options['basePath'])) { $options['basePath'] = $this->getBasePath(); } $package = new Engine_Package_Manifest_Entity_Package($package, $options); } else { if (is_array($options)) { $package->setOptions($options); } } $package->setBasePath($this->getBasePath()); $name = self::fix_path($package->getPath()); if ($this->_jitInstantiation) { $this->_structure[$name] = $package->toArray(); } else { $this->_structure[$name] = $package; } return $this; }