function Extension::getFileInfo

Same name in other branches
  1. 10 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::getFileInfo()

Returns SplFileInfo instance for the extension's info file.

Return value

\SplFileInfo The object to access a file information of info file.

See also

https://www.php.net/manual/class.splfileinfo.php

File

core/lib/Drupal/Core/Extension/Extension.php, line 167

Class

Extension
Defines an extension (file) object.

Namespace

Drupal\Core\Extension

Code

public function getFileInfo() : \SplFileInfo {
    if (!isset($this->splFileInfo)) {
        $this->splFileInfo = new \SplFileInfo($this->root . '/' . $this->pathname);
    }
    return $this->splFileInfo;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.