public function extractContentAndSaveToIndex($files)
    {
        $counter = 0;
        if (is_array($files) && count($files)) {
            foreach ($files as $file) {
                if ($this->fileInfo->setFile($file)) {
                    // get file content, check if we have a FAL resource or a simple
                    // string containing the path to the file
                    if ($file instanceof \TYPO3\CMS\Core\Resource\File) {
                        $content = $this->getFileContent($file->getForLocalProcessing(false));
                    } else {
                        $content = $this->getFileContent($file);
                    }

                    if (!($content === false)) {
                        $this->storeToIndex($file, $content);
                        $counter++;
                    }
                }
            }
        }

        return $counter;
    }
public function extractContentAndSaveToIndex($files)
    {
        $counter = 0;
        if (is_array($files) && count($files)) {
            foreach ($files as $file) {
                if ($this->fileInfo->setFile($file)) {
                    // get file content, check if we have a FAL resource or a simple
                    // string containing the path to the file
                    if ($file instanceof \TYPO3\CMS\Core\Resource\File) {
                        $content = $this->getFileContent($file->getForLocalProcessing(false));
                    } else {
                        $content = $this->getFileContent($file);
                    }

                    if (!($content === false)) {
                        $this->storeToIndex($file, $content);
                        $counter++;
                    }
                }
            }
        }

        return $counter;
    }
public function extractContentAndSaveToIndex ( $ files ) { $ counter = 0 ; if ( is_array ( $ files ) && count ( $ files ) ) { foreach ( $ files as $ file ) { if ( $ this -> fileInfo -> setFile ( $ file ) ) { // get file content, check if we have a FAL resource or a simple // string containing the path to the file if ( $ file instanceof \ TYPO3 \ CMS \ Core \ Resource \ File ) { $ content = $ this -> getFileContent ( $ file -> getForLocalProcessing ( false ) ) ; } else { $ content = $ this -> getFileContent ( $ file ) ; } if ( ! ( $ content === false ) ) { $ this -> storeToIndex ( $ file , $ content ) ; $ counter ++ ; } } } } return $ counter ; }
loops through an array of files an stores their content
to the index.
returns number of files indexed.
@param array $files
@return integer
loops through an array of files an stores their content to the index . returns number of files indexed .