@param $localname
@param $filename

@return object
172675
public function createFileHeader($localname, $filename)
    {
        return (object) array(
            'filename' => $filename,
            'stored_filename' => $localname,
            'size' => filesize($filename),
            'compressed_size' => ceil(filesize($filename)
                / self::AVERAGE_ZIP_COMPRESSION_RATIO),
            'mtime' => filemtime($filename),
            'comment' => null,
            'folder' => is_dir($filename),
            'status' => 'ok',
        );
    }
1213456
public function parseFile($filename)
    {
        libxml_use_internal_errors(true);
        $data = simplexml_load_file($filename, null, LIBXML_NOERROR);

        return (array)$this->parse($data, $filename);
    }
961320
public function open($filename)
    {
        if (!$this->exists($filename) || false === $content = file_get_contents($filename)) {
            throw new FileNotFoundException($filename);
        }

        return $this->makeFile($filename, $content);
    }
621220
public function makeLocal(string $fileName = null): LocalTemporaryFile
    {
        if (!file_exists($this->temporaryPath) && !mkdir($concurrentDirectory = $this->temporaryPath) && !is_dir($concurrentDirectory)) {
            throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
        }

        return new LocalTemporaryFile(
            $this->temporaryPath . DIRECTORY_SEPARATOR . ($fileName ?: $this->generateFilename())
        );
    }
1240715
public function parseFile($filename)
    {
        $data = @parse_ini_file($filename, true);
        return $this->parse($data, $filename);
    }
605837
public function open($filename)
    {
        $this->filename = $filename;
        return $this->zipArchive->open($filename, ZIPARCHIVE::CREATE);
    }
20289
final protected function loadAsset($fileName) {
        if (!in_array($fileName, $this->loadedAssets['update'])) {
            $this->updateAssets($fileName, true);
            $this->loadedAssets['update'][] = $fileName;
        }
        return $this;
    }
526963
public static function parser($filename)
    {
        $builder = new self($filename);
        $builder->engine = (new ParserFactory)->create(ParserFactory::PREFER_PHP7);
        // Parse
        $builder->parse();
        return $builder;
    }
301429
public static function instance($filename)
    {
        if (!\is_string($filename) && $filename) {
            throw new \InvalidArgumentException('Filename should be non-empty string');
        }
        if (!isset(static::$instances[$filename])) {
            static::$instances[$filename] = new static;
            static::$instances[$filename]->init($filename);
        }
        return static::$instances[$filename];
    }
1123726
public static function load($filename)
    {
        if (!is_readable($filename)) {
            throw new IOError($filename, 'File not found or file is not readable');
        }
        $content = @file_get_contents($filename);
        if ($content === false) {
            self::throwNativeError($filename);
        }
        return $content;
    }
276797
public static function fromFile($filename): self
    {
        if (!is_readable($filename) ||
             false === ($str = file_get_contents($filename))) {
            throw new \RuntimeException("Failed to read $filename.");
        }
        return self::fromString($str);
    }
1055100
public static function fromFile(string $filename, bool $allowGuessByExtension): MediaType
    {
        $result = 'application/octet-stream';

        if (!@is_file($filename) || !@is_readable($filename)) {
            return new self($result);
        }

        $result = self::guessFromFinfo($filename);
        if (self::isFallback($result)) {
            $result = self::guessFromFileCommand($filename);
        }

        if ($allowGuessByExtension && self::isFallback($result)) {
            $extension = pathinfo($filename, PATHINFO_EXTENSION);
            if (self::isKnownExtension($extension)) {
                return self::fromExtension($extension);
            }
        }

        $result = str_replace(['charset=binary', 'charset=us-ascii'], ['', ''], strtolower($result));
        $result = rtrim($result, '; ');

        return new self($result);
    }
174807
public static function read($fileName)
    {
        $data = parent::read($fileName);

        $json = json_decode($data, true);

        if (json_last_error()) {
            throw new \RuntimeException(json_last_error_msg());
        }

        return $json;
    }
9337
public function getFileByName($filename)
    {
        $files = $this->getFiles();
        foreach ($files as $file) {
            if ($filename == $file->file) {
                return $file;
            }
        }

        return null;
    }
1030723
public static function localDelete(string $path, string  $fileName) : bool
    {
        if (is_file($path . $fileName)) {
            unlink($path . $fileName);
        } else {
            return false;
        }
        return true;
    }
130858
public function getFile($remote, $local)
    {
        return ftp_get($this->connection, $local, $remote, $this->getTransferenceEncoding($remote));
    }
1138729
protected function loadFile($filename)
    {
        // Save this so we can modify it and still delegate to parent
        $originalFilename = $filename;

        if (isset($this->aliases[$filename])) {
            $filename = $this->aliases[$filename];
        }

        if ($this->isModular($filename)) {
            // Description is modular, this class should handle it
            return $this->loadModular($filename);
        }

        // Description isn't modular, delegate to parent with the
        // original (unmodified) value of $filename
        return parent::loadFile($originalFilename);
    }