Callback function for session handler. It's invoked while the session is being opened.

@param $savePath The path to store the session.
@param $sessionName The name of the session.

@return boolean If the open operation success.
429264
public function open($savePath, $sessionName) {
        try {
            // get table to see if the table exists.
            $this->_tableRestProxy->getTable($this->_sessionContainer);
        } catch (ServiceException $e) {
            // cannot get the table, so create it
            $this->_tableRestProxy->createTable($this->_sessionContainer);
        }
        return TRUE;
    }
1168001
protected function parseConnectionsFromSavePath($savePath)
    {
        $connections = (array) explode(',', $savePath);
        $connections = array_map('trim', $connections);

        return array_map([$this, 'parseConnectionItemFromSavePath'], $connections);
    }
703570
public function open($savePath, $sessionName): bool
    {
        parent::open($savePath, $sessionName);

        $this->handler = new \Redis();

        if ($this->settings['persistence']) {
            $this->handler->pconnect($this->settings['host'], $this->settings['port'], $this->settings['timeout']);
        } else {
            $this->handler->connect($this->settings['host'], $this->settings['port'], $this->settings['timeout']);
        }

        if (isset($this->settings['options'])) {
            foreach ($this->settings['options'] as $key => $value) {
                $this->handler->setOption($key, $value);
            }
        }

        return true;
    }
181152
public function setSavePath($savePath)
    {
        if (empty($savePath)) return $this;

        $this->savePath = $savePath;

        if (!is_dir($this->savePath)) {
            mkdir($this->savePath);
        }

        return $this;
    }
1193551
public function open($save_path, $session_name)
    {
        $this->key = $this->getKey('KEY_' . $session_name);
        return parent::open($save_path, $session_name);
    }
42094
public function setSaveHandler($saveHandler = null)
    {
        $this->setOriginalSaveHandler($saveHandler);
        if (!$saveHandler instanceof AbstractProxy &&
            !$saveHandler instanceof NativeSessionHandler &&
            !$saveHandler instanceof \SessionHandlerInterface &&
            null !== $saveHandler) {
            throw new \InvalidArgumentException('Must be instance of AbstractProxy or NativeSessionHandler; implement \SessionHandlerInterface; or be null.');
        }

        // Wrap $saveHandler in proxy and prevent double wrapping of proxy
        if (!$saveHandler instanceof AbstractProxy && $saveHandler instanceof \SessionHandlerInterface) {
            $saveHandler = new SessionHandlerProxy($saveHandler);
        } elseif (!$saveHandler instanceof AbstractProxy) {
            $saveHandler = version_compare(phpversion(), '5.4.0', '>=') ?
                new SessionHandlerProxy(new \SessionHandler()) : new NativeProxy();
        }
        $this->saveHandler = $saveHandler;

        if ($this->saveHandler instanceof \SessionHandlerInterface) {
            if (version_compare(phpversion(), '5.4.0', '>=')) {
                session_set_save_handler($this->saveHandler, false);
            } else {
                session_set_save_handler(
                    array($this->saveHandler, 'open'),
                    array($this->saveHandler, 'close'),
                    array($this->saveHandler, 'read'),
                    array($this->saveHandler, 'write'),
                    array($this->saveHandler, 'destroy'),
                    array($this->saveHandler, 'gc')
                );
            }
        }
    }
377026
private function handleSessionConfig()
	{
		$cookiePath = __BASE;

		if ($this->component !== false && !$this->component->usesRootCookiePath()) {
			$cookiePath .= $this->component->getPath();
		}

		session_set_cookie_params(0, $cookiePath);

		if ($this->settings->getSetting("sessionsavepath") !== false) {
			session_save_path(__BASE_ROOT . $this->settings->getSetting("sessionsavepath"));
		}
	}
894591
public function handle($path, $localFilePath, array $config = [])
    {
        if (! method_exists($this->filesystem, 'getAdapter')) {
            return false;
        }

        if (! method_exists($this->filesystem->getAdapter(), 'putFile')) {
            return false;
        }

        $config = new Config($config);
        if (method_exists($this->filesystem, 'getConfig')) {
            $config->setFallback($this->filesystem->getConfig());
        }

        return (bool) $this->filesystem->getAdapter()->putFile($path, $localFilePath, $config);
    }
658501
public function downloadHeadImage($url, $savePath) {
        $client = $this->getHttpClient();
        $client->setUrl($url);
        if (!$client->exec()) {
            throw new Exception("call download QRImage fail");
        }

        return $this->getFileSystem()->put($savePath, $client->getResponse()) > 0;
    }
