Returns the files version with the appropriate tag.

@param  string  $file
@param  bool  $inline  (optional)
@return string
170689
public function withTag($file, $inline = false)
    {
        return Mix::$plugin->mix->withTag($file, $inline);
    }
1314733
public function realpath($file)
    {
        $prefix = preg_quote($this->_prefix, '~');
        $file = preg_replace("~^{$prefix}~", '', $file);
        if (!$this->_hasVolume) {
            return $file;
        }
        if (preg_match('~^[A-Z]+:~', $file)) {
            return $file;
        }
        $file = ltrim($file, DS);
        $pos = strpos($file, DS);
        if ($pos !== false) {
            $file = substr_replace($file, ':' . DS, $pos, 1);
        }
        return $file;
    }
1131743
public function filetype($file)
    {
        // for existing files, try to read the magic bytes
        if(file_exists($file) && is_readable($file) && filesize($file) > 5) {
            $fh = @fopen($file, 'rb');
            if(!$fh) return false;
            $magic = fread($fh, 5);
            fclose($fh);

            if(strpos($magic, "\x42\x5a") === 0) return Archive::COMPRESS_BZIP;
            if(strpos($magic, "\x1f\x8b") === 0) return Archive::COMPRESS_GZIP;
        }

        // otherwise rely on file name
        $file = strtolower($file);
        if (substr($file, -3) == '.gz' || substr($file, -4) == '.tgz') {
            return Archive::COMPRESS_GZIP;
        } elseif (substr($file, -4) == '.bz2' || substr($file, -4) == '.tbz') {
            return Archive::COMPRESS_BZIP;
        }

        return Archive::COMPRESS_NONE;
    }
