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,
|
$group,
|
||||||
$taskName
|
$taskName
|
||||||
) {
|
) {
|
||||||
// Build state
|
$indexClass = get_class($indexInstance);
|
||||||
|
|
||||||
|
// Build script parameters
|
||||||
|
$indexClassEscaped = $indexClass;
|
||||||
$statevar = json_encode($state);
|
$statevar = json_encode($state);
|
||||||
|
|
||||||
if (strpos(PHP_OS, "WIN") !== false) {
|
if (strpos(PHP_OS, "WIN") !== false) {
|
||||||
$statevar = '"'.str_replace('"', '\\"', $statevar).'"';
|
$statevar = '"'.str_replace('"', '\\"', $statevar).'"';
|
||||||
} else {
|
} else {
|
||||||
$statevar = "'".$statevar."'";
|
$statevar = "'".$statevar."'";
|
||||||
|
$class = addslashes($class);
|
||||||
|
$indexClassEscaped = addslashes($indexClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build script
|
// Build script line
|
||||||
$indexName = $indexInstance->getIndexName();
|
|
||||||
$indexClass = get_class($indexInstance);
|
|
||||||
$indexClassEscaped = addslashes($indexClass);
|
|
||||||
$class = addslashes($class);
|
|
||||||
$frameworkPath = ModuleLoader::getModule('silverstripe/framework')->getPath();
|
$frameworkPath = ModuleLoader::getModule('silverstripe/framework')->getPath();
|
||||||
$scriptPath = sprintf("%s%scli-script.php", $frameworkPath, DIRECTORY_SEPARATOR);
|
$scriptPath = sprintf("%s%scli-script.php", $frameworkPath, DIRECTORY_SEPARATOR);
|
||||||
$scriptTask = "php {$scriptPath} dev/tasks/{$taskName}";
|
$scriptTask = "php {$scriptPath} dev/tasks/{$taskName}";
|
||||||
|
Loading…
Reference in New Issue
Block a user