@param string|null $file

@return string
335431
public function dump(string $file = null):string{
		$file    = $file ?? $this->options->cachefile;
		$imagick = new Imagick;

		$imagick->newImage(
			$this->length,
			$this->length,
			new ImagickPixel($this->options->imagickBG ?? 'transparent'),
			$this->options->imagickFormat
		);

		$imageData = $this->drawImage($imagick);

		if($file !== null){
			$this->saveToFile($imageData, $file);
		}

		return $imageData;
	}
1069890
public function parse($file)
    {
        $result = null;
        $this->hook->attach('help.render.before', $file, $result, $this);

        if (isset($result)) {
            return (string) $result;
        }

        $result = $this->markdown->render(file_get_contents($file));
        $this->hook->attach('help.render.after', $file, $result, $this);
        return (string) $result;
    }
933462
public static function pathInfo($file)
    {
        $result = self::_pathInfo($file);
        return self::i()->dump($result, '! pathInfo (' . $file . ') !');
    }
826998
public function get($file)
    {
        $result = null;
        $this->hook->attach('help.get.before', $file, $result, $this);

        if (isset($result)) {
            return (array) $result;
        }

        $result = $this->getMeta($file);

        if (empty($result)) {
            return array();
        }

        $hash = gplcart_string_encode(gplcart_path_relative($file));

        $result += array(
            'file' => $file,
            'path' => "admin/help/$hash"
        );

        $this->hook->attach('help.get.after', $file, $result, $this);
        return (array) $result;
    }
61950
private function storage($file = null)
    {
        $folder = static::STORAGE_DIR;
        $path   = __DIR__ . "/../../../$folder";

        if (!file_exists($path)) {
            mkdir($path);
            $this->initDefaultData(realpath($path));
        }

        if (!file_exists("$path/.gitignore")) {
            file_put_contents("$path/.gitignore", '*');
        }

        return $file ? "$path/$file" : "$path";
    }
942565
public function preparePath(string $file): string
    {
        if (0 === strncmp($file, '$', 1)) {
            return $file;
        }

        $skippable = 0 === strncmp($file, '?', 1) ? '?' : '';
        if ($skippable) {
            $file = substr($file, 1);
        }

        if (!$this->getFilesystem()->isAbsolutePath($file)) {
            $prefix = $this->isRoot()
                ? $this->getBaseDir()
                : $this->getVendorDir() . '/' . $this->getPrettyName();
            $file = $prefix . '/' . $file;
        }

        return $skippable . $this->getFilesystem()->normalizePath($file);
    }
938879
public final function getRelativePath($file = null) {
        return $file ? MODULE_DIR . DS . $this->dirname . DS . ($file ? $file : '') : $this->path . DS;
    }
368359
public static function readFile(string $file): string
    {
        $contents = @\file_get_contents($file);
        
        if ($contents === false) {
            throw new \RuntimeException(\sprintf('File not found: "%s"', $file));
        }
        
        return $contents;
    }
368753
static function read($file)
	{
		if(file_exists($file) && is_readable($file))
			return file_get_contents($file);

		foreach(bors_dirs() as $dir)
			if(file_exists($fn = $dir.'/data/'.$file) && is_readable($fn))
				return file_get_contents($fn);

		return NULL;
	}
845923
public function getCommitMessage($file = null)
    {
        if ($file) {
            $hash = null;
            $message = file_get_contents($file);
        } else {
            list($hash, $message) = explode(PHP_EOL, $this->getLastCommitMessage(), 2);
        }

        return new CommitMessage($message, $hash);
    }
301155
public function getText($file, $callback = null)
    {
        if(!is_null($callback))
        {
            $this->setCallback($callback);
        }

        return $this->request('text', $file);
    }
229445
protected function getFileContents($file)
    {
        if ($file instanceof ModuleResource) {
            $path = $file->getPath();
        } else {
            $path = Director::baseFolder() . '/' . $file;
        }
        if (!file_exists($path)) {
            return null;
        }
        $content = file_get_contents($path);

        // Remove UTF-8 BOM
        if (substr($content, 0, 3) === pack("CCC", 0xef, 0xbb, 0xbf)) {
            $content = substr($content, 3);
        }

        return $content;
    }
547642
protected function prepareSeedClass($file)
    {
        $extension = $file->getExtension();
        if ($extension !== 'php') {
            return null;
        }
        return '\\' . str_replace('.' . $extension, '', $file->getFilename());
    }
357428
public function shortPath($file)
    {
        $shortPath = str_replace(ROOT, null, $file);
        $shortPath = str_replace('..' . DIRECTORY_SEPARATOR, '', $shortPath);
        $shortPath = str_replace(DIRECTORY_SEPARATOR, '/', $shortPath);

        return str_replace('//', DIRECTORY_SEPARATOR, $shortPath);
    }
770203
public function resolve($file)
    {
        $info = null;

        $this->rewind();
        foreach (clone $this as $path) {
            $info = new SplFileInfo(rtrim($path, '/') . '/' . ltrim($file, '/'));

            if ($info->isDir() || $info->isFile() || $info->isLink()) {
                break;
            }
        }

        return ($info)? $info->getPathname() : null;
    }
227515
public static function getMimeTypeByFile(string $file)
    {
        if (!\is_file($file) || !\class_exists('\finfo', false)) {
            return null;
        }

        try {
            $finfo = new \finfo(FILEINFO_MIME_TYPE);

            return $finfo->file($file) ?: null;
            // @codeCoverageIgnoreStart
        } catch (\ErrorException $e) {
            // This is caused by an array to string conversion error.
            return null;
        }
    }
88180
public static function for_file($file)
    {
        if (!$file || (is_string($file) && !file_exists($file))) {
            return null;
        }

        // Ensure we have a File instance to work with
        if (is_string($file)) {
            /** @var File $fileObject */
            $fileObject = File::create();
            $fileObject->setFromLocalFile($file);
            $file = $fileObject;
        }

        $extension = $file->getExtension();
        $mime = $file->getMimeType();

        foreach (self::get_extractor_classes() as $className) {
            $extractor = self::get_extractor($className);

            // Skip unavailable extractors
            if (!$extractor->isAvailable()) {
                continue;
            }

            // Check extension
            if ($extension && $extractor->supportsExtension($extension)) {
                return $extractor;
            }

            // Check mime
            if ($mime && $extractor->supportsMime($mime)) {
                return $extractor;
            }
        }
    }