Scan the next file in the array and provide back an array of lines.

@access	public
@return	mixed	Array of lines from the file or false for no more files.
779571
public function scanNextFile() {
		$_file = each($this->files);
		if ($_file === false) {
			return false;
		}
		$file = $_file['value'];

		$lines = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
		if ($lines === false) {
			$lines = [];
		}
		return $lines;
	}
1370092
public function toArray()
    {
        return [
            'fileId' => $this->file->getId(),
            'fileVersion' => $this->file->getVersion(),
            'usageType' => $this->usageType,
            'usageId' => $this->usageId,
            'status' => $this->status,
        ];
    }
235338
public function setLineAndFile()
	{
		if (isset($this->backTrace[$this->backTraceOffset])) {
			/* Reset the ID because its based on the current line and file */
			$this->ID = null;

			$calledHere = $this->backTrace[$this->backTraceOffset];
			if (isset($calledHere['line'])) {
				$this->line = $calledHere['line'];
			}
			if (isset($calledHere['file'])) {
				$this->file = $calledHere['file'];
			}
		}

		return $this;
	}
13942
protected function securityScan()
    {
        if (
            is_array($this->files[$this->input_file_name]) && 
            array_key_exists('name', $this->files[$this->input_file_name]) && 
            array_key_exists('tmp_name', $this->files[$this->input_file_name]) && 
            $this->files[$this->input_file_name]['tmp_name'] != null
        ) {
            // there is an uploaded file.
            if (is_file($this->files[$this->input_file_name]['tmp_name'])) {
                $file_content = file_get_contents($this->files[$this->input_file_name]['tmp_name']);

                // scan php open tag
                if (stripos($file_content, '<?php') !== false || stripos($file_content, '<?=') !== false) {
                    // found php open tag. (<?php).
                    $this->setErrorMessage(
                        sprintf(static::__('Error! Found php embedded in the uploaded file. (%s).'), $this->files[$this->input_file_name]['name']),
                        'RDU_SEC_ERR_PHP',
                        $this->files[$this->input_file_name]['name'],
                        $this->files[$this->input_file_name]['name'],
                        $this->files[$this->input_file_name]['size'],
                        $this->files[$this->input_file_name]['type']
                    );
                    return false;
                }

                // scan cgi/perl
                if (stripos($file_content, '#!/') !== false && stripos($file_content, '/perl') !== false) {
                    // found cgi/perl header.
                    $this->setErrorMessage(
                        sprintf(static::__('Error! Found cgi/perl embedded in the uploaded file. (%s).'), $this->files[$this->input_file_name]['name']),
                        'RDU_SEC_ERR_CGI',
                        $this->files[$this->input_file_name]['name'],
                        $this->files[$this->input_file_name]['name'],
                        $this->files[$this->input_file_name]['size'],
                        $this->files[$this->input_file_name]['type']
                    );
                    return false;
                }

                // scan shell script
                // reference: https://en.wikipedia.org/wiki/Shell_script 
                // https://stackoverflow.com/questions/10591086/shell-script-headers-bin-sh-vs-bin-csh
                // https://www.shellscript.sh/
                if (
                    stripos($file_content, '#!/') !== false && 
                    (
                        stripos($file_content, '/bin/sh') !== false ||
                        stripos($file_content, '/bin/bash') !== false ||
                        stripos($file_content, '/bin/csh') !== false ||
                        stripos($file_content, '/bin/tcsh') !== false
                    )
                ) {
                    // found shell script.
                    $this->setErrorMessage(
                        sprintf(static::__('Error! Found shell script embedded in the uploaded file. (%s).'), $this->files[$this->input_file_name]['name']),
                        'RDU_SEC_ERR_CGI',
                        $this->files[$this->input_file_name]['name'],
                        $this->files[$this->input_file_name]['name'],
                        $this->files[$this->input_file_name]['size'],
                        $this->files[$this->input_file_name]['type']
                    );
                    return false;
                }

                unset($file_content);
            }
        }

        return true;
    }
1105215
public function count()
    {
        $handle = $this->createHandle($this->getFilePath());
        $lineCount = 0;

        while (!feof($handle)) {
            $line = $this->readLine($handle, null);
            if ($line !== '') {
                ++$lineCount;
            }
        }

        fclose($handle);

        return $lineCount;
    }
841023
protected function getNextDataSet()
    {
        $set = $this->file->fgetcsv($this->delimiter, $this->enclosure, $this->escape);

        if (is_array($set) && 1 === count($set) && null === $set[0]) {
            if ($this->skipEmptyLines && !$this->file->eof()) {
                return $this->getNextDataSet();
            }

            return null;
        }

        if ($this->removeBom) {
            if (substr($set[0], 0, 3) == pack("CCC", 0xef, 0xbb, 0xbf)) {
                $set[0] = substr($set[0], 3);
            }
            $this->removeBom = false;
        }

        $set = $this->convertEncoding($set);

        $this->line++;

        return $set;
    }
