コード例 #1
0
 /**
  * Constructor.
  *
  * @param string      $savePath Path of directory to save session files.
  * @param string      $name     Session name.
  * @param MetadataBag $metaBag  MetadataBag instance.
  */
 public function __construct($savePath = null, $name = 'MOCKSESSID', MetadataBag $metaBag = null)
 {
     if (null === $savePath) {
         $savePath = sys_get_temp_dir();
     }
     if (!is_dir($savePath) && !@mkdir($savePath, 0777, true) && !is_dir($savePath)) {
         throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s"', $savePath));
     }
     $this->savePath = $savePath;
     parent::__construct($name, $metaBag);
 }
コード例 #2
0
 /**
  * Constructor.
  *
  * @param string      $savePath Path of directory to save session files.
  * @param string      $name     Session name.
  * @param MetadataBag $metaBag  MetadataBag instance.
  */
 public function __construct($savePath = null, $name = 'MOCKSESSID', MetadataBag $metaBag = null)
 {
     if (null === $savePath) {
         $savePath = sys_get_temp_dir();
     }
     if (!is_dir($savePath)) {
         mkdir($savePath, 0777, true);
     }
     $this->savePath = $savePath;
     parent::__construct($name, $metaBag);
 }
コード例 #3
0
 /**
  * Constructor.
  *
  * @param string                $savePath   Path of directory to save session files.
  * @param array                 $options    Session options.
  *
  * @see AbstractSessionStorage::__construct()
  */
 public function __construct($savePath = null, array $options = array())
 {
     if (null === $savePath) {
         $savePath = sys_get_temp_dir();
     }
     if (!is_dir($savePath)) {
         mkdir($savePath, 0777, true);
     }
     $this->savePath = $savePath;
     parent::__construct($options);
 }