Builds a flat list of files by diving down recursively

@return  array
540984
public function getFlatListOfFiles()
	{
		if (!isset($this->flatData))
		{
			$this->flatData = [];

			foreach ($this as $entity)
			{
				if ($entity->isFile())
				{
					$this->flatData[] = $entity;
				}
				else
				{
					// The result of this is already flat, so no need for recursion
					foreach ($entity->listContents(true) as $sub)
					{
						if ($sub->isfile())
						{
							$this->flatData[] = $sub;
						}
					}
				}
			}
		}

		return $this->flatData;
	}
927019
protected function getFileSystem(): array
	{
		$fileSystem = [];

		$command = $this->readCommand('df -T');
		if ($command) {
			$bufe = preg_split("/\n/", $command, -1, PREG_SPLIT_NO_EMPTY);
			unset($bufe[0]);
			foreach ($bufe as $buf) {
				$data = preg_split('/\s+/', $buf);
				$mounted = new Obj;

				$mounted->partition = $data[0];
				$mounted->type = $data[1];
				$mounted->size = $data[2] * 1024;
				$mounted->used = $data[3] * 1024;
				$mounted->free = $data[4] * 1024;
				$mounted->usage = $data[5];
				$mounted->mountPoint = $data[6];

				$fileSystem[] = $mounted;
			}
		}

		return $fileSystem;
	}
772428
public function findFiles()
    {
        $search = (new Finder())->files();
        // Add in paths
        foreach ($this->paths as $path) {
            if (is_readable($path)) {
                $search->in($path);
            }
        }
        // Add in names
        foreach ($this->files as $pattern) {
            $search->name($pattern);
        }

        $array = array();
        foreach ($search as $f) {
            $array[] = $f->getRealPath();
        }

        return $array;

    }
1195526
public function getFiles()
    {
        $finders = [
            MainConfigurationFinder::class,
            ContextualConfigurationFinder::class,
            PluginsConfigurationFinder::class,
        ];

        // Filter out non-existing folders
        $folders = $this->getFolders();
        if (!$folders) {
            return [];
        }

        $files = [];
        foreach ($folders as $folder) {
            foreach ($finders as $finder) {
                /** @var AbstractConfigurationFinder $finder */
                $finder = new $finder($this->files, $folder);
                $files = array_merge($files, $finder->getFiles());
            }
        }

        // Load consolidated configuration
        $folder = $this->paths->getRocketeerPath();
        if ($this->files->has($folder)) {
            $consolidated = new ConsolidatedConfigurationFinder($this->files, $folder);
            $files = array_merge($files, $consolidated->getFiles());
        }

        return $files;
    }
971257
public function getList()
    {
        $items = array();

        for ($i = 0; $i < $this->zip->numFiles; $i++) {
            $items[] = $this->zip->getNameIndex($i);
        }

        return $items;
    }
793379
public function getFiles()
    {
        $dir = WINDWALKER_CACHE . '/profiler';

        if (!is_dir($dir)) {
            return [];
        }

        return new \RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS));
    }
100328
public function lists()
    {
        $parts = explode('.', $this->file->filename);

        $extension = array_pop($parts);

        $name = $this->file->path(implode('.', $parts));

        $files = glob($this->file->realPath("{$name}-*"));

        array_walk($files, function (&$file) {
            $file = substr($file, strrpos($file, '/') + 1, strlen($file));
            $file = $this->file->path($file);
        });

        return collect($files);
    }
968614
public function getFileSpecifications() {
        $fileSpecifications = array();
        
        foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->getSource())) as $entry)
            if (!fphp\Helper\Path::isDot($entry)) {
                $fileSource = $entry->getPathName();
                if (is_link($fileSource))
                    continue;
                $relativeFileTarget = fphp\Helper\Path::stripBase(
                    realpath($fileSource), realpath($this->getSource()));

                foreach ($this->getExclude() as $exclude) {
                    if ($relativeFileTarget === $exclude)
                        continue 2;
                    $parts = explode("/", $exclude);
                    if ($parts[count($parts) - 1] === "*")
                        try {
                            fphp\Helper\Path::stripBase($relativeFileTarget, implode("/", array_slice($parts, 0, count($parts) - 1)));
                            continue 2;
                        } catch (fphp\Helper\PathException $e) {}
                }
                        
                $fileTarget = fphp\Helper\Path::join(
                    $this->get("baseTarget"), fphp\Helper\Path::join($this->getTarget(), $relativeFileTarget));
                $fileSpecifications[] = new FileSpecification(
                    array("source" => $fileSource, "target" => $fileTarget), $this->getDirectory());
            }
        
        return $fileSpecifications;
    }
