mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
Merge pull request #309 from GuySartorelli/patch-3
FIX Separate out all command components so Solr_Reindex works in dev mode
This commit is contained in:
commit
f0e781da36
@ -77,15 +77,12 @@ class SolrReindexImmediateHandler extends SolrReindexBase
|
|||||||
$indexClass = get_class($indexInstance);
|
$indexClass = get_class($indexInstance);
|
||||||
|
|
||||||
// Build script parameters
|
// 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$php = Environment::getEnv('SS_PHP_BIN') ?: Config::inst()->get(static::class, 'php_bin');
|
$php = Environment::getEnv('SS_PHP_BIN') ?: Config::inst()->get(static::class, 'php_bin');
|
||||||
@ -93,11 +90,12 @@ class SolrReindexImmediateHandler extends SolrReindexBase
|
|||||||
// Build script line
|
// Build script line
|
||||||
$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}";
|
|
||||||
|
|
||||||
$cmd = [
|
$cmd = [
|
||||||
$scriptTask,
|
$php,
|
||||||
"index={$indexClassEscaped}",
|
$scriptPath,
|
||||||
|
"dev/tasks/{$taskName}",
|
||||||
|
"index={$indexClass}",
|
||||||
"class={$class}",
|
"class={$class}",
|
||||||
"group={$group}",
|
"group={$group}",
|
||||||
"groups={$groups}",
|
"groups={$groups}",
|
||||||
|
Loading…
Reference in New Issue
Block a user