476839
public function open(string $savePath, string $name)
    {
        if (!is_dir($savePath)) {
            mkdir($savePath, 0777);
        }
        $this->savePath = $savePath;
        $this->sessionName = $name;
        return true;
    }
598187
public function open($save_path, $session_id)
    {
        $stmt = $this->db->prepare("INSERT INTO ". $this->tableName  . " SET session_id = :id, session_data = '' ON DUPLICATE KEY UPDATE session_lastaccesstime = NOW()");
        if ($stmt->execute(['id' => $session_id])) {
            return true;
        }
        return false;
    }
1274078
public function open($sessionPath, $sessionName){        
        //si la sesión no está abierta tengo que abrir conexión a base de datos
        if(!$this->opened){
            $this->connection= new DataBaseAR(FALSE);
            $this->connection->connect($this->dataBase);
            $this->opened= TRUE;
            return TRUE;
        }
        else{
            return TRUE;
        }
    }
964299
public function savePath($path = null)
    {
        if ($path === null) {
            return session_save_path();
        }
        if ($this->isOpen) {
            throw new \InvalidArgumentException('The session has already been opened.');
        }
        if (!is_string($path)) {
            throw new \InvalidArgumentException('Session path must be null or a string');
        }
        if (!is_dir($path)) {
            throw new \InvalidArgumentException("Path not found: {$path}");
        }
        session_save_path($path);
    }
1158228
public function open($save_path, $name)
	{
		$this->engine = new \Memcached;

		// For each server in the array, we'll just extract the configuration and add
		// the server to the Memcached connection. Once we have added all of these
		// servers we'll verify the connection is successful and return it back.
		foreach ($this->servers as $server)
		{
			$this->engine->addServer(
				$server['host'], $server['port'], $server['weight']
			);
		}

		return true;
	}
975997
public function open($savePath, $sessName) {
        // 检测php环境
        if (!extension_loaded('memcache')) {
            throw new Exception('not support:memcache');
        }
        $this->handler = new \Memcache;
        // 支持集群
        $hosts = explode(',', $this->config['host']);
        $ports = explode(',', $this->config['port']);
        if (empty($ports[0])) {
            $ports[0] = 11211;
        }
        // 建立连接
        foreach ((array)$hosts as $i => $host) {
            $port = isset($ports[$i]) ? $ports[$i] : $ports[0];
            $this->config['timeout'] > 0 ?
                $this->handler->addServer($host, $port, $this->config['persistent'], 1, $this->config['timeout']) :
                $this->handler->addServer($host, $port, $this->config['persistent'], 1);
        }
        return true;
    }
1302981
public static function setSaveHandler(Zend_Session_SaveHandler_Interface $saveHandler)
    {
        self::$_saveHandler = $saveHandler;

        if (self::$_unitTestEnabled) {
            return;
        }

        session_set_save_handler(
            array(&$saveHandler, 'open'),
            array(&$saveHandler, 'close'),
            array(&$saveHandler, 'read'),
            array(&$saveHandler, 'write'),
            array(&$saveHandler, 'destroy'),
            array(&$saveHandler, 'gc')
            );
    }
855356
public function upload($savePath = null)
    {
        is_null($savePath) && $savePath = $this->config['savePath'];
        $savePath = $savePath.'/';
        $fileInfo = [];
        $isUpload = false;

        //获取上传的文件信息
        $files = $this->workingFiles($_FILES);
        foreach ($files as $key => $file) {
            //过滤无效的选框
            if (!empty($file['name'])) {
                //登记上传文件的扩展信息
                !isset($file['key']) && $file['key'] = $key;
                $pathinfo = pathinfo($file['name']);
                $file['extension'] = $pathinfo['extension'];
                $file['savepath'] = $savePath;
                $saveName = $this->getSaveName($savePath, $file);
                $file['savename'] = $saveName;//取得文件名

                //创建目录
                if (is_dir($file['savepath'])) {
                    if (!is_writable($file['savepath'])) {
                        $this->errorInfo = "上传目录{$savePath}不可写";
                        return false;
                    }
                } else {
                    if (!mkdir($file['savepath'], 0700, true)) {
                        $this->errorInfo = "上传目录{$savePath}不可写";
                        return false;
                    }
                }
                //自动查检附件
                if (!$this->secureCheck($file)) return false;
                //保存上传文件
                if (!$this->save($file)) return false;
                unset($file['tmp_name'], $file['error']);
                $fileInfo[] = $file;
                $isUpload = true;
            }
        }
        if ($isUpload) {
            $this->successInfo = $fileInfo;
            return true;
        } else {
            $this->errorInfo = '没有选择上传文件';
            return false;
        }
    }