/** * CLI Application View. * * @return void */ protected function runwap() { $webPath = str_replace(JPATH_ROOT . DIRECTORY_SEPARATOR, '', $this->project->getExtensionPath()); $this->href = JURI::root() . $webPath; //.'/'.$this->project->comName.'.php'; $this->setLayout('runwap'); }
/** * Installs an extension with the standard Joomla! installer. * * @throws EcrExceptionBuilder * @return EcrProjectBuilder */ private function install() { if ($this->testMode) { //-- Exiting in test mode $this->logger->log('TEST MODE - not installing'); return $this; } if ('cliapp' == $this->project->type || 'webapp' == $this->project->type) { $src = $this->buildDir . '/site'; $dest = $this->project->getExtensionPath(); if (false == JFolder::copy($src, $dest)) { throw new EcrExceptionBuilder(sprintf('Failed to copy the JApplication from %s to %s', $src, $dest)); } $this->logger->log(sprintf('JApplication files copied from %s to %s', $src, $dest)); $src = $this->buildDir . DS . $this->project->getJoomlaManifestName(); $dest = $this->project->getJoomlaManifestPath() . DS . $this->project->getJoomlaManifestName(); if (false == JFile::copy($src, $dest)) { throw new EcrExceptionBuilder(sprintf('Failed to copy package manifest xml from %s to %s', $src, $dest)); } return $this; } if ('package' == $this->project->type) { //-- J! 1.6 package - only copy the manifest xml $src = $this->buildDir . DS . $this->project->getJoomlaManifestName(); $dest = $this->project->getJoomlaManifestPath() . DS . $this->project->getJoomlaManifestName(); if (false == JFile::copy($src, $dest)) { throw new EcrExceptionBuilder(sprintf('Failed to copy package manifest xml from %s to %s', $src, $dest)); } $this->logger->log(sprintf('Package manifest xml has been copied from %s to %s', $src, $dest)); return $this; } jimport('joomla.installer.installer'); jimport('joomla.installer.helper'); $this->logger->log('Starting Install'); //-- Did you give us a valid package ? $type = JInstallerHelper::detectType($this->buildDir); if (false == $type) { throw new EcrExceptionBuilder(jgettext('Path does not have a valid package')); } //-- Get an installer instance $installer = JInstaller::getInstance(); //-- Install the package $result = $installer->install($this->buildDir); $this->logger->log('Installer Message: ' . $installer->message); $this->logger->log('Extension Message: ' . $installer->get('extension.message')); //-- Clean up the install directory. If we are not debugging. ECR_DEBUG ? null : JInstallerHelper::cleanupInstall('', $this->buildDir); //-- There was an error installing the package if (false == $result) { throw new EcrExceptionBuilder(sprintf(jgettext('An error happened while installing your %s'), jgettext($type))); } return $this; }