XPSPL::init PHP Method

init() final public static method

Initialise the global processor instance.
final public static init ( boolean $event_history = true ) : object
$event_history boolean Store a history of all events.
return object XPSPL\Processor
    public static final function init($event_history = true)
    {
        if (null === static::$_instance) {
            static::$_instance = new self($event_history);
        }
        return static::$_instance;
    }

Usage Example

Esempio n. 1
0
     *
     * @param  boolean  $event_history  Store a history of all events.
     *
     * @return  object  XPSPL\Processor
     */
    public static final function init($event_history = true)
    {
        if (null === static::$_instance) {
            static::$_instance = new self($event_history);
        }
        return static::$_instance;
    }
    /**
     * Returns the current version of XPSPL.
     *
     * @return  string
     */
    public static final function version()
    {
        return XPSPL_VERSION;
    }
}
/**
 * Thats right ... that says global.
 */
global $XPSPL;
/**
 * Start the processor VROOOOOOM!
 */
$XPSPL = XPSPL::init(XPSPL_SIGNAL_HISTORY);