45 public function run($path =
'')
49 $path = Translate\Config::getDefaultPath();
52 if (\preg_match(
"#(.+\/lang)(\/?\w*)#", $path, $matches))
57 $path =
'/'. \trim($path,
'/.\\');
62 $indexPath = Translate\Index\PathIndex::loadByPath($path);
63 if ($indexPath instanceof Translate\Index\
PathIndex)
65 if ($indexPath->getIndexed())
68 'STATUS' => Translate\Controller\STATUS_COMPLETED
74 if ($this->isNewProcess)
76 $languages = $this->controller->getRequest()->get(
'languages');
77 if (\is_array($languages) && !\in_array(
'all', $languages))
79 $languages = \array_intersect($languages, Translate\Config::getEnabledLanguages());
80 if (!empty($languages))
82 $this->languages = $languages;
87 if (!empty($this->languages))
89 $filter->langId = $this->languages;
97 $this->isNewProcess =
false;
103 if (isset($progressParams[
'totalItems']) && (
int)$progressParams[
'totalItems'] > 0)
105 $this->totalItems = (int)$progressParams[
'totalItems'];
106 $this->processedItems = (int)$progressParams[
'processedItems'];
109 if (isset($progressParams[
'seekPathId']))
111 $this->seekPathId = $progressParams[
'seekPathId'];
115 return $this->
performStep(
'runIndexing', [
'path' => $path]);