The SessionIdInterface interface of PHP is introduced in PHP 5.5.1, which contains one abstract public method create_sid().
SessionIdInterface::create_sid() is called to create a new session ID when necessary, for example, when session_regenerate_id() is invoked.
PHPStorm recognize SessionIdInterface as an undefined class. This is a bug of PhpStorm.
To avoid warning of PhpStorm, you can simply omit SessionIdInterface after the implements keyword.
- <?php
- class SessionXHandler implements SessionHandlerInterface, SessionIdInterface, SessionUpdateTimestampHandlerInterface{
- /**
- * @return bool
- */
- public function close(){
- // TODO: Implement close() method.
- }
- /**
- * @param string $session_id
- * @return bool
- */
- public function destroy($session_id){
- // TODO: Implement destroy() method.
- }
- /**
- * @param int $maxlifetime
- * @return bool
- */
- public function gc($maxlifetime){
- // TODO: Implement gc() method.
- }
- /**
- * @param string $save_path
- * @param string $name
- * @return bool
- */
- public function open($save_path, $name){
- // TODO: Implement open() method.
- }
- /**
- * @param string $session_id
- * @return string
- */
- public function read($session_id){
- // TODO: Implement read() method.
- }
- /**
- * @param string $session_id
- * @param string $session_data
- * @return bool
- */
- public function write($session_id, $session_data){
- // TODO: Implement write() method.
- }
- /**
- * @return string
- */
- public function create_sid(){
- // TODO: Implement create_sid() method.
- }
- /**
- * @param string $session_id
- * @return bool
- */
- public function validateId($session_id){
- // TODO: Implement validateId() method.
- }
- /**
- * @param string $session_id
- * @param string $session_data
- * @return bool
- */
- public function updateTimestamp($session_id, $session_data){
- // TODO: Implement updateTimestamp() method.
- }
- }
复制代码- <?php
- class SessionXHandler implements SessionHandlerInterface, SessionUpdateTimestampHandlerInterface{
- /**
- * @return bool
- */
- public function close(){
- // TODO: Implement close() method.
- }
- /**
- * @param string $session_id
- * @return bool
- */
- public function destroy($session_id){
- // TODO: Implement destroy() method.
- }
- /**
- * @param int $maxlifetime
- * @return bool
- */
- public function gc($maxlifetime){
- // TODO: Implement gc() method.
- }
- /**
- * @param string $save_path
- * @param string $name
- * @return bool
- */
- public function open($save_path, $name){
- // TODO: Implement open() method.
- }
- /**
- * @param string $session_id
- * @return string
- */
- public function read($session_id){
- // TODO: Implement read() method.
- }
- /**
- * @param string $session_id
- * @param string $session_data
- * @return bool
- */
- public function write($session_id, $session_data){
- // TODO: Implement write() method.
- }
- /**
- * @return string
- */
- public function create_sid(){
- // TODO: Implement create_sid() method.
- }
- /**
- * @param string $session_id
- * @return bool
- */
- public function validateId($session_id){
- // TODO: Implement validateId() method.
- }
- /**
- * @param string $session_id
- * @param string $session_data
- * @return bool
- */
- public function updateTimestamp($session_id, $session_data){
- // TODO: Implement updateTimestamp() method.
- }
- }
复制代码 |
|