Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FileResolver.php
Go to the documentation of this file.
1 <?php
7 
12 {
19  public function getFile($class)
20  {
22  return stream_resolve_include_path($relativePath);
23  }
24 
31  public function getFilePath($class)
32  {
33  return ltrim(str_replace(['_', '\\'], '/', $class), '/') . '.php';
34  }
35 
43  public static function addIncludePath($path, $prepend = true)
44  {
45  $includePathExtra = implode(PATH_SEPARATOR, (array)$path);
46  $includePath = get_include_path();
47  $pathSeparator = $includePath && $includePathExtra ? PATH_SEPARATOR : '';
48  if ($prepend) {
49  $includePath = $includePathExtra . $pathSeparator . $includePath;
50  } else {
51  $includePath = $includePath . $pathSeparator . $includePathExtra;
52  }
53  set_include_path($includePath);
54  }
55 }
$_option $_optionId $class
Definition: date.phtml:13
$relativePath
Definition: get.php:35
static addIncludePath($path, $prepend=true)