打开Session
@access public
@param string $savePath
@param mixed $sessName
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;
    }
1182309
public function save($savepath) {
		$result = move_uploaded_file($this->stored_filename, $savepath);
		if ($result === true) {
			$this->stored_filename = $savepath;
			return true;
		} else {
			return false;
		}
	}
409623
public function open ($save_path, $session_name) {
		//==============================================
		//ディレクトリ
		//==============================================
		//ディレクトリ存在確認
		if (!file_exists($save_path)) {
			if (!mkdir($save_path, 0700, true)) {
				throw CoreException::RaiseSystemError('セッションセーブディレクトリがありません。dir:%s', [$save_path]);
			}
		}

		//対象確認
		if (!is_dir($save_path)) {
			throw CoreException::RaiseSystemError('セッションセーブディレクトリがファイルです。dir:%s', [$save_path]);
		}

		//書き込み権確認
		if (!is_writable($save_path)) {
			throw CoreException::RaiseSystemError('セッションセーブディレクトリに書き込めません。dir:%s', [$save_path]);
		}

		//読み込み権確認
		if (!is_readable($save_path)) {
			throw CoreException::RaiseSystemError('セッションセーブディレクトリから読み込みできません。dir:%s', [$save_path]);
		}

		//==============================================
		//ファイル：セッションフィクセーション対策
		//==============================================
		if (($session_id = session_id()) !== '') {
			//不正な文字列がないか検証
			if (strpos($session_id, '.') !== false || strpos($session_id, '/') !== false || strpos($session_id, "\\") !== false) {
				throw CoreException::RaiseSystemError('セッションIDに不正な文字列が存在します。session_id:%s', [$session_id]);
			}

			//セッションファイルパスの作成
			$session_file_path = sprintf('%s/%s%s', str_replace("\\", '/', $save_path), static::FILE_NAME_PREFIX, $session_id);

			//ファイル存在確認
			if (!file_exists($session_file_path)) {
				Session::DeleteSessionCookie();
				throw CoreException::RaiseSystemError('セッションファイルがありません。セッションフィクセーションの疑いがあります。file:%s', [$session_file_path]);
			}

			//対象確認
			if (!is_file($session_file_path)) {
				throw CoreException::RaiseSystemError('セッションファイルがファイルではありません。file:%s', [$session_file_path]);
			}

			//書き込み権確認
			if (!is_writable($session_file_path)) {
				throw CoreException::RaiseSystemError('セッションファイルに書き込めません。file:%s', [$session_file_path]);
			}

			//読み込み権確認
			if (!is_readable($session_file_path)) {
				throw CoreException::RaiseSystemError('セッションファイルから読み込みできません。file:%s', [$session_file_path]);
			}
		}

		//==============================================
		//セッション開始
		//==============================================
		return parent::open($save_path, $session_name);
	}
920055
public function delete($itemName, $photoSavePath = '', $saveName = '')
    {
        $this->protocol();

        $url = Config::get('url.cet_apply');

        $param['__EVENTTARGET'] = $itemName;
        $param['__EVENTARGUMENT'] = "";
        $param['__VIEWSTATE'] = true;
        $param['txtxxmc'] = "";
        $param["txtSFZH"] = "";
        $param["TextBox1"] = "";

        $response = $this->request('upload', [$url, $param]);

        return $this->parseCet($response, $photoSavePath, $saveName);
    }
321206
function loadFromSession($name = '') {
		if(!$name) $name = $this->owner->FormName();

		$formSession = \Session::get("FormInfo.{$name}.data");
		if($formSession) $this->owner->loadDataFrom($formSession);
	}
576174
public function save($filePath = null) {
		
		// Determine the correct file path.
		$filePath = ($filePath == null) ? $this->configFilePath : $filePath;
		
		// Store the file
		file_put_contents ( $filePath, $this->getConfigFileText () );
	}
1088858
public void createSession(String sessionId) {
        boolean newSession = sessionId == null;
        sessionId = newSession ? newSessionId() : sessionId;
        SessionController controller = sessions.get(sessionId);
        
        if (controller == null) {
            controller = SessionController.create(sessionId, newSession);
            sessions.put(sessionId, controller);
        }
    }
