PHP Class Pommo, poMMo

Holds Configuration values, authentication state, etc (revived from session)
Show file Open project: soonick/poMMo Class Usage Examples

Public Properties

Property Type Description
$_auth Array to hold values loaded from the DB
$_baseDir
$_baseUrl (e.g. /home/www/site1/pommo/)
$_config (e.g. http://s.com/pommo/) - null = autodetect
$_dateformat log + debug verbosity (1(most)-3(less|default))
$_dbo True if language is not english
$_debug Writable dir (/home/www/site/pommo/cache/)
$_default_subscriber_sort debug status (bool)
$_escaping holds the authentication object
$_hasConfigFile 1: YYYY/MM/DD, 2: MM/DD/YYYY, 3: DD/MM/YYYY
$_hostname Tells us if config.php exists
$_hostport (e.g. www.site1.com) - null = autodetect
$_http bool - true if accessed via HTTPS
$_l10n the "session" language (if set)
$_language "http(s)://hostname(:port)" full connection string
$_logger functions will use htmlspecialchars
$_section holds the database object
$_session Current section
$_slanguage language to translate to (via Pommo::_T())
$_ssl (e.g. 80) - null = autodetect
$_verbosity should be used to sort the subscribers when managing them?
$_workDir holds the logger (messaging) object

Public Methods

Method Description
_T ( $msg ) * _T Translation (l10n) Function
_TP ( $msg, $plural, $count ) * _TP Takes care of plurals when translating
debug ( $text )
get ( $name = FALSE ) * get Gets value from Pommo::$_session array
init ( $args = [] ) * init called by page to load page state, populate config, and track authentication.
kill ( $msg = NULL, $backtrace = FALSE ) * kill Used to terminate a script
logErrors ( ) * logErrors error log, E_ERROR trapping
preInit ( $baseDir ) * preInit populates poMMo's core with values from config.php.
redirect ( $url, $msg = NULL, $kill = true ) * redirect Redirect to pommo page
reloadConfig ( ) * reloadConfig Loads config base
set ( $value ) * set Saves value in Pommo::$_session array
startSession ( $name = null ) * startSession Starts a new session
toggleEscaping ( $toggle = TRUE ) * toogleEscaping Changes the escaping status

Private Methods

Method Description
__construct ( ) * __construct Does nothing since everything is static

Method Details

_T() static public method

* _T Translation (l10n) Function
static public _T ( $msg )

_TP() public method

* _TP Takes care of plurals when translating
public _TP ( $msg, $plural, $count )
$plural
$count

debug() public static method

public static debug ( $text )

get() public static method

* get Gets value from Pommo::$_session array
public static get ( $name = FALSE )
$name

init() public static method

* init called by page to load page state, populate config, and track authentication.
public static init ( $args = [] )

kill() public static method

* kill Used to terminate a script
public static kill ( $msg = NULL, $backtrace = FALSE )
$backtrace

logErrors() static public method

* logErrors error log, E_ERROR trapping
static public logErrors ( )

preInit() public static method

initializes the logger + database
public static preInit ( $baseDir )

redirect() public static method

* redirect Redirect to pommo page
public static redirect ( $url, $msg = NULL, $kill = true )
$url
$msg
$kill

reloadConfig() static public method

* reloadConfig Loads config base
static public reloadConfig ( )

set() public static method

* set Saves value in Pommo::$_session array
public static set ( $value )

startSession() static public method

* startSession Starts a new session
static public startSession ( $name = null )

toggleEscaping() public method

* toogleEscaping Changes the escaping status
public toggleEscaping ( $toggle = TRUE )

Property Details

$_auth public static property

Array to hold values loaded from the DB
public static $_auth

$_baseDir public static property

public static $_baseDir

$_baseUrl public static property

(e.g. /home/www/site1/pommo/)
public static $_baseUrl

$_config public static property

(e.g. http://s.com/pommo/) - null = autodetect
public static $_config

$_dateformat public static property

log + debug verbosity (1(most)-3(less|default))
public static $_dateformat

$_dbo public static property

True if language is not english
public static $_dbo

$_debug public static property

Writable dir (/home/www/site/pommo/cache/)
public static $_debug

$_default_subscriber_sort public static property

debug status (bool)
public static $_default_subscriber_sort

$_escaping public static property

holds the authentication object
public static $_escaping

$_hasConfigFile public static property

1: YYYY/MM/DD, 2: MM/DD/YYYY, 3: DD/MM/YYYY
public static $_hasConfigFile

$_hostname public static property

Tells us if config.php exists
public static $_hostname

$_hostport public static property

(e.g. www.site1.com) - null = autodetect
public static $_hostport

$_http public static property

bool - true if accessed via HTTPS
public static $_http

$_l10n public static property

the "session" language (if set)
public static $_l10n

$_language public static property

"http(s)://hostname(:port)" full connection string
public static $_language

$_logger public static property

functions will use htmlspecialchars
public static $_logger

$_section public static property

holds the database object
public static $_section

$_session public static property

Current section
public static $_session

$_slanguage public static property

language to translate to (via Pommo::_T())
public static $_slanguage

$_ssl public static property

(e.g. 80) - null = autodetect
public static $_ssl

$_verbosity public static property

should be used to sort the subscribers when managing them?
public static $_verbosity

$_workDir public static property

holds the logger (messaging) object
public static $_workDir