TYPO3  7.6
SplFileInfo.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
12 namespace Symfony\Component\Finder;
13 
20 {
21  private $relativePath;
23 
31  public function __construct($file, $relativePath, $relativePathname)
32  {
33  parent::__construct($file);
34  $this->relativePath = $relativePath;
35  $this->relativePathname = $relativePathname;
36  }
37 
43  public function getRelativePath()
44  {
45  return $this->relativePath;
46  }
47 
53  public function getRelativePathname()
54  {
56  }
57 
65  public function getContents()
66  {
67  $level = error_reporting(0);
68  $content = file_get_contents($this->getPathname());
69  error_reporting($level);
70  if (false === $content) {
71  $error = error_get_last();
72  throw new \RuntimeException($error['message']);
73  }
74 
75  return $content;
76  }
77 }