90356
static function start( $sessid = null ) {
		// switch to named session
		$oldname = session_name( PLUG_SESSION_NAME );
		// session could have been started already
		if( session_id() ){
			if( $oldname === PLUG_SESSION_NAME ){
				trigger_error( "Session '$oldname' already started", E_USER_NOTICE );
			}
			// or another system could have started a session under a different name
			else if( ! session_destroy() ){
				trigger_error( "Failed to destroy session '$oldname'", E_USER_WARNING );
				return false;
			}
			// force session id if passed
			if( $sessid ){
				session_id( $sessid );
			}
			if( ! session_start() ){
				trigger_error( "Failed to start session after destroying previous session '$oldname'", E_USER_WARNING );
				return false;
			}
		}
		// else ok to start session for the first time
		// when session starts __wakeup will be called if resuming
		else {
			// force session id if passed
			if( $sessid ){
				session_id( $sessid );
			}
			if( ! session_start() ){
				trigger_error( 'Failed to start session', E_USER_WARNING );
				return false;
			}
		}
		// create new instance of self if new session
		if( ! isset(self::$Session) ){
			new PLUGSession();
		}
		// manually check timeout now that session is intilaized
		// Session must expire now regardless of cookie lifetime.
		else if( PLUG_SESSION_TIMEOUT && self::$Session->t_idle >= (PLUG_SESSION_TIMEOUT * 60) ){
			$id = session_id();
			self::destroy();
			self::$Session->expired_id = $id;
		}
		// else session resumed
		else {
			self::header('resume-after-'.self::$Session->t_idle.'-seconds');
		}
		return true;
	}
499897
public function uploadeMedia($sSourcePath, $sDestPath, $blCreateThumbs = false)
    {
        $this->createDirs();

        $sThumbName = '';
        $sFileName = basename($sDestPath);
        $iFileCount = 0;

        while (file_exists($sDestPath)) {
            $aFileParts = explode('.', $sFileName);
            $aFileParts = array_reverse($aFileParts);

            $sFileExt = $aFileParts[0];
            unset($aFileParts[0]);

            $sBaseName = implode('.', array_reverse($aFileParts));

            $aBaseParts = explode('_', $sBaseName);
            $aBaseParts = array_reverse($aBaseParts);

            if (strlen($aBaseParts[0]) == 1 && is_numeric($aBaseParts[0])) {
                $iFileCount = (int) $aBaseParts[0];
                unset($aBaseParts[0]);
            }

            $sBaseName = implode('_', array_reverse($aBaseParts));

            $sFileName = $sBaseName . '_' . (++$iFileCount) . '.' . $sFileExt;
            $sDestPath = dirname( $sDestPath ) . '/' . $sFileName;
        }

        move_uploaded_file($sSourcePath, $sDestPath);

        if ($blCreateThumbs) {
            try {
                $sThumbName = $this->createThumbnail($sFileName);

                $this->createMoreThumbnails($sFileName);
            } catch ( \Exception $e) {
                $sThumbName = '';
            }
        }

        return array(
            'filepath'  => $sDestPath,
            'filename'  => $sFileName,
            'thumbnail' => $sThumbName
        );
    }
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;
        }
    }
1164771
public function open($save_path, $name)
    {
        foreach ($this->getHandlers() as $handler) {
            $handler->open($save_path, $name);
        }

        return true;
    }
449972
protected function _setupTableName()
    {
        if (empty($this->_name) && basename(($this->_name = session_save_path())) != $this->_name) {
            /**
             * @see Zend_Session_SaveHandler_Exception
             */
            // require_once 'Zend/Session/SaveHandler/Exception.php';

            throw new Zend_Session_SaveHandler_Exception('session.save_path is a path and not a table name.');
        }

        if (strpos($this->_name, '.')) {
            list($this->_schema, $this->_name) = explode('.', $this->_name);
        }
    }
582539
public function open($save_path, $session_name)
    {
        $this->session_name = $session_name;
        
        if (!headers_sent() && !ini_get('session.cache_limiter') && '0' !== ini_get('session.cache_limiter')){
            header(sprintf('Cache-Control: max-age=%d, private, must-revalidate', 60 * (int) ini_get('session.cache_expire')));
        }
        
        return true;
    }
714947
public function open($savePath, $sessionName): bool
    {
        $this->dbClass = MySQLCLass::getInstance();
        $this->dbTable = 'session_table';
        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);
    }
1015606
public function create( $path = '' )
    {
        $this->sessionPath = $path;

        if ( file_exists( $path ) )
        {
            $this->getFileContents();
        }
        else
        {
            $this->items = [ ];
        }
    }
308388
public function setSavePath($savePath)
    {
        if (!is_dir($savePath)) {
            throw VCardException::outputDirectoryNotExists();
        }

        // Add trailing directory separator the save path
        if (substr($savePath, -1) != DIRECTORY_SEPARATOR) {
            $savePath .= DIRECTORY_SEPARATOR;
        }

        $this->savePath = $savePath;
    }