/** * Information about index */ function getIndexInfo() { require_once JPATH_SITE . DS . 'administrator' . DS . 'components' . DS . 'com_jucene' . DS . 'helpers' . DS . 'jucene.php'; $index = JuceneHelper::getIndex(); $info['infodocs'] = $index->count(); $dir_info = $this->getDirectorySize(JuceneHelper::getIndexPath()); $info['folderSize'] = $dir_info['size']; return $info; }
/** * Method that removes currently used index. The index name is held in the * component parameters */ function removeIndex() { $remove_path = JuceneHelper::getIndexPath(); if (JFolder::exists($remove_path)) { if (JFolder::delete($remove_path)) { JFactory::getApplication()->enqueueMessage(JTEXT::_("INDEXREMOVED")); } else { JFactory::getApplication()->enqueueMessage(JTEXT::_("COULDNOTREMOVE"), 'error'); } } else { //index doesnt exist JFactory::getApplication()->enqueueMessage(JTEXT::_("NOTHINGTOREMOVE")); } }