Beispiel #1
0
 function DoEvent($originator, $eventname, &$params)
 {
     $this->load_tools();
     return search_DoEvent($this, $originator, $eventname, $params);
 }
Beispiel #2
0
function search_Reindex(&$module)
{
    audit('', $module->GetName(), 'Reindex Operation Started');
    @set_time_limit(999);
    $module->DeleteAllWords();
    // this could run out of memory...
    cmsms()->GetContentOperations()->LoadAllContent(TRUE, FALSE, TRUE);
    $full_list = cmsms()->GetHierarchyManager()->getFlatList();
    foreach ($full_list as $node) {
        $cid = $node->get_tag('id');
        $content = cmsms()->GetContentOperations()->LoadContentFromId($cid);
        if (!is_object($content)) {
            continue;
        }
        $parms = array('content' => $content);
        search_DoEvent($module, 'Core', 'ContentEditPost', $parms, TRUE);
    }
    // this could run out of memory very quickly.
    $modules = ModuleOperations::get_instance()->GetInstalledModules();
    foreach ($modules as $name) {
        if (!$name || $name == 'Search') {
            continue;
        }
        $object = ModuleOperations::get_instance()->get_module_instance($name);
        if (!is_object($object)) {
            continue;
        }
        if (method_exists($object, 'SearchReindex')) {
            $object->SearchReindex($module);
        }
    }
    audit('', $module->GetName(), 'Reindex Operation Completed');
}