123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- namespace Symfony\Component\Finder;
- class SplFileInfo extends \SplFileInfo
- {
- private $relativePath;
- private $relativePathname;
-
- public function __construct($file, $relativePath, $relativePathname)
- {
- parent::__construct($file);
- $this->relativePath = $relativePath;
- $this->relativePathname = $relativePathname;
- }
-
- public function getRelativePath()
- {
- return $this->relativePath;
- }
-
- public function getRelativePathname()
- {
- return $this->relativePathname;
- }
-
- public function getContents()
- {
- $level = error_reporting(0);
- $content = file_get_contents($this->getPathname());
- error_reporting($level);
- if (false === $content) {
- $error = error_get_last();
- throw new \RuntimeException($error['message']);
- }
- return $content;
- }
- }
|