Session.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\facade;
  12. use think\Facade;
  13. /**
  14. * @see \think\Session
  15. * @mixin \think\Session
  16. * @method void init(array $config = []) static session初始化
  17. * @method bool has(string $name,string $prefix = null) static 判断session数据
  18. * @method mixed prefix(string $prefix = '') static 设置或者获取session作用域(前缀)
  19. * @method mixed get(string $name = '',string $prefix = null) static session获取
  20. * @method mixed pull(string $name,string $prefix = null) static session获取并删除
  21. * @method void push(string $key, mixed $value) static 添加数据到一个session数组
  22. * @method void set(string $name, mixed $value , string $prefix = null) static 设置session数据
  23. * @method void flash(string $name, mixed $value = null) static session设置 下一次请求有效
  24. * @method void flush() static 清空当前请求的session数据
  25. * @method void delete(string $name, string $prefix = null) static 删除session数据
  26. * @method void clear($prefix = null) static 清空session数据
  27. * @method void start() static 启动session
  28. * @method void destroy() static 销毁session
  29. * @method void pause() static 暂停session
  30. * @method void regenerate(bool $delete = false) static 重新生成session_id
  31. */
  32. class Session extends Facade
  33. {
  34. /**
  35. * 获取当前Facade对应类名(或者已经绑定的容器对象标识)
  36. * @access protected
  37. * @return string
  38. */
  39. protected static function getFacadeClass()
  40. {
  41. return 'session';
  42. }
  43. }