0

I can write a function easily enough to file_get_contents('pub/static/deployed_version.txt'), but I'm curious, is there an M2 class that provides this behavior already?

1

Take a look at

Magento\Framework\App\View\Deployment\Version\Storage\File

public function __construct(
    \Magento\Framework\App\View\Deployment\Version\Storage\File $versionSystem,
    ...
) {
    $this->versionSystem = $versionSystem;
}

$content = $this->versionSystem->load();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.