From b50b1f9a28e1c1c99ea2ea8721e75455511518c2 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Mon, 31 Oct 2016 13:49:42 -0400 Subject: [PATCH] Update to processwire/processwire-issues#60 for multi-instance support with multi-language page names --- wire/core/ProcessWire.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/wire/core/ProcessWire.php b/wire/core/ProcessWire.php index 12d019df..aee5720d 100644 --- a/wire/core/ProcessWire.php +++ b/wire/core/ProcessWire.php @@ -147,10 +147,21 @@ class ProcessWire extends Wire { $this->shutdown = $this->wire(new WireShutdown()); $this->config($config); $this->load($config); + + if($this->getNumInstances() > 1) { + // this instance is not handling the request and needs a mock $page API var and pageview + /** @var ProcessPageView $view */ + $view = $this->wire('modules')->get('ProcessPageView'); + $view->execute(false); + } } public function __toString() { - return $this->className() . " " . self::versionMajor . "." . self::versionMinor . "." . self::versionRevision; + $str = $this->className() . " "; + $str .= self::versionMajor . "." . self::versionMinor . "." . self::versionRevision; + if(self::versionSuffix) $str .= " " . self::versionSuffix; + if($this->getNumInstances() > 1) $str .= " #$this->instanceID"; + return $str; } /**