1133001
private function getFiles()
    {
        $fieldname = $this->setting['fieldname'];
        if ($fieldname) {
            $_files = isset($_FILES[$fieldname]) ? $_FILES[$fieldname] : array();
            $files  = [$fieldname => $_files];
        } else {
            //all
            $files = $_FILES;
        }
        return $files;
    }
1157502
protected function _buildFiles()
    {
        $paths = $this->_paths;
        $paths[] = realpath(APP) . DIRECTORY_SEPARATOR;

        usort($paths, function ($a, $b) {
            return strlen($a) - strlen($b);
        });

        foreach ($this->_translations as $domain => $translations) {
            foreach ($translations as $msgid => $contexts) {
                foreach ($contexts as $context => $details) {
                    $plural = $details['msgid_plural'];
                    $files = $details['references'];
                    $occurrences = [];
                    foreach ($files as $file => $lines) {
                        $lines = array_unique($lines);
                        $occurrences[] = $file . ':' . implode(';', $lines);
                    }
                    $occurrences = implode("\n#: ", $occurrences);
                    $header = '';
                    if (!$this->param('no-location')) {
                        $header = '#: ' . str_replace(DIRECTORY_SEPARATOR, '/', str_replace($paths, '', $occurrences)) . "\n";
                    }

                    $sentence = '';
                    if ($context !== '') {
                        $sentence .= "msgctxt \"{$context}\"\n";
                    }
                    if ($plural === false) {
                        $sentence .= "msgid \"{$msgid}\"\n";
                        $sentence .= "msgstr \"\"\n\n";
                    } else {
                        $sentence .= "msgid \"{$msgid}\"\n";
                        $sentence .= "msgid_plural \"{$plural}\"\n";
                        $sentence .= "msgstr[0] \"\"\n";
                        $sentence .= "msgstr[1] \"\"\n\n";
                    }

                    if ($domain !== 'default' && $this->_merge) {
                        $this->_store('default', $header, $sentence);
                    } else {
                        $this->_store($domain, $header, $sentence);
                    }
                }
            }
        }
    }
885839
public function getParentDirectories()
    {
        if ($this->isCurrentDirectoryBase()) {
            return [];
        }

        $currentDir = $this->currentDir;
        $dirs = [];
        do {
            $dir = dirname($currentDir);
            $dirs[] = $this->getPathRelativeToBaseDir($dir)
                ?: DIRECTORY_SEPARATOR;
            $currentDir = $dir;
        } while ($dir !== $this->baseDir);

        return array_reverse($dirs);
    }
