Esempio n. 1
0
 /**
  * @param $dir
  * @param null $fileNamePrefix
  * @param null $fileNamePostfix
  * @param integer|null $directoryPermissions Cache directory permissions in octal format, e.x.: 0666
  * @throws SpeedOut_Exception
  */
 public function __construct($dir, $fileNamePrefix = null, $fileNamePostfix = null, $directoryPermissions = null)
 {
     $this->dir = SpeedOut_Utils::getRealPath($dir);
     if (!$this->dir) {
         throw new SpeedOut_Exception('Directory "' . $dir . '" not found');
     }
     if (!SpeedOut_Utils::isPathUnderDocumentRoot($this->dir)) {
         throw new SpeedOut_Exception('Directory "' . $this->dir . '" is not under DOCUMENT_ROOT "' . SpeedOut_Utils::getDocRoot() . '"');
     }
     $this->fileNamePrefix = $fileNamePrefix;
     $this->fileNamePostfix = $fileNamePostfix;
     $this->directoryPermissions = $directoryPermissions;
 }
Esempio n. 2
0
 /**
  * @expectedException SpeedOut_Exception
  */
 public function testWrongRealPathException()
 {
     SpeedOut_Utils::getRealPath('/a/b/../../../..', false);
 }