Ejemplo n.º 1
0
 /**
  * Initializes this storage.
  *
  * The given umask means "which permissions to revoke", e.g. if directory permissions
  * are 0777 and umask is 0002 then the actual directory permissions are 0775.
  *
  * Tries to create the given directory in case it does not exist already.
  *
  * @param string $directory The directory to store the files in
  * @param string $fileExtension The file extension of the stored files
  * @param int $umask The umask to apply to the permissions of created directories and files
  * @throws \Ableron\Core\Exception\SystemException In case the given directory is not writable
  */
 public function __construct(string $directory, string $fileExtension = '', int $umask = 02)
 {
     parent::__construct();
     // check whether directory is writable
     PreconditionUtil::checkDirectoryIsWritable($directory, true, 0777 & ~$umask);
     // set directory, file extension and umask
     $this->directory = FileUtil::normalizePath(realpath($directory));
     $this->fileExtension = $fileExtension;
     $this->umask = $umask;
 }
Ejemplo n.º 2
0
 /**
  * @see \Ableron\Lib\Storage\AbstractStorage::__construct()
  */
 public function __construct()
 {
     parent::__construct();
     // init array storage
     $this->arrayStorage = new OrderedMap();
 }
Ejemplo n.º 3
0
 /**
  * @see \Ableron\Lib\Storage\AbstractStorage::__construct()
  */
 public function __construct(string $namespace = 'global')
 {
     parent::__construct($namespace);
     // init session
     $this->initSession();
 }