955990
private function _buildFilesystems()
    {
        $hideMounts = $hideFstypes = $hideDisks = $ignoreFree = $ignoreUsage = $ignoreThreshold = array();
        $i = 1;
        if (defined('PSI_HIDE_MOUNTS') && is_string(PSI_HIDE_MOUNTS)) {
            if (preg_match(ARRAY_EXP, PSI_HIDE_MOUNTS)) {
                $hideMounts = eval(PSI_HIDE_MOUNTS);
            } else {
                $hideMounts = array(PSI_HIDE_MOUNTS);
            }
        }
        if (defined('PSI_HIDE_FS_TYPES') && is_string(PSI_HIDE_FS_TYPES)) {
            if (preg_match(ARRAY_EXP, PSI_HIDE_FS_TYPES)) {
                $hideFstypes = eval(PSI_HIDE_FS_TYPES);
            } else {
                $hideFstypes = array(PSI_HIDE_FS_TYPES);
            }
        }
        if (defined('PSI_HIDE_DISKS')) {
            if (is_string(PSI_HIDE_DISKS)) {
                if (preg_match(ARRAY_EXP, PSI_HIDE_DISKS)) {
                    $hideDisks = eval(PSI_HIDE_DISKS);
                } else {
                    $hideDisks = array(PSI_HIDE_DISKS);
                }
            } elseif (PSI_HIDE_DISKS === true) {
                return;
            }
        }
        if (defined('PSI_IGNORE_FREE') && is_string(PSI_IGNORE_FREE)) {
            if (preg_match(ARRAY_EXP, PSI_IGNORE_FREE)) {
                $ignoreFree = eval(PSI_IGNORE_FREE);
            } else {
                $ignoreFree = array(PSI_IGNORE_FREE);
            }
        }
        if (defined('PSI_IGNORE_USAGE') && is_string(PSI_IGNORE_USAGE)) {
            if (preg_match(ARRAY_EXP, PSI_IGNORE_USAGE)) {
                $ignoreUsage = eval(PSI_IGNORE_USAGE);
            } else {
                $ignoreUsage = array(PSI_IGNORE_USAGE);
            }
        }
        if (defined('PSI_IGNORE_THRESHOLD_FS_TYPES') && is_string(PSI_IGNORE_THRESHOLD_FS_TYPES)) {
            if (preg_match(ARRAY_EXP, PSI_IGNORE_THRESHOLD_FS_TYPES)) {
                $ignoreThreshold = eval(PSI_IGNORE_THRESHOLD_FS_TYPES);
            } else {
                $ignoreThreshold = array(PSI_IGNORE_THRESHOLD_FS_TYPES);
            }
        }
        $fs = $this->_xml->addChild('FileSystem');
        foreach ($this->_sys->getDiskDevices() as $disk) {
            if (!in_array($disk->getMountPoint(), $hideMounts, true) && !in_array($disk->getFsType(), $hideFstypes, true) && !in_array($disk->getName(), $hideDisks, true)) {
                $mount = $fs->addChild('Mount');
                if (in_array($disk->getFsType(), $ignoreThreshold, true)) {
                    $disk->setIgnore(3);
                } elseif (in_array($disk->getMountPoint(), $ignoreUsage, true)) {
                    $disk->setIgnore(2);
                } elseif (in_array($disk->getMountPoint(), $ignoreFree, true)) {
                    $disk->setIgnore(1);
                }
                $this->_fillDevice($mount, $disk, $i++);
            }
        }
    }
1062761
public function getFiles()
    {
        if (!in_array($this->getMethod(), array('POST', 'PUT', 'DELETE', 'PATCH'))) {
            return array();
        }

        $files = array();

        foreach ($this->fields->all() as $name => $field) {
            if ($field->isDisabled()) {
                continue;
            }

            if ($field instanceof Field\FileFormField) {
                $files[$name] = $field->getValue();
            }
        }

        return $files;
    }
388069
public function getNewBuilds()
    {
        $lastBuildFilename = $this->getLatestBuildName();
        $iterator          = $this->getBuilds();

        $files = array();
        /** @var $fileInfo \splFileInfo */
        foreach ($iterator as $fileInfo) {
            if ($fileInfo->getFilename() > $lastBuildFilename) {
                array_push($files, $fileInfo->getPathname());
            }
        }

        // sort builds in timely order
        sort($files);

        return $files;
    }
243040
public function files()
    {
        $files = (new Finder)->files();

        foreach ($this->ignoredFiles as $name) {
            $files->notName($name);
        }

        foreach ($this->searchedFiles as $name) {
            $files->name($name);
        }

        return $files->exclude($this->ignoredDirectories)->in($this->dir);
    }
593133
public function getFiles()
    {
        $iterator = new RecursiveDirectoryIterator(
            $this->directory,
            FilesystemIterator::SKIP_DOTS
        );
        $iterator = new RecursiveIteratorIterator($iterator);
        $iterator->rewind();

        return $iterator;
    }
1028949
private function getFileResources()
    {
        $paths = array();

        foreach ($this->directories as $directory) {
            foreach ($directory as $file) {
                $relative = $this->getRelativeName($file, $directory);

                if (!isset($paths[$relative])) {
                    $paths[$relative] = $file;
                }
            }
        }

        return array_values($paths);
    }