Get an array of possible view files from a single file name.

@param  string  $name
@return array
169114
public function getPossibleViewFiles($name)
    {
        $parts = explode(self::FALLBACK_PARTS_DELIMITER, $name);
        $templates[] = array_shift($parts);
        foreach ($parts as $i => $part) {
            $templates[] = $templates[$i].self::FALLBACK_PARTS_DELIMITER.$part;
        }
        rsort($templates);
        return $this->getPossibleViewFilesFromTemplates($templates);
    }
1275460
public function file(string $name): ?UploadedFileInterface
    {
        $array = $this->serverRequest->getUploadedFiles();

        return $array[$name] ?? Arrays::get($array, $name);
    }
131152
public function getUploadedFile($name) {
        if(!isset($_FILES[$name])) return false;

        if(is_array($_FILES[$name]['name'])) {
            $result = array();
            foreach($_FILES[$name]['name'] as $key => $name) {
                $file = new UploadedFile($name, $_FILES[$name]['tmp_name'][$key], $_FILES[$name]['size'][$key], $_FILES[$name]['type'][$key], $_FILES[$name]['error'][$key] );
                $result[] = $file;
            }
            return $result;
        }else {
            $file = new UploadedFile($_FILES[$name]['name'], $_FILES[$name]['tmp_name'], $_FILES[$name]['size'], $_FILES[$name]['type'], $_FILES[$name]['error']);
            return $file;
        }
    }
534169
private function readMetaData($name) {
        $refData = [
            'ID' => '',
            'Size' => 0,
            'Offset' => 0,
            'Extension' => '',
            'FileName' => '',
            'MimeType' => '',
            'IsPartial' => true,
            'IsFinal' => false,
            'PartialUploads' => null, // unused
        ];

        $storageFileName = $this->directory . $name . '.info';
        if (file_exists($storageFileName)) {
            $json = file_get_contents($storageFileName);
            $data = Json::decode($json, Json::TYPE_ARRAY);
            if (is_array($data)) {
                return array_merge($refData, $data);
            }
        }
        return $refData;
    }
1212017
public static function load($name) {
		if( empty($_FILES[$name]['name']) ) { /*text('load() Name not found'); */return null; }
		if( is_array($_FILES[$name]['name']) ) {
// 			text('load() Name is an array');
// 			$r	= array();
			return static::loadPath($_FILES[$name]);
// 			foreach( $_FILES[$name]['name'] as $ind => $fileName ) {
// 				if( empty($fileName) ) { continue; }
// 				static::loadPath($r, $_FILES[$name]);
// // 				$r[] = new static($fileName, $_FILES[$name]['size'][$ind], $_FILES[$name]['tmp_name'][$ind], $_FILES[$name]['error'][$ind]);
// 			}
// 			return $r;
		}
// 		text('load() Name is a single object');
		return new static($_FILES[$name]['name'], $_FILES[$name]['size'], $_FILES[$name]['tmp_name'], $_FILES[$name]['error']);
// 		return !empty($_FILES[$name]['name']) ? new static($_FILES[$name]['name'], $_FILES[$name]['size'], $_FILES[$name]['tmp_name'], $_FILES[$name]['error']) : null;
	}
401897
protected function findInPaths($name, array $paths)
    {
        foreach ($paths as $path) {
            foreach ($this->getPossibleViewFiles($name) as $fileName) {
                $viewPath = $path .DS .$fileName;

                if ($this->files->exists($viewPath)) {
                    return $viewPath;
                }
            }
        }

        throw new \InvalidArgumentException("View [$name] not found.");
    }
1113763
public function getSingleTemplate(string $name): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/gitignore/templates/:name', $name));
    }
789449
public function getHeaderLines(string $name): array {
        $key = strtolower($name);
        $result = isset($this->headers[$key]) ? $this->headers[$key] : [];
        return $result;
    }
653868
public function getLoadedFile(string $name)
    {
        $properties                     = $this->getProperties();
        $loadedFiles                    = $properties['loadedFiles'];
        $names                          = array_column($loadedFiles, 'name');
        if (in_array($name, $names)) {
            $key = array_search($name, array_column($loadedFiles, 'name'));
            return $loadedFiles[$key];
        }
        return false;
    }
878430
public function first($name)
    {
        if (isset($this->files[$name])) {
            return $this->files[$name];
        }

        foreach ($this->files as $key => $file) {
            if (strpos($key, "{$name}[") === 0) {
                return $file;
            }
        }
    }
640523
public function getHeader($name)
    {
        $headerSet = $this->getSwiftMessage()->getHeaders();
        if (!$headerSet->has($name)) {
            return [];
        }

        $headers = [];
        foreach ($headerSet->getAll($name) as $header) {
            $headers[] = $header->getValue();
        }
        return $headers;
    }
518687
public static function getFile($sName) {
		$sFile        =& static::$_lFile[$sName];
		$sFileDefault =& static::$_lFileDefault[$sName];
		return [
			'file' => $sFile,
			'file_default' => $sFileDefault,
		];
	}
244878
protected function getGroup(string $name): array
    {
        if (!$this->container->has('config_'.$name)) {
            $this->loadGroup($name);
        }

        return $this->container->get('config_'.$name);
    }
441118
public function hasFiles($name = null)
    {
        $files = $this->getFiles($name);

        if ($name === null) {
            foreach ($files as $name => $file) {
                if (empty($file)) {
                    return false;
                }
            }

            return true;
        } else {
            return !ArrayUtils::hasAllArrayValues($files);
        }
    }
333
public function getInfo($name)
    {
        $keys = explode('.', $name);
        if (is_array($keys)) {
            $file = array_shift($keys);
            $key = implode('.', $keys);
        } else {
            $file = $name;
            $key = null;
        }

        return ['file' => $file, 'key' => $key];
    }
383297
private function getViewFile($name, $extension = 'html')
    {
        return $this->viewsConfiguration->getViewsPath($this->app->getBasePath()) . DIRECTORY_SEPARATOR . $name . '.' . $extension;
    }
942315
protected function findInPaths($name, $paths)
    {
        if(preg_match('/arx/i', $name)){
            foreach ($this->getPossibleViewFiles($name) as $file)
            {
                if ($this->files->exists($viewPath = str_replace('arx/', Arx::getPath('views').'/', $file)))
                {
                    return $viewPath;
                }
            }
        }


        foreach ((array) $paths as $path)
        {
            foreach ($this->getPossibleViewFiles($name) as $file)
            {
                if ($this->files->exists($viewPath = $path.'/'.$file))
                {
                    return $viewPath;
                }
            }
        }

        # Last chance to have a file, check if is file and not in Public
        if(preg_match('/\//', $name) && is_file($name)){
            return $name;
        }

        throw new \InvalidArgumentException("View [$name] not found.");
    }