108 $this->checkLanguages = self::$enabledLanguages;
111 $this->checkLanguages = \array_intersect(
$filter->langId, $this->checkLanguages);
119 if (!($topPath = $topPathRes->fetch()))
128 '=DESCENDANTS.PARENT_ID' => $topPath[
'ID'],
131 if (isset($seek, $seek->pathId))
133 $pathFilter[
'>ID'] = $seek->pathId;
138 'select' => [
'ID',
'PATH'],
139 'filter' => $pathFilter,
140 'order' => [
'ID' =>
'ASC'],
144 $processedItemCount = 0;
151 while ($pathRow = $pathListRes->fetch())
153 $pathIdPortion[] = $lastPathId = (int)$pathRow[
'ID'];
154 $pathPortion[$lastPathId] = $pathRow[
'PATH'];
155 if (\
count($pathIdPortion) >= 100)
160 if (empty($pathIdPortion))
166 'select' => [
'ID',
'PATH_ID',
'LANG_ID'],
168 '=PATH_ID' => $pathIdPortion,
169 '=LANG_ID' => $this->checkLanguages,
172 $indexFileCache = [];
173 while ($indexFile = $indexFileCacheRes->fetch())
175 if (!isset($indexFileCache[(
int)$indexFile[
'PATH_ID']]))
177 $indexFileCache[(int)$indexFile[
'PATH_ID']] = [];
179 $indexFileCache[(int)$indexFile[
'PATH_ID']][$indexFile[
'LANG_ID']] = (
int)$indexFile[
'ID'];
181 unset($indexFileCacheRes, $indexFile);
183 $nonexistentFiles = [];
186 foreach ($pathPortion as $pathId =>
$path)
188 foreach ($this->checkLanguages as $langId)
190 $fullPath = self::$documentRoot. \str_replace(
'#LANG_ID#', $langId,
$path);
195 echo
"Lang file: {$fullPath}\n";
198 if (!\file_exists($fullPath))
200 if (isset($indexFileCache[$pathId][$langId]))
203 $nonexistentFiles[] = $indexFileCache[$pathId][$langId];
208 if (!isset($indexFileCache[$pathId][$langId]))
211 'PATH_ID' => $pathId,
212 'LANG_ID' => $langId,
213 'FULL_PATH' => $fullPath,
218 if (\
count($fileData) > 0)
220 Index\Internals\FileIndexTable::bulkAdd($fileData);
223 if (\
count($nonexistentFiles) > 0)
228 $processedItemCount +=
\count($pathIdPortion);
230 if ($timer !==
null && $timer->hasTimeLimitReached())
234 $seek->nextPathId = $lastPathId;
240 return $processedItemCount;