function init($options) { parent::init($options); $pServ = AJXP_PluginsService::getInstance(); $aPlugs = $pServ->getActivePlugins(); $accessPlugs = $pServ->getPluginsByType("access"); $this->repository = ConfService::getRepository(); foreach ($accessPlugs as $pId => $plug) { if (array_key_exists("access." . $pId, $aPlugs) && $aPlugs["access." . $pId] === true) { $this->accessDriver = $plug; if (!isset($this->accessDriver->repository)) { $this->accessDriver->init($this->repository); $this->accessDriver->initRepository(); $wrapperData = $this->accessDriver->detectStreamWrapper(true); } else { $wrapperData = $this->accessDriver->detectStreamWrapper(false); } $this->urlBase = $wrapperData["protocol"] . "://" . $this->repository->getId(); } } $this->metaStore = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("metastore"); if ($this->metaStore !== false) { $this->metaStore->initMeta($this->accessDriver); } }
function init($repository, $options = null) { $repoCapabilities = $repository->getOption("API_CAPABILITIES"); if ($repoCapabilities != "") { $this->plugCapabilities = explode(",", $repoCapabilities); // Register one preprocessor per capability. foreach ($this->plugCapabilities as $capability) { $xml = '<action name="' . $capability . '"><pre_processing><serverCallback methodName="switchAction"/></pre_processing></action>'; $tmpDoc = DOMDocument::loadXML($xml); $newNode = $this->manifestDoc->importNode($tmpDoc->documentElement, true); $this->xPath->query("registry_contributions/actions")->item(0)->appendChild($newNode); } } parent::init($repository, $options); }
function init($repository, $optOption = null) { parent::init($repository, $optOption); $repositoryPath = $repository->getOption("PATH"); $accountLimit = strpos($repositoryPath, "@"); if ($accountLimit !== false) { $account = substr($repositoryPath, 0, $accountLimit); $repositoryPath = substr($repositoryPath, $accountLimit + 1); $repository->setOption("PATH", $repositoryPath); } // Set the password from a per user specific config $account = $optOption ? $optOption["account"] : $this->getUserName($repository); $password = $optOption ? $optOption["password"] : $this->getPassword($repository); $this->SSHOperation = new SSHOperations($repositoryPath, $account, $password); }