ENHANCEMENT: Made the search ofr cli-script.php a little more flexible in light of sapphire dirname change

This commit is contained in:
Russell Michell 2012-05-14 12:29:41 +12:00 committed by Hamish Friedlander
parent cc36237c94
commit c77da7d42c

View File

@ -152,7 +152,12 @@ class Solr_Reindex extends BuildTask {
$this->runFrom(singleton($_GET['index']), $_GET['class'], $_GET['start'], json_decode($_GET['variantstate'], true)); $this->runFrom(singleton($_GET['index']), $_GET['class'], $_GET['start'], json_decode($_GET['variantstate'], true));
} }
else { else {
$script = sprintf('%s%ssapphire%scli-script.php', BASE_PATH, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR); foreach(array('framework','sapphire') as $dirname) {
$script = sprintf("%s%s$dirname%scli-script.php", BASE_PATH, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR);
if(file_exists($script)) {
break;
}
}
$class = get_class($this); $class = get_class($this);
foreach (Solr::get_indexes() as $index => $instance) { foreach (Solr::get_indexes() as $index => $instance) {