146109
public function getFiles() {
        static $files;
        if (!isset($files)) {
            $normalizeLevel = function(array $file) use (&$normalizeLevel) {
                if (isset($file['name']) && is_array($file['name'])) {
                    $properties = \array_keys($file);
                    $normalized = [];
                    foreach (\array_keys($file['name']) as $name) {
                        foreach ($properties as $property) {
                            $normalized[$name][$property] = $file[$property][$name];
                        }
                        $normalized[$name] = $normalizeLevel($normalized[$name]);
                    }
                    $file = $normalized;
                }
                return $file;
            };
            $files = [];
            if (isset($_FILES)) {
                foreach ($_FILES as $key => $file) {
                    $files[$key] = $normalizeLevel($file);
                }
            }
        }
        return $files;
    }
608960
public function next() {
		if ($this->currentRecord < count($this->files)) {
			$file = $this->files[$this->currentRecord];
			$this->currentRecord++;
			return $file;
		} else {
			return false;
		}
	}
1334872
public function getTail($lines = 10){
		$this->blockStart = $this->fileSize;
		$buff1 = Array();
		$lastLines = array();
		
		while($this->blockStart){
			$buff = $this->readChunk();
			if(!$buff)break;
			
			$lines -= substr_count($buff, "\n");
			
			if($lines <= 0)
			{
				$buff1[] = $this->cutHead($buff, "\n", abs($lines)+1);
				break;
			}
			$buff1[] = $buff;
		}
		
		for($i = count($buff1); $i >= 0; $i--){
			$lastLines = array_merge($lastLines, explode("\n", $buff1[$i]));
		}
		
		return $lastLines;
	}
329495
public function provideFilesToCheck()
    {
        $iterator = new AppendIterator();

        foreach ($this->getPaths() as $path) {
            $iterator->append(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)));
        }

        $files = new CallbackFilterIterator($iterator, function ($file) {
            return $file->getFilename()[0] !== '.' && !$file->isDir();
        });

        return array_map(function ($file) {
            return [(string) $file];
        }, iterator_to_array($files));
    }
932575
public function lines()
    {
        $array = $this->split('[\r\n]{1,2}', $this->str);
        for ($i = 0; $i < count($array); $i++) {
            $array[$i] = static::create($array[$i], $this->encoding);
        }

        return $array;
    }
386288
protected function nextLine()
    {
        if ($this->lineNumber < count($this->lines)) {
            return $this->lines[$this->lineNumber++];
        }
        return false;
    }
116962
public function next() {
		if ($this->currentRecord < count($this->rows)) {
			$row = $this->rows[$this->currentRecord];
			$this->currentRecord++;
			return $row;
		} else {
			return false;
		}
	}
694601
public function getCoveredLines(): array
    {
        $this->getDiff();

        $coveredFiles = $this->fileChecker->parseLines();
        $this->uncoveredLines = [];
        $this->coveredLines = [];

        $diffFiles = array_keys($this->cache->diff);
        foreach ($diffFiles as $file) {
            $matchedFile = $this->findFile($file, $coveredFiles);
            if ($matchedFile !== '') {
                $this->matchLines($file, $matchedFile);
            }
        }

        return [
            'uncoveredLines' => $this->uncoveredLines,
            'coveredLines' => $this->coveredLines,
        ];
    }
902934
public function fileList()
    {
        $result = array();

        $dirContent = opendir($this->_dirPath);
        while (($file = readdir($dirContent)) !== false) {
            if (($file == '..')||($file == '.')) {   continue;
            }

            if(!is_dir($this->_dirPath . '/' . $file) ) {
                $result[] = $file;
            }
        }
        closedir($dirContent);

        return $result;
    }
776970
public function toArray()
	{
		$data		= array();
		$iterator	= new FS_File_CSV_Iterator( $this->fileName, $this->delimiter );
		while( $iterator->next() )
			$data[]	= $iterator->current();
		if( $this->withHeaders )
			array_shift( $data );
		return $data;
	}
667387
public function scanExtensions() {
		$extensions = RtCache::get('loader@extensions');
		if (is_array($extensions)) {
			return $extensions;
		}
		if (is_dir(EXTENSIONS_PATH)) {
			$it         = new \DirectoryIterator (EXTENSIONS_PATH);
			$extensions = [];
			foreach ($it as $dir) {
				if ($dir->isDot()) {
					continue;
				}
				if ($dir->isDir()) {
					$dirname = $dir->getFilename();
					$boot    = EXTENSIONS_PATH . $dirname . DS . $dirname . '.php';
					if (is_file($boot)) {
						$extensions[ $dirname ] = $boot;
					}
					$this->scanSubDir($dir->getRealPath(), $extensions, $dirname);
				}
			}
			RtCache::add('loader@extensions', $extensions);
		} else {
			$extensions = [];
		}

		return $extensions;
	}