You are here

public function FileBase::path in Forena Reports 8

Same name and namespace in other branches
  1. 7.5 src/File/FileBase.php \Drupal\forena\File\FileBase::path()

Return the full path to the filename

Parameters

$filename: Name of file to determine path

Return value

string Path to file.

3 calls to FileBase::path()
FileBase::contents in src/File/FileBaseOld.php
Return the contents of a file located in the report directory
FileBase::exists in src/File/FileBaseOld.php
Return whether the file exists.
FileBase::pathinfo in src/File/FileBaseOld.php
Retrieve path info

File

src/File/FileBaseOld.php, line 272
FileSystemBase.inc File toolbox for manipulating files contained tn the report directory.

Class

FileBase

Namespace

Drupal\forena\File

Code

public function path($filename, $use_include = TRUE) {
  $path = $this->dir . '/' . $filename;
  if ($use_include && !file_exists($path)) {
    foreach ($this->includes as $dir) {
      if (file_exists($dir . '/' . $filename)) {
        $path = $dir . '/' . $filename;
      }
    }
  }
  return $path;
}