|
|
@ -82,21 +82,23 @@ abstract class AbstractPersistence
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
protected static function _initialize()
|
|
|
|
protected static function _initialize()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Create storage directory if it does not exist.
|
|
|
|
if (property_exists($data->meta, 'webserver') && $data->meta->webserver && $this->_conf->getKey('webserver') == "Apache") {
|
|
|
|
if (!is_dir(self::$_path)) {
|
|
|
|
// Create storage directory if it does not exist.
|
|
|
|
if (!@mkdir(self::$_path, 0700)) {
|
|
|
|
if (!is_dir(self::$_path)) {
|
|
|
|
throw new Exception('unable to create directory ' . self::$_path, 10);
|
|
|
|
if (!@mkdir(self::$_path, 0700)) {
|
|
|
|
|
|
|
|
throw new Exception('unable to create directory ' . self::$_path, 10);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$file = self::$_path . DIRECTORY_SEPARATOR . '.htaccess';
|
|
|
|
$file = self::$_path . DIRECTORY_SEPARATOR . '.htaccess';
|
|
|
|
if (!is_file($file)) {
|
|
|
|
if (!is_file($file)) {
|
|
|
|
$writtenBytes = @file_put_contents(
|
|
|
|
$writtenBytes = @file_put_contents(
|
|
|
|
$file,
|
|
|
|
$file,
|
|
|
|
'Require all denied' . PHP_EOL,
|
|
|
|
'Require all denied' . PHP_EOL,
|
|
|
|
LOCK_EX
|
|
|
|
LOCK_EX
|
|
|
|
);
|
|
|
|
);
|
|
|
|
if ($writtenBytes === false || $writtenBytes < 19) {
|
|
|
|
if ($writtenBytes === false || $writtenBytes < 19) {
|
|
|
|
throw new Exception('unable to write to file ' . $file, 11);
|
|
|
|
throw new Exception('unable to write to file ' . $file, 11);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|