mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
Merge pull request #203 from creative-commoners/pulls/3.0/reindex-mah-windows
FIX permit reindexing on a Windows machine
This commit is contained in:
commit
8dc27d5bba
@ -60,19 +60,21 @@ class SolrReindexImmediateHandler extends SolrReindexBase
|
||||
$group,
|
||||
$taskName
|
||||
) {
|
||||
// Build state
|
||||
$indexClass = get_class($indexInstance);
|
||||
|
||||
// Build script parameters
|
||||
$indexClassEscaped = $indexClass;
|
||||
$statevar = json_encode($state);
|
||||
|
||||
if (strpos(PHP_OS, "WIN") !== false) {
|
||||
$statevar = '"'.str_replace('"', '\\"', $statevar).'"';
|
||||
} else {
|
||||
$statevar = "'".$statevar."'";
|
||||
$class = addslashes($class);
|
||||
$indexClassEscaped = addslashes($indexClass);
|
||||
}
|
||||
|
||||
// Build script
|
||||
$indexName = $indexInstance->getIndexName();
|
||||
$indexClass = get_class($indexInstance);
|
||||
$indexClassEscaped = addslashes($indexClass);
|
||||
$class = addslashes($class);
|
||||
// Build script line
|
||||
$frameworkPath = ModuleLoader::getModule('silverstripe/framework')->getPath();
|
||||
$scriptPath = sprintf("%s%scli-script.php", $frameworkPath, DIRECTORY_SEPARATOR);
|
||||
$scriptTask = "php {$scriptPath} dev/tasks/{$taskName}";
|
||||
|
Loading…
Reference in New Issue
Block a user