CleanEthalon :: runClearing: Bitrix method

      
<?php 
//  Bitrix\Translate\Controller\Editor\CleanEthalon :: runClearing()
//  /dist/bitrix/modules/translate/lib/controller/editor/cleanethalon.php:135

    
private function runClearing()
    {
        
$processedItemCount 0;
        for (
$pos = ((int)$this->seekOffset ? (int)$this->seekOffset 0), $total count($this->pathList); $pos $total$pos ++)
        {
            
$testPath $this->pathList[$pos];

            
// file
            
if (substr($testPath, -4) === '.php')
            {
                
$this->cleanLangFile($testPath);
            }

            
// folder
            
else
            {
                if (
substr($testPath, -5) === '/lang')
                {
                    
$testPath .= '/#LANG_ID#';
                }
                else
                {
                    
$testPath Translate\IO\Path::replaceLangId($testPath'#LANG_ID#');
                }

                foreach (
$this->lookThroughLangFolder($testPath) as $filePaths)
                {
                    foreach (
$filePaths as $langFilePath => $fullPaths)
                    {
                        if (!empty(
$this->seekLangPath))
                        {
                            if (
$this->seekLangPath == $langFilePath)
                            {
                                
$this->seekLangPath null;
                            }

                            continue;
                        }

                        
$this->cleanLangFile($langFilePath);

                        if (
$this->instanceTimer()->hasTimeLimitReached())
                        {
                            
$this->seekLangPath $langFilePath;
                            break 
3;
                        }
                    }

                    
$this->seekLangPath null;
                }
            }

            
$processedItemCount ++;

            if (isset(
$this->pathList[$pos 1]))
            {
                
$this->seekOffset $pos 1;//next
            
}
            else
            {
                
$this->seekOffset null;
                
$this->declareAccomplishment();
                
$this->clearProgressParameters();
            }

            if (
$this->instanceTimer()->hasTimeLimitReached())
            {
                break;
            }
        }

        
$this->processedItems += $processedItemCount;

        if (
$this->instanceTimer()->hasTimeLimitReached() !== true)
        {
            
$this->declareAccomplishment();
            
$this->clearProgressParameters();
        }

        return array(
            
'PROCESSED_ITEMS' => $this->processedItems,
            
'TOTAL_ITEMS' => $this->totalItems,
        );
    }