function kunena_upgrade_161_delfiles($parent) { if (Kunena::isSVN()) { return; } //Import filesystem libraries. jimport('joomla.filesystem.folder'); $path = JPATH_COMPONENT . '/views/article'; if (JFolder::exists($path)) { JFolder::delete($path); } return array('action' => '', 'name' => JText::_('COM_KUNENA_INSTALL_161_DELFILES'), 'success' => true); }
public function stepFinish() { $entryfiles = array(array(KPATH_ADMIN, 'api', 'php'), array(KPATH_ADMIN, 'admin.kunena', 'php'), array(KPATH_SITE, 'router', 'php'), array(KPATH_SITE, 'kunena', 'php')); $lang = JFactory::getLanguage(); $lang->load('com_kunena', JPATH_SITE); // TODO: remove dependence require_once KPATH_ADMIN . '/api.php'; kimport('factory'); require_once KPATH_SITE . '/class.kunena.php'; $this->createMenu(false); CKunenaTools::reCountBoards(); foreach ($entryfiles as $fileparts) { list($path, $filename, $ext) = $fileparts; if (is_file("{$path}/{$filename}.new.{$ext}")) { $success = JFile::delete("{$path}/{$filename}.{$ext}"); if (!$success) { $this->addStatus(JText::_('COM_KUNENA_INSTALL_DELETE_STATUS_FAIL') . " {$filename}.{$ext}", false, ''); } $success = JFile::move("{$path}/{$filename}.new.{$ext}", "{$path}/{$filename}.{$ext}"); if (!$success) { $this->addStatus(JText::_('COM_KUNENA_INSTALL_RENAMING_FAIL') . " {$filename}.new.{$ext}", false, ''); } } } // Cleanup directory structure if (!Kunena::isSVN()) { if (JFolder::exists(KPATH_ADMIN . '/language')) { JFolder::delete(KPATH_ADMIN . '/language'); } if (JFolder::exists(KPATH_SITE . '/language')) { JFolder::delete(KPATH_SITE . '/language'); } } if (!$this->getError()) { $this->updateVersionState(''); $this->addStatus(JText::_('COM_KUNENA_INSTALL_SUCCESS'), true, ''); $this->setStep($this->getStep() + 1); } }
public function stepExtract() { $path = JPATH_ADMINISTRATOR . '/components/com_kunena/archive'; if (!is_file("{$path}/fileformat")) { $this->setStep($this->getStep() + 1); return; } $ext = file_get_contents("{$path}/fileformat"); static $files = array(array('name' => 'com_kunena-admin', 'dest' => KPATH_ADMIN), array('name' => 'com_kunena-site', 'dest' => KPATH_SITE), array('name' => 'com_kunena-media', 'dest' => KPATH_MEDIA)); $task = $this->getTask(); if (isset($files[$task])) { $file = $files[$task]; if (file_exists($path . '/' . $file['name'] . $ext)) { $this->extract($path, $file['name'] . $ext, $file['dest'], Kunena::isSVN()); } $this->setTask($task + 1); } else { if (!$this->getError()) { $this->setStep($this->getStep() + 1); } } }