From 2e68a2e6247717526b36f084783f4c10c785f846 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Fri, 30 Jul 2021 20:54:43 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=B2=D0=BE=D0=B9=D0=BD=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=B4=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=D0=BC=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B2=D0=B8=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Wikipage.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Wikipage.php b/app/Wikipage.php index f3f9c5f..ef3d163 100644 --- a/app/Wikipage.php +++ b/app/Wikipage.php @@ -39,7 +39,7 @@ class Wikipage { public function __construct($game) { $this->game = $game; - if (!env('APP_DEBUG')) { + if (!env('APP_DEBUG') && !empty(env('WIKI'))) { try { // Log in to a wiki $api = new MediawikiApi( env('WIKI') ); @@ -65,6 +65,10 @@ class Wikipage { } public function create() { + if (env('APP_DEBUG') || empty(env('WIKI'))) { + return true; + } + if (!empty($this->game->image_url)) { $filename = preg_replace('/\?.*/', '', basename($this->game->image_url)); $extension = pathinfo($filename, PATHINFO_EXTENSION); @@ -201,7 +205,7 @@ class Wikipage { * @return boolean */ protected function exists($pagename) { - if (env('APP_DEBUG')) { + if (env('APP_DEBUG') || empty(env('WIKI'))) { return false; } $page = $this->services->newPageGetter()->getFromTitle((string) $pagename);