PHP Class ProcessWire, ProcessWire

Gets ProcessWire's API ready for use
Inheritance: extends Wire
Show file Open project: ryancramerdesign/ProcessWire Class Usage Examples

Protected Properties

Property Type Description
$_fuel Fuel | null This will replace the static $fuel from the Wire class in PW 3.0. Currently it is just here as a placeholder.
$debug boolean Whether debug mode is on or off
$pathSave string Saved path, for includeFile() method
$updater SystemUpdater | null

Public Methods

Method Description
__call ( $method, $arguments )
__construct ( Config $config ) Given a Config object, instantiates ProcessWire and it's API
__toString ( )
load ( Config $config ) Load's ProcessWire using the supplied Config and populates all API fuel
set ( $key, $value, boolean $lock = false ) Set a new API variable
setStatus ( $status ) Set the system status to one of the ProcessWire::status* constants

Protected Methods

Method Description
___finished ( ) Hookable ready for anyone that wants to hook when the request is finished
___init ( ) Hookable init for anyone that wants to hook immediately before any autoload modules initialized or after all modules initialized
___ready ( ) Hookable ready for anyone that wants to hook immediately before any autoload modules ready or after all modules ready
config ( Config $config ) Populate ProcessWire's configuration with runtime and optional variables
getHttpHost ( Config $config ) : string Safely determine the HTTP host
includeFile ( $file ) : boolean Include a PHP file, giving it all PW API varibles in scope
initVar ( string $name, Wire $value ) Initialize the given API var

Method Details

___finished() protected method

Hookable ready for anyone that wants to hook when the request is finished
protected ___finished ( )

___init() protected method

Hookable init for anyone that wants to hook immediately before any autoload modules initialized or after all modules initialized
protected ___init ( )

___ready() protected method

Hookable ready for anyone that wants to hook immediately before any autoload modules ready or after all modules ready
protected ___ready ( )

__call() public method

public __call ( $method, $arguments )

__construct() public method

Given a Config object, instantiates ProcessWire and it's API
public __construct ( Config $config )
$config Config

__toString() public method

public __toString ( )

config() protected method

$param Config $config
protected config ( Config $config )
$config Config

getHttpHost() protected method

Safely determine the HTTP host
protected getHttpHost ( Config $config ) : string
$config Config
return string

includeFile() protected method

File is executed in the directory where it exists.
protected includeFile ( $file ) : boolean
$file Full path and filename
return boolean True if file existed and was included, false if not.

initVar() protected method

Initialize the given API var
protected initVar ( string $name, Wire $value )
$name string
$value Wire

load() public method

Load's ProcessWire using the supplied Config and populates all API fuel
public load ( Config $config )
$config Config

set() public method

Alias of $this->wire(), but for setting only, for syntactic convenience. i.e. $this->wire()->set($key, $value);
public set ( $key, $value, boolean $lock = false )
$key API variable name to set
$value Value of API variable
$lock boolean Whether to lock the value from being overwritten

setStatus() public method

This also triggers init/ready functions for modules, when applicable.
public setStatus ( $status )
$status

Property Details

$_fuel protected property

This will replace the static $fuel from the Wire class in PW 3.0. Currently it is just here as a placeholder.
protected Fuel|null $_fuel
return Fuel | null

$debug protected property

Whether debug mode is on or off
protected bool $debug
return boolean

$pathSave protected property

Saved path, for includeFile() method
protected string $pathSave
return string

$updater protected property

protected SystemUpdater|null $updater
return SystemUpdater | null