src/helpers/Manifest.php
protected static function getFileFromUri(string $path, callable $callback = null, bool $pathOnly = false)
    {
        // Resolve any aliases
        $alias = Craft::getAlias($path, false);
        if ($alias) {
            $path = $alias;
        }
        // If we only want the file via path, make sure it exists
        if ($pathOnly && !is_file($path)) {
            Craft::warning(Craft::t(
                'twigpack',
                'File does not exist: {path}',
                ['path' => $path]
            ), __METHOD__);

            return '';
        }
        // Make sure it's a full URL
        if (!UrlHelper::isAbsoluteUrl($path) && !is_file($path)) {
            try {
                $path = UrlHelper::siteUrl($path);
            } catch (Exception $e) {
                Craft::error($e->getMessage(), __METHOD__);
            }
        }

        return self::getFileContents($path, $callback);
    }
protected static function getFileFromUri(string $path, callable $callback = null, bool $pathOnly = false)
    {
        // Resolve any aliases
        $alias = Craft::getAlias($path, false);
        if ($alias) {
            $path = $alias;
        }
        // If we only want the file via path, make sure it exists
        if ($pathOnly && !is_file($path)) {
            Craft::warning(Craft::t(
                'twigpack',
                'File does not exist: {path}',
                ['path' => $path]
            ), __METHOD__);

            return '';
        }
        // Make sure it's a full URL
        if (!UrlHelper::isAbsoluteUrl($path) && !is_file($path)) {
            try {
                $path = UrlHelper::siteUrl($path);
            } catch (Exception $e) {
                Craft::error($e->getMessage(), __METHOD__);
            }
        }

        return self::getFileContents($path, $callback);
    }
protected static function getFileFromUri ( string $ path , callable $ callback = null , bool $ pathOnly = false ) { // Resolve any aliases $ alias = Craft :: getAlias ( $ path , false ) ; if ( $ alias ) { $ path = $ alias ; } // If we only want the file via path, make sure it exists if ( $ pathOnly && ! is_file ( $ path ) ) { Craft :: warning ( Craft :: t ( 'twigpack' , 'File does not exist: {path}' , [ 'path' => $ path ] ) , __METHOD__ ) ; return '' ; } // Make sure it's a full URL if ( ! UrlHelper :: isAbsoluteUrl ( $ path ) && ! is_file ( $ path ) ) { try { $ path = UrlHelper :: siteUrl ( $ path ) ; } catch ( Exception $ e ) { Craft :: error ( $ e -> getMessage ( ) , __METHOD__ ) ; } } return self :: getFileContents ( $ path , $ callback ) ; }
Return the contents of a file from a URI path

@param string        $path
@param callable|null $callback
@param bool          $pathOnly

@return null|mixed
Return the contents of a file from a URI path