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?


Take a look at


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.