46 public function run($path =
'')
50 $path = Translate\Config::getDefaultPath();
53 if (\preg_match(
"#(.+\/lang)(\/?\w*)#", $path, $matches))
58 $path =
'/'. \trim($path,
'/.\\');
63 $indexPath = Translate\Index\PathIndex::loadByPath($path);
64 if ($indexPath instanceof Translate\Index\
PathIndex)
66 if ($indexPath->getIndexed())
69 'STATUS' => Translate\Controller\STATUS_COMPLETED
75 if ($this->isNewProcess)
77 $languages = $this->controller->getRequest()->get(
'languages');
78 if (\is_array($languages) && !\in_array(
'all', $languages))
80 $languages = \array_intersect($languages, Translate\Config::getEnabledLanguages());
81 if (!empty($languages))
83 $this->languages = $languages;
89 if (!empty($this->languages))
91 $filter->langId = $this->languages;
94 $this->totalItems = $indexer->countItemsToProcess($filter);
95 $this->processedItems = 0;
99 $indexer->purge($filter);
109 $this->isNewProcess =
false;
115 if (isset($progressParams[
'totalItems']) && (
int)$progressParams[
'totalItems'] > 0)
117 $this->totalItems = (int)$progressParams[
'totalItems'];
118 $this->processedItems = (int)$progressParams[
'processedItems'];
121 if (isset($progressParams[
'seekPathLangId']))
123 $this->seekPathLangId = $progressParams[
'seekPathLangId'];
127 return $this->
performStep(
'runIndexing', [
'path' => $path]);