diff --git a/wire/core/ProcessWire.php b/wire/core/ProcessWire.php index cf78c9ae..5ef38a4b 100644 --- a/wire/core/ProcessWire.php +++ b/wire/core/ProcessWire.php @@ -19,8 +19,39 @@ require_once(__DIR__ . '/boot.php'); * * ProcessWire 3.x, Copyright 2020 by Ryan Cramer * https://processwire.com - * + * + * Default API vars (A-Z) + * ====================== + * @property AdminTheme|AdminThemeFramework|null $adminTheme + * @property WireCache $cache + * @property Config $config + * @property WireDatabasePDO $database + * @property WireDateTime $datetime + * @property Fieldgroups $fieldgroups + * @property Fields $fields + * @property Fieldtypes $fieldtypes + * @property WireFileTools $files * @property Fuel $fuel + * @property WireHooks $hooks + * @property WireInput $input + * @property Languages $languages (present only if LanguageSupport installed) + * @property WireLog $log + * @property WireMailTools $mail + * @property Modules $modules + * @property Notices $notices + * @property Page $page + * @property Pages $pages + * @property Permissions $permissions + * @property Process|ProcessPageView $process + * @property WireProfilerInterface $profiler + * @property Roles $roles + * @property Sanitizer $sanitizer + * @property Session $session + * @property Templates $templates + * @property Paths $urls + * @property User $user + * @property Users $users + * @property ProcessWire $wire * * @method init() * @method ready() @@ -164,9 +195,6 @@ class ProcessWire extends Wire { /** * Fuel manages ProcessWire API variables * - * This will replace the static $fuel from the Wire class in PW 3.0. - * Currently it is just here as a placeholder. - * * @var Fuel|null * */ @@ -446,9 +474,9 @@ class ProcessWire extends Wire { } $notices = new Notices(); + $this->wire('notices', $notices, true); // first so any API var can send notices $this->wire('urls', $config->urls); // shortcut API var - $this->wire('log', new WireLog(), true); - $this->wire('notices', $notices, true); + $this->wire('log', new WireLog(), true); $this->wire('sanitizer', new Sanitizer()); $this->wire('datetime', new WireDateTime()); $this->wire('files', new WireFileTools()); @@ -760,11 +788,20 @@ class ProcessWire extends Wire { $this->wire($key, $value, $lock); return $this; } - + + /** + * Get API var directly + * + * @param string $key + * @return mixed + * + */ public function __get($key) { if($key === 'fuel') return $this->fuel; if($key === 'shutdown') return $this->shutdown; if($key === 'instanceID') return $this->instanceID; + $value = $this->fuel->get($key); + if($value !== null) return $value; return parent::__get($key); } diff --git a/wire/core/Tfa.php b/wire/core/Tfa.php index 45794b9d..7fd7261f 100644 --- a/wire/core/Tfa.php +++ b/wire/core/Tfa.php @@ -5,7 +5,7 @@ * * This class is for “Tfa” modules to extend. See the TfaEmail and TfaTotp modules as examples. * - * ProcessWire 3.x, Copyright 2018 by Ryan Cramer + * ProcessWire 3.x, Copyright 2020 by Ryan Cramer * https://processwire.com * * @@ -36,6 +36,8 @@ * @property int $codeExpire Codes expire after this many seconds (default=180) * @property int $codeType Type of TFA code to use, see codeType constants (default=0, which is Tfa::codeTypeDigits) * @property string $startUrl URL we are operating from (default='./') + * @property int $rememberDays Number of days to "remember this browser", 0 to disable option, or -1 for no limit? (default=0) + * @property array $rememberFingerprints Fingerprints to remember: agent,agentVL,accept,scheme,host,ip,fwip (default=agentVL,accept,scheme,host) * @property array $formAttrs Form