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.
Common
Name | Return | Summary | |
---|---|---|---|
$wire->__construct() $wire->__construct() $wire->__construct($config = null, string $rootURL = '/') | (nothing) | Create a new ProcessWire instance | |
$wire->adminTheme | AdminTheme AdminThemeFramework null | ||
$wire::buildConfig() $wire::buildConfig() $wire::buildConfig(string $rootPath = '', string $rootURL = null, array $options = []) | Config | Static method to build a Config object for booting ProcessWire | |
$wire->cache | WireCache | ||
$wire->classLoader | WireClassLoader | ||
$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() $wire::getRootPath() $wire::getRootPath($rootPath = '') | string | Get 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->pagesVersions | PagesVersions null | ||
$wire->permissions | Permissions | ||
$wire->process | Process ProcessPageView | ||
$wire->profiler | WireProfilerInterface | ||
$wire->roles | Roles | ||
$wire->sanitizer | Sanitizer | ||
$wire->session | Session | ||
$wire->set() $wire->set(string $key, $value) $wire->set(string $key, $value, bool $lock = false) | $this | Set a new API variable | |
$wire->setStatus() $wire->setStatus(int $status) $wire->setStatus(int $status, array $data = []) | (nothing) | Set the system status to one of the ProcessWire::status* constants | |
$wire->shutdown | WireShutdown | ||
$wire->templates | Templates | ||
$wire->urls | Paths | ||
$wire->user | User | ||
$wire->users | Users | ||
$wire->wire | ProcessWire |
Constants
Name | Return | Summary | |
---|---|---|---|
ProcessWire::htaccessVersion const | 301 | Minimum required .htaccess file version | |
ProcessWire::indexVersion const | 300 | Minimum required index.php version, represented by the PROCESSWIRE define | |
ProcessWire::statusBoot const | 1 | Status when system is booting API variables available: $wire, $hooks, $config, $classLoader | |
ProcessWire::statusDownload const | 32 | Status when current request will send a file download to client and exit (rather than rendering a page template file) All API variables available | |
ProcessWire::statusExited const | 256 | Status when the request has finished abnormally (like a manual exit) @since 3.0.180 | |
ProcessWire::statusFailed const | 1024 | Status when the request failed due to an Exception or 404 API variables should be checked for availability before using. | |
ProcessWire::statusFinished const | 128 | Status when the request has been fully delivered (but before a redirect) All API variables available | |
ProcessWire::statusInit const | 2 | Status when system and modules are initializing All API variables available except for $page | |
ProcessWire::statusNone const | 0 | Status prior to boot (no API variables available) | |
ProcessWire::statusReady const | 4 | Status when system, $page and all API variables are ready All API variables available | |
ProcessWire::statusRender const | 8 | Status when the current $page’s template file is being rendered, set right before render All API variables available | |
ProcessWire::versionMajor const | 3 | Major version number | |
ProcessWire::versionMinor const | 0 | Minor version number | |
ProcessWire::versionRevision const | 236 | Reversion revision number | |
ProcessWire::versionSuffix const | (nothing) | Version suffix string (when applicable) |
For hooks
These methods are only useful for hooking and should not be called directly.
Name | Return | Summary | |
---|---|---|---|
$wire->finished() $wire->finished() $wire->finished(array $data = []) | (nothing) | Hookable ready for anyone that wants to hook when the request is finished | |
$wire->init() $wire->init() $wire->init() | (nothing) | Hookable init for anyone that wants to hook immediately before any autoload modules initialized or after all modules initialized | |
$wire->ready() $wire->ready() $wire->ready() | (nothing) | Hookable ready for anyone that wants to hook immediately before any autoload modules ready or after all modules ready |
Instances
Methods for managing ProcessWire instances. Note that most of these methods are static.
Name | Return | Summary | |
---|---|---|---|
$wire::getCurrentInstance() $wire::getCurrentInstance() $wire::getCurrentInstance() | ProcessWire null | Get the current ProcessWire instance | |
$wire::getInstance() $wire::getInstance() $wire::getInstance($instanceID = null) | null ProcessWire | Get a ProcessWire instance by ID | |
$wire::getInstances() $wire::getInstances() $wire::getInstances() | array | Get all ProcessWire instances | |
$wire::getNumInstances() $wire::getNumInstances() $wire::getNumInstances() | int | Return number of instances | |
$wire->getProcessWireInstanceID() $wire->getProcessWireInstanceID() $wire->getProcessWireInstanceID() | int | Instance ID of this ProcessWire instance | |
$wire::removeInstance() $wire::removeInstance(ProcessWire $wire) $wire::removeInstance(ProcessWire $wire) | (nothing) | Remove a ProcessWire instance | |
$wire::setCurrentInstance() $wire::setCurrentInstance(ProcessWire $wire) $wire::setCurrentInstance(ProcessWire $wire) | (nothing) | Set the current ProcessWire instance |
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.236