APP_DEBUG

This commit is contained in:
Alexander Yakovlev 2021-07-30 20:52:33 +07:00
parent 48fc63ac43
commit 90cfb5ca72
Signed by: oreolek
GPG key ID: 8D24103F5EE2A6C0
2 changed files with 6 additions and 6 deletions

View file

@ -35,7 +35,7 @@ class Downloader {
'timeout' => 30,
]);
}
if (env('DEBUG') && Cache::has($url)) {
if (env('APP_DEBUG') && Cache::has($url)) {
return Cache::get($url);
}
try {

View file

@ -39,7 +39,7 @@ class Wikipage {
public function __construct($game) {
$this->game = $game;
if (!env('DRY_RUN')) {
if (!env('APP_DEBUG')) {
try {
// Log in to a wiki
$api = new MediawikiApi( env('WIKI') );
@ -80,7 +80,7 @@ class Wikipage {
return;
}
$exists = $this->exists($pagetitle);
if (!env('DRY_RUN') && !$exists) {
if (!env('APP_DEBUG') && !$exists) {
if (!empty($this->game->image_url) && isset($filename)) {
if ($this->services->newPageGetter()->getFromTitle($this->covername)) {
try {
@ -102,7 +102,7 @@ class Wikipage {
$this->makeContent();
if (!env('DRY_RUN') && !$exists) {
if (!env('APP_DEBUG') && !$exists) {
$newContent = new Content( $this->content );
$title = new Title($pagetitle);
$identifier = new PageIdentifier($title);
@ -115,7 +115,7 @@ class Wikipage {
echo $this->content;
return false;
}
if (env('DRY_RUN')) {
if (env('APP_DEBUG')) {
echo "Черновой режим. Автосоздание невозможно.\n";
}
echo $this->content;
@ -201,7 +201,7 @@ class Wikipage {
* @return boolean
*/
protected function exists($pagename) {
if (env('DRY_RUN')) {
if (env('APP_DEBUG')) {
return false;
}
$page = $this->services->newPageGetter()->getFromTitle((string) $pagename);