From aac63d40670923c992d5015608890629a0b4532a Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Wed, 19 Mar 2014 12:14:56 +1300 Subject: [PATCH] Pass verbose through to nested call. Correct ID output --- code/solr/Solr.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/code/solr/Solr.php b/code/solr/Solr.php index cb6da83..92f28bc 100644 --- a/code/solr/Solr.php +++ b/code/solr/Solr.php @@ -259,7 +259,12 @@ class Solr_Reindex extends BuildTask { echo "$offset.."; $cmd = "php $script dev/tasks/$self index=$index class=$class start=$offset variantstate=$statevar"; - if($verbose) echo "\n Running '$cmd'\n"; + + if($verbose) { + echo "\n Running '$cmd'\n"; + $cmd .= " verbose=1"; + } + $res = $verbose ? passthru($cmd) : `$cmd`; if($verbose) echo " ".preg_replace('/\r\n|\n/', '$0 ', $res)."\n"; @@ -290,9 +295,9 @@ class Solr_Reindex extends BuildTask { ->where($filter) ->limit($this->stat('recordsPerRequest'), $start); - if($verbose) echo "Adding "; + if($verbose) echo "Adding $class"; foreach ($items as $item) { - if($verbose) echo $index->ID . ' '; + if($verbose) echo $item->ID . ' '; $index->add($item);