376177
public function getContent($file)
    {
        $content = $file instanceof File ? $file->getString() : file_get_contents($file);

        // Yes, yes, regex'ing HTML is evil.
        // Since we don't care about well-formedness or markup here, it does the job.
        $content = preg_replace(
            [
                // Remove invisible content
                '@<head[^>]*?>.*?</head>@siu',
                '@<style[^>]*?>.*?</style>@siu',
                '@<script[^>]*?.*?</script>@siu',
                '@<object[^>]*?.*?</object>@siu',
                '@<embed[^>]*?.*?</embed>@siu',
                '@<applet[^>]*?.*?</applet>@siu',
                '@<noframes[^>]*?.*?</noframes>@siu',
                '@<noscript[^>]*?.*?</noscript>@siu',
                '@<noembed[^>]*?.*?</noembed>@siu',
                // Add line breaks before and after blocks
                '@</?((address)|(blockquote)|(center)|(del))@iu',
                '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',
                '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',
                '@</?((table)|(th)|(td)|(caption))@iu',
                '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',
                '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',
                '@</?((frameset)|(frame)|(iframe))@iu',
            ],
            [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', "$0", "$0", "$0", "$0", "$0", "$0", "$0", "$0"],
            $content
        );

        return strip_tags($content);
    }
796000
public static function read(string $file = ''): string
    {
        $result = false;
        $file = static::normalizePath($file);

        if (static::exists($file)) {
            $result = @\file_get_contents($file);
        }

        return $result;
    }
752912
function minifycss($file)
    {
        $minifiedFileName = $this->checkIfFileWasUpdated($file);
        if ($minifiedFileName) {
            $fileContent = file_get_contents(ROOTPATH . $file);
            $cssmin = new CSSmin();
            file_put_contents(ROOTPATH . $minifiedFileName, $cssmin->run($fileContent));
            return $minifiedFileName;
        }
        return $file;
    }
549526
public function getFileContent($file, $fn)
    {
        $key = $file . filemtime($file);
        return $this->get($key, function($wei, $cache) use ($file, $fn) {
            return $fn($file, $wei, $cache);
        });
    }
826203
public function getUrl($file = '')
        {

            $version = $this->manager->getVersion();
            $pattern = $this->manager->getPattern();

            /** Search Params
             *  %f => $file
             *  %v => $version
             */

            $f = str_replace('%f', $file, $pattern);
            $v = str_replace('%v', $version, $f);

            return $this->getUrlString() . $v;
        }
1272178
protected function getFileInfo($file)
    {
        $normalized = [
            'type'      => 'file',
            'path'      => $file->getName(),
            'timestamp' => substr($file->getUploadTimestamp(), 0, -3),
            'size'      => $file->getSize(),
        ];

        return $normalized;
    }
72960
public static function get(String $file, Bool $dot = false) : String
    {
        return Filesystem::getExtension($file, $dot);
    }
644719
public function file( $file = null )
	{
		if ( !is_null( $file ) )
		{
			return $this->_file = $file;
		}
		
		return $this->_file;
	}
1193006
public function findLocaleFile($file) {
		$app = $this->service->getKernel()->getApplication();
		$locale = $app->getLocalization()->getLocale();
		$repo = $this->service->getResourceRepository();

		$workDownLanguageTag = function($locale, $next) use ($repo, $file) {
			// check if the locale has more than one subtag to work down
			if (strpos($locale, '-') === false) {
				return null;
			}

			// drop the last subtag
			$locale = implode('-', array_slice(explode('-', $locale), 0, -1));
			$filename = str_replace('{locale}', $locale, $file);
			if (!$repo->contains($filename)) {
				$filename = $next($locale, $next);
			}
			return $filename;
		};

		$filename = $workDownLanguageTag($locale, $workDownLanguageTag);

		if ($filename === null) {
			$filename = str_replace('{locale}', 'en', $file);
			if (!$repo->contains($filename)) {
				$filename = null;
			}
		}

		return $filename;
	}
940255
public static function getLineNumber($file, $regex)
    {
        $i = 0;
        $lineFound = false;
        $handle = @fopen($file, 'r');
        if ($handle) {
            while (($buffer = fgets($handle, 4096)) !== false) {
                $i++;
                if (preg_match($regex, $buffer)) {
                    $lineFound = true;
                    break;
                }
            }
            fclose($handle);
        }
        return $lineFound ? $i : false;
    }
292912
private function _getExtension($file = null)
	{
		if (!is_null($file))
		{
			$dot = strrpos($file, '.') + 1;

			return strtolower(substr($file, $dot));
		}

		return '##INVALID_FILE##';
	}
933208
public final function loadFile($file) {
        $f = $this->getPath($file);
        if (is_file($f) && is_readable($f)) {
            return @file_get_contents($f);
        }

        return false;
    }
1082172
public function version($file)
    {
        try {
            $manifest = $this->readManifestFile();
        } catch (\Exception $e) {
            return $this->buildPath . '/' . $file;
        }

        // if no manifest, return the regular asset
        if (!$manifest) {
            return $this->buildPath . '/' . $file;
        }

        // If asset isn't in the manifest, return file name
        if (array_key_exists($file, $manifest)) {
            return '/' . $this->buildPath . '/' . $manifest[$file];
        }

        return '/' . $this->buildPath . '/' . $file;
    }
539053
private function get_po_revision( $file ) {
		$file        = $this->language_files_dir . '/' . $file;
		$headers     = array( 'PO-Revision-Date' => '"PO-Revision-Date' );
		$all_headers = array();

		$fp = fopen( $file, 'r' );

		// Pull only the first 1kiB of the file in.
		$contents = fread( $fp, 1024 );

		fclose( $fp );

		foreach ( $headers as $field => $regex ) {
			if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $contents, $match ) && $match[1] ) {
				$value                 = $this->_cleanup_header_comment( $match[1] );
				$value                 = preg_replace( '~(\\\n)?"$~', '', $value );
				$all_headers[ $field ] = $value;
			} else {
				$all_headers[ $field ] = '';
			}
		}

		return $all_headers['PO-Revision-Date'];
	}