a-blog cms PHP API Reference

Session extends Facade
in package

Table of Contents

Properties

$container  : Container
$instance  : mixed

Methods

__callStatic()  : mixed
clear()  : void
clearInstance()  : void
テスト用: ファサードがキャッシュしている解決済みインスタンスを破棄する。
delete()  : void
destroy()  : void
extendExpires()  : void
get()  : mixed
getInstance()  : mixed
get service instance
getSessionId()  : string
handle()  : Engine
regenerate()  : void
save()  : void
set()  : void
setContainer()  : void
swap()  : void
テスト用: サービスインスタンスをスタブ等へ差し替える。
writeClose()  : void
getServiceAlias()  : string
getServiceInstance()  : mixed
isCache()  : bool

Properties

$instance

protected static mixed $instance

Methods

__callStatic()

public static __callStatic(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
$method : string
$arguments : array<string|int, mixed>

clear()

public static clear() : void

セッションをクリア

clearInstance()

テスト用: ファサードがキャッシュしている解決済みインスタンスを破棄する。

public static clearInstance() : void

isCache() が true のファサードは解決済みインスタンスを静的プロパティ $instance に 保持するため、コンテナ側だけを差し替えても反映されない。本メソッドでキャッシュを 無効化し、次回アクセスでコンテナから再解決させる。

delete()

public static delete(string $key) : void

セッションの値を削除

Parameters
$key : string

destroy()

public static destroy() : void

セッションを破棄

extendExpires()

public static extendExpires() : void

セッションの有効期限を延長

get()

public static get(string $key) : mixed

セッションの値を取得

Parameters
$key : string

getInstance()

get service instance

public static getInstance() : mixed

getSessionId()

public static getSessionId() : string

セッションIDを取得

Return values
string

regenerate()

public static regenerate() : void

セッションを再生成

save()

public static save() : void

セッションを保存

set()

public static set(string $key, mixed $val) : void

セッションの値を設定

Parameters
$key : string
$val : mixed

swap()

テスト用: サービスインスタンスをスタブ等へ差し替える。

public static swap(object $instance) : void

DI コンテナのエイリアスを差し替えたうえで、ファサードがキャッシュしている解決済み インスタンス(isCache() が true の場合)を破棄し、次回アクセス時に差し替え後の インスタンスを再解決させる。テスト後は元のインスタンスを渡して再度呼び出し復元する。

Parameters
$instance : object

writeClose()

public static writeClose() : void

セッションを閉じる

getServiceAlias()

protected static getServiceAlias() : string
Return values
string

getServiceInstance()

protected static getServiceInstance(string $alias) : mixed
Parameters
$alias : string

isCache()

protected static isCache() : bool
Return values
bool

        
On this page

Search results