Skip to content

Commit

Permalink
FIX Use ModuleLoader to resolve the path to cli-script.php in framework
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill committed Nov 15, 2017
1 parent 216613d commit 992bb5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/solr/reindex/handlers/SolrReindexImmediateHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Psr\Log\LoggerInterface;
use SilverStripe\Control\Director;
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\FullTextSearch\Solr\Solr;
use SilverStripe\FullTextSearch\Solr\SolrIndex;
use SilverStripe\ORM\DB;
Expand Down Expand Up @@ -71,7 +72,8 @@ protected function processGroup(
$indexClass = get_class($indexInstance);
$indexClassEscaped = addslashes($indexClass);
$class = addslashes($class);
$scriptPath = sprintf("%s%sframework%scli-script.php", BASE_PATH, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR);
$frameworkPath = ModuleLoader::getModule('silverstripe/framework')->getPath();
$scriptPath = sprintf("%s%scli-script.php", $frameworkPath, DIRECTORY_SEPARATOR);
$scriptTask = "php {$scriptPath} dev/tasks/{$taskName}";

$cmd = "{$scriptTask} index={$indexClassEscaped} class={$class} group={$group} groups={$groups} variantstate={$statevar}";
Expand Down

0 comments on commit 992bb5a

Please sign in to comment.