/** * method to preflight the update of this plugin * * @param string $type 'update' or 'install' * @param JInstallerAdapterPlugin $parent The class calling this method * @return void */ public function preflight( /** @noinspection PhpUnusedParameterInspection */ $type, $parent ) { $element = 'cbpaidsubsbot'; $installer = $parent->getParent(); $adminPath = $installer->getPath( 'source' ); if ( JFile::exists( $adminPath . '/' . $element . '.j16.xml' ) ) { if ( JFile::exists( $adminPath . '/' . $element . '.xml' ) ) { JFile::delete( $adminPath . '/' . $element . '.xml' ); } JFile::move( $adminPath . '/' . $element . '.j16.xml', $adminPath . '/' . $element . '.xml' ); $installer->setPath( 'manifest', $adminPath . '/' . $element . '.xml' ); } }
protected function setupInstallPaths() { parent::setupInstallPaths(); $this->parent->setPath('extension_root', COM_TZ_PORTFOLIO_PLUS_ADDON_PATH . '/' . $this->group . '/' . $this->element); }
/** * Method to run after an install/update/uninstall method. * * @param string $type Install type (install, update, discover_install, extension_site). * @param \JInstallerAdapterPlugin $parent Parent installer adapter. * * @return void */ public function postflight($type, $parent) { $db = JFactory::getDbo(); // Get install manifest // ======================================================================== $p_installer = $parent->getParent(); $installer = new JInstaller(); $manifest = $p_installer->manifest; $path = $p_installer->getPath('source'); $result = array(); $css = <<<CSS <style type="text/css"> #ak-install-img { } #ak-install-msg { } </style> CSS; echo $css; $installScript = dirname($path) . '/windwalker/src/System/installscript.php'; if (!is_file($installScript)) { $installScript = JPATH_LIBRARIES . '/windwalker/src/System/installscript.php'; } include $installScript; }