M1\Vars\Resource\FileResource::__construct PHP Method

__construct() public method

The file resource constructor to get and parse the content from files
public __construct ( ResourceProvider $provider, string $file )
$provider ResourceProvider The parent ResourceProvider
$file string The passed file
    public function __construct(ResourceProvider $provider, $file)
    {
        $this->provider = $provider;
        $this->vars = $provider->vars;
        $this->variables = $this->vars->variables;
        $this->makePaths($file);
        $this->validate();
        $store_prefix = $this->variables->vstore->getPrefix();
        $content = $this->loadContent($this->file);
        $this->raw_content = $content;
        if ($content) {
            $this->content = $this->searchForResources($content, $store_prefix);
        }
    }