Last active
September 5, 2016 02:00
-
-
Save kehh/5f507c12deec226107ac35ec243c68ff to your computer and use it in GitHub Desktop.
Rebuild CollectiveAccess Hierarchical Indexes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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