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);