{eac}Doojigger Reference

session_extension extends abstract_extension

Extension: session - simple session manager - {eac}Doojigger for WordPress

Tags
category

WordPress Plugin

author

Kevin Burkholder KBurkholder@EarthAsylum.com

copyright

Copyright (c) 2024 EarthAsylum Consulting <www.EarthAsylum.com>

version
1.x
link
https://eacDoojigger.earthasylum.com/
see
https://eacDoojigger.earthasylum.com/phpdoc/

Table of Contents

ALIAS  = null
ALLOW_ADMIN  = 0b1
ALLOW_ALL  = self::ALLOW_ADMIN | self::ALLOW_NETWORK | self::ALLOW_CRON | self::ALLOW_CLI
ALLOW_CLI  = 0b10000
ALLOW_CRON  = 0b1000
ALLOW_NETWORK  = 0b100
ALLOW_NON_PHP  = 0b1000000
DEFAULT_DISABLED  = 0b100000
ONLY_ADMIN  = 0b10
SESSION_DISABLED  = 'disabled'
SESSION_GENERIC  = 'generic PHP session'
SESSION_PANTHION  = 'wp-native-php-sessions/pantheon-sessions.php'
SESSION_TRANSIENT  = 'transient storage'
SESSION_WOOCOMMERCE  = 'woocommerce/woocommerce.php'
VERSION  = '24.0908.1'
__call()  : mixed
magic method to call plugin or extension methods
__construct()  : void
constructor method
__destruct()  : void
Extension destructor
__get()  : mixed
magic method to call parent plugin __get()
addActionsAndFilters()  : void
Add filters and actions - called from main plugin
addShortcodes()  : void
Add extension shortcodes
admin_options_settings()  : void
register options on options_settings_page
get_session()  : array<string|int, mixed>|mixed
Get the session array (or key) filter {classname}_get_session get the session array or key
get_session_variable()  : mixed
get a session value - {pluginname}_get_variable
getAlias()  : const
get the extension alias
getClassName()  : bool
getClassName - get the class/extension name without namespace
getSession()  : string
Retrieve a session variable
getVersion()  : const
get the extension version
initialize()  : bool
Extension initialization
is_network_enabled()  : bool
is_network_enabled - set or test extension enabled for use at the network level
is_network_option()  : bool|mixed
is this class network enabled and does option match a value
isEnabled()  : bool
isEnabled - set or test extension enabled for use
isNewSession()  : bool
is this a new session?
session()  : string
Set or Retrieve a session variable - depreciated
session_debugging()  : array<string|int, mixed>
Get the session array for debugging
session_save_data()  : void
Push back to transient or WC()->session on shutdown
session_set_expiration()  : int
Filter response to set the cookie expiration time to n seconds
session_set_expiring()  : int
Filter response to set the cookie expiration variant time to n seconds
session_start()  : void
Setup the session instance
sessionId()  : string
get the session id
set_session_variable()  : mixed
set a session value - {pluginname}_set_variable
setSession()  : string
set a session variable

Constants

ALLOW_ALL

public mixed ALLOW_ALL = self::ALLOW_ADMIN | self::ALLOW_NETWORK | self::ALLOW_CRON | self::ALLOW_CLI

SESSION_PANTHION

public string SESSION_PANTHION = 'wp-native-php-sessions/pantheon-sessions.php'

supported session managers

SESSION_WOOCOMMERCE

public string SESSION_WOOCOMMERCE = 'woocommerce/woocommerce.php'

supported session managers

Methods

__call()

magic method to call plugin or extension methods

public __call(mixed $method, mixed $arguments) : mixed
Parameters
$method : mixed

the method name or [extension,method]

$arguments : mixed

the arguments to method name

Return values
mixed

result of method called

__construct()

constructor method

public __construct(object $plugin) : void
Parameters
$plugin : object

main plugin object

Return values
void

__get()

magic method to call parent plugin __get()

public __get(string $property) : mixed
Parameters
$property : string

the property name or extension name

Return values
mixed

result of plugin __get()

addActionsAndFilters()

Add filters and actions - called from main plugin

public addActionsAndFilters() : void
Return values
void

addShortcodes()

Add extension shortcodes

public addShortcodes() : void

Called after loading, instantiating, and initializing all extensions

Return values
void

admin_options_settings()

register options on options_settings_page

public admin_options_settings() : void
Tags
access

public

Return values
void

get_session()

Get the session array (or key) filter {classname}_get_session get the session array or key

public get_session([mixed $default = [] ][, string $key = null ]) : array<string|int, mixed>|mixed
Parameters
$default : mixed = []
  • the default value
$key : string = null
  • the name of the variable
Return values
array<string|int, mixed>|mixed

session array or key value

get_session_variable()

get a session value - {pluginname}_get_variable

public get_session_variable(mixed $default, string $key) : mixed
Parameters
$default : mixed
  • the value of the variable
$key : string
  • the name of the variable
Return values
mixed

the value or null

getClassName()

getClassName - get the class/extension name without namespace

public getClassName([object $class = null ]) : bool
Parameters
$class : object = null

optional class object

Return values
bool

getSession()

Retrieve a session variable

public getSession([string $key = null ][, mixed $default = null ]) : string
Parameters
$key : string = null

session key

$default : mixed = null

the default value

Return values
string

session variable

getVersion()

get the extension version

public getVersion() : const
Return values
const

VERSION string

initialize()

Extension initialization

public initialize() : bool

Called after loading and instantiating all extensions

Return values
bool

is enabled

is_network_enabled()

is_network_enabled - set or test extension enabled for use at the network level

public is_network_enabled() : bool
Return values
bool

is_network_option()

is this class network enabled and does option match a value

public is_network_option(string $optionName[, mixed $value = null ]) : bool|mixed
Parameters
$optionName : string

option name

$value : mixed = null

check this value

Return values
bool|mixed

option is set and has value

isEnabled()

isEnabled - set or test extension enabled for use

public isEnabled([bool|string $enabled = null ][, bool $perm = null ]) : bool
Parameters
$enabled : bool|string = null

true|false or other extension name

$perm : bool = null

optional, to permanently set enabled option

Return values
bool

session()

Set or Retrieve a session variable - depreciated

public session(string $key[, mixed $value = null ]) : string
Parameters
$key : string

session key

$value : mixed = null
Return values
string

session variable

session_debugging()

Get the session array for debugging

public session_debugging(mixed $debugging_array) : array<string|int, mixed>
Parameters
$debugging_array : mixed
Return values
array<string|int, mixed>

extended array with [ extension_name => [key=>value array] ]

session_save_data()

Push back to transient or WC()->session on shutdown

public session_save_data() : void
Return values
void

session_set_expiration()

Filter response to set the cookie expiration time to n seconds

public session_set_expiration(int $exp) : int
Parameters
$exp : int

default expiration

Return values
int

session_set_expiring()

Filter response to set the cookie expiration variant time to n seconds

public session_set_expiring(int $exp) : int
Parameters
$exp : int

default expiration

Return values
int

set_session_variable()

set a session value - {pluginname}_set_variable

public set_session_variable(mixed $value, string $key) : mixed
Parameters
$value : mixed
  • the value to set
$key : string
  • the name of the variable
Return values
mixed

the value or null

setSession()

set a session variable

public setSession(string $key, mixed $value) : string
Parameters
$key : string

session key

$value : mixed

the value to set

Return values
string

session variable

Search results