PHP 클래스 Give_Session, Give

This is a wrapper class for WP_Session / PHP $_SESSION and handles the storage of Give sessions.
부터: 1.0
파일 보기 프로젝트 열기: wordimpress/give

공개 메소드들

메소드 설명
__construct ( ) : void Class Constructor
get ( string $key ) : string Get Session
get_id ( ) : string Get Session ID
get_session_expiration ( ) : string Get Session Expiration
init ( ) : array Session Init
maybe_start_session ( ) : void Maybe Start Session
set ( string $key, string $value ) : mixed Set Session
set_expiration_time ( ) : integer Set Cookie Expiration
set_expiration_variant_time ( ) : integer Set Cookie Variant Time
set_session_cookies ( ) Set Session Cookies
should_start_session ( ) : boolean Should Start Session
use_php_sessions ( ) : boolean Starts a new session if one has not started yet.

메소드 상세

__construct() 공개 메소드

Defines our session constants, includes the necessary libraries and retrieves the session instance.
부터: 1.0
public __construct ( ) : void
리턴 void

get() 공개 메소드

Retrieve session variable for a given session key.
부터: 1.0
public get ( string $key ) : string
$key string Session key.
리턴 string Session variable.

get_id() 공개 메소드

Retrieve session ID.
부터: 1.0
public get_id ( ) : string
리턴 string Session ID.

get_session_expiration() 공개 메소드

Looks at the session cookies and returns the expiration date for this session if applicable
public get_session_expiration ( ) : string
리턴 string Formatted expiration date string.

init() 공개 메소드

Setup the Session instance.
부터: 1.0
public init ( ) : array
리턴 array Session instance

maybe_start_session() 공개 메소드

Starts a new session if one hasn't started yet.
또한 보기: http://php.net/manual/en/function.session-set-cookie-params.php
public maybe_start_session ( ) : void
리턴 void

set() 공개 메소드

Create a new session.
부터: 1.0
public set ( string $key, string $value ) : mixed
$key string Session key.
$value string Session variable.
리턴 mixed Session variable.

set_expiration_time() 공개 메소드

Force the cookie expiration time if set, default to 24 hours.
부터: 1.0
public set_expiration_time ( ) : integer
리턴 integer

set_expiration_variant_time() 공개 메소드

Force the cookie expiration variant time to custom expiration option, less and hour. defaults to 23 hours (set_expiration_variant_time used in WP_Session).
부터: 1.0

set_session_cookies() 공개 메소드

Cookies are used to increase the session lifetime using the give setting. This is helpful for when a user closes their browser after making a donation and comes back to the site.
부터: 1.4
public set_session_cookies ( )

should_start_session() 공개 메소드

Determines if we should start sessions.
부터: 1.4
public should_start_session ( ) : boolean
리턴 boolean

use_php_sessions() 공개 메소드

Checks to see if the server supports PHP sessions or if the GIVE_USE_PHP_SESSIONS constant is defined.
부터: 1.0
public use_php_sessions ( ) : boolean
리턴 boolean $ret True if we are using PHP sessions, false otherwise.