$wire API variable / ProcessWire class

Represents an instance of ProcessWire connected with a set of API variables.

This class boots a ProcessWire instance. The current ProcessWire instance is represented by the $wire API variable.

// To create a new ProcessWire instance
$wire = new ProcessWire('/server/path/', 'https://hostname/url/');

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the ProcessWire class also inherits all the methods and properties of: Wire.

Show $var?             Show args?        

Common

NameReturnSummary 
$wire->__construct()
(nothing)Create a new ProcessWire instance 
$wire->adminTheme AdminTheme AdminThemeFramework null 
$wire::buildConfig()
ConfigStatic method to build a Config object for booting ProcessWire 
$wire->cache WireCache 
$wire->config Config 
$wire->database WireDatabasePDO 
$wire->datetime WireDateTime 
$wire->fieldgroups Fieldgroups 
$wire->fields Fields 
$wire->fieldtypes Fieldtypes 
$wire->files WireFileTools 
$wire->fuel Fuel 
$wire::getRootPath()
stringGet root path, check it, and optionally auto-detect it if not provided 
$wire->hooks WireHooks 
$wire->input WireInput 
$wire->languages Languages (present only if LanguageSupport installed) 
$wire->log WireLog 
$wire->mail WireMailTools 
$wire->modules Modules 
$wire->notices Notices 
$wire->page Page 
$wire->pages Pages 
$wire->permissions Permissions 
$wire->process Process ProcessPageView 
$wire->profiler WireProfilerInterface 
$wire->roles Roles 
$wire->sanitizer Sanitizer 
$wire->session Session 
$wire->set(string $key, $value)
$thisSet a new API variable 
$wire->setStatus(int $status)
(nothing)Set the system status to one of the ProcessWire::status* constants 
$wire->templates Templates 
$wire->urls Paths 
$wire->user User 
$wire->users Users 
$wire->wire ProcessWire 

Constants

NameReturnSummary 
ProcessWire::htaccessVersion const301Minimum required .htaccess file version 
ProcessWire::indexVersion const300Minimum required index.php version, represented by the PROCESSWIRE define 
ProcessWire::statusBoot const1Status when system is booting API variables available: $wire, $hooks, $config, $classLoader 
ProcessWire::statusDownload const32Status when current request will send a file download to client and exit (rather than rendering a page template file) All API variables available 
ProcessWire::statusFailed const1024Status when the request failed due to an Exception or 404 API variables should be checked for availability before using. 
ProcessWire::statusFinished const128Status when the request has been fully delivered (but before a redirect) All API variables available 
ProcessWire::statusInit const2Status when system and modules are initializing All API variables available except for $page 
ProcessWire::statusNone const0Status prior to boot (no API variables available) 
ProcessWire::statusReady const4Status when system, $page and all API variables are ready All API variables available 
ProcessWire::statusRender const8Status when the current $page’s template file is being rendered, set right before render All API variables available 
ProcessWire::versionMajor const3Major version number 
ProcessWire::versionMinor const0Minor version number 
ProcessWire::versionRevision const163Reversion revision number 
ProcessWire::versionSuffix constdevVersion suffix string (when applicable) 

For hooks

These methods are only useful for hooking and should not be called directly.

NameReturnSummary 
$wire->finished()
(nothing)Hookable ready for anyone that wants to hook when the request is finished
$wire->init()
(nothing)Hookable init for anyone that wants to hook immediately before any autoload modules initialized or after all modules initialized
$wire->ready()
(nothing)Hookable ready for anyone that wants to hook immediately before any autoload modules ready or after all modules ready

Additional methods and properties

In addition to the methods and properties above, ProcessWire also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.163

Twitter updates

  • Quick weekly update covering this week's commits for the upcoming 3.0.167 ProcessWire core version— More
    18 September 2020
  • This week ProcessWire version 3.0.166 is released on the dev branch. In this post we’ll cover all that’s new relative to the previous version, 3.0.165. Plus we’ll check out the latest new versions of ProCache and FormBuilder— More
    11 September 2020
  • Weekly update – 28 August 2020 – New secure files option defined per-template: More
    28 August 2020

Newest forum posts

Latest news

  • ProcessWire Weekly #331
    In the 331st issue of ProcessWire Weekly we're going to check out the latest core and Pro module updates (ProcessWire 3.0.166, ProCache 4.0.1, and Form Builder v44), introduce the Wireframe API module, and more. Read on!
    Weekly.pw / 12 September 2020
  • ProcessWire 3.0.166 core updates and more
    This week ProcessWire version 3.0.166 is released on the dev branch. In this post we’ll cover all that’s new relative to the previous version, 3.0.165. Plus we’ll check out the latest new versions of ProCache and FormBuilder.
    Blog / 11 September 2020
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits