定制 kodi-app/kodi-session 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kodi-app/kodi-session

Composer 安装命令:

composer require kodi-app/kodi-session

包简介

KodiApp Session

README 文档

README

This repository contains different Session implementation for KodiApp.

Installation

$ composer require kodi-app/kodi-session

Configure SessionHook

PandabaseSessionHook

PandabaseSessionHook implementation is based on Symfony's PdoSessionHandler.

$application->run([
    // ...
    KodiConf::HOOKS => [
        // ...
        [
            "class_name" => PandabaseSessionHook::class,
            "parameters" => [
                // Optional, you have to set it when you have more Connection instance in ConnectionManager
                "connection_name"  => "default",
                
                // Optional, 'options' parameter is same as PdoSessionHandler's 'options' parameter
                "options" => [
                    // ...
                ]
            ]
        ],
        // ...
    ],
    // ...
]);

You find details about PdoSessionHandler here.

You find details about Pandabase here.

Configure SessionProvider

$application->run([
    KodiConf::SERVICES => [
        SessionProvider::class
    ]
]);

How to use SessionProvider

/** @var Session $session */
$session = Application::get("session")

// Get username value from session (same as $_SESSION["username"]). If it doesnt exist returns with "anon".
$username = $session->get("username","anon")

// Set a new username
$new_username = "john_doe";
$session->set("username",$new_username);

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2017-09-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固