Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rebuild CollectiveAccess Hierarchical Indexes
<?php
require_once('setup.php');
require_once(__CA_LIB_DIR__.'/core/Datamodel.php');
set_time_limit(3600*8);
$o_db = new Db();
$t_timer = new Timer();
$o_dm = Datamodel::load();
$va_table_names = $o_dm->getTableNames();
$vn_tc = 0;
foreach($va_table_names as $vs_table) {
if ($o_instance = $o_dm->getInstanceByTableName($vs_table)) {
if ($o_instance->isHierarchical()) {
if (!$o_instance->rebuildAllHierarchicalIndexes()) {
$o_instance->rebuildHierarchicalIndex();
}
}
}
$vn_tc++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.