APP_DEBUG
This commit is contained in:
parent
48fc63ac43
commit
90cfb5ca72
|
@ -35,7 +35,7 @@ class Downloader {
|
||||||
'timeout' => 30,
|
'timeout' => 30,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
if (env('DEBUG') && Cache::has($url)) {
|
if (env('APP_DEBUG') && Cache::has($url)) {
|
||||||
return Cache::get($url);
|
return Cache::get($url);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -39,7 +39,7 @@ class Wikipage {
|
||||||
public function __construct($game) {
|
public function __construct($game) {
|
||||||
$this->game = $game;
|
$this->game = $game;
|
||||||
|
|
||||||
if (!env('DRY_RUN')) {
|
if (!env('APP_DEBUG')) {
|
||||||
try {
|
try {
|
||||||
// Log in to a wiki
|
// Log in to a wiki
|
||||||
$api = new MediawikiApi( env('WIKI') );
|
$api = new MediawikiApi( env('WIKI') );
|
||||||
|
@ -80,7 +80,7 @@ class Wikipage {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$exists = $this->exists($pagetitle);
|
$exists = $this->exists($pagetitle);
|
||||||
if (!env('DRY_RUN') && !$exists) {
|
if (!env('APP_DEBUG') && !$exists) {
|
||||||
if (!empty($this->game->image_url) && isset($filename)) {
|
if (!empty($this->game->image_url) && isset($filename)) {
|
||||||
if ($this->services->newPageGetter()->getFromTitle($this->covername)) {
|
if ($this->services->newPageGetter()->getFromTitle($this->covername)) {
|
||||||
try {
|
try {
|
||||||
|
@ -102,7 +102,7 @@ class Wikipage {
|
||||||
|
|
||||||
$this->makeContent();
|
$this->makeContent();
|
||||||
|
|
||||||
if (!env('DRY_RUN') && !$exists) {
|
if (!env('APP_DEBUG') && !$exists) {
|
||||||
$newContent = new Content( $this->content );
|
$newContent = new Content( $this->content );
|
||||||
$title = new Title($pagetitle);
|
$title = new Title($pagetitle);
|
||||||
$identifier = new PageIdentifier($title);
|
$identifier = new PageIdentifier($title);
|
||||||
|
@ -115,7 +115,7 @@ class Wikipage {
|
||||||
echo $this->content;
|
echo $this->content;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (env('DRY_RUN')) {
|
if (env('APP_DEBUG')) {
|
||||||
echo "Черновой режим. Автосоздание невозможно.\n";
|
echo "Черновой режим. Автосоздание невозможно.\n";
|
||||||
}
|
}
|
||||||
echo $this->content;
|
echo $this->content;
|
||||||
|
@ -201,7 +201,7 @@ class Wikipage {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
protected function exists($pagename) {
|
protected function exists($pagename) {
|
||||||
if (env('DRY_RUN')) {
|
if (env('APP_DEBUG')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$page = $this->services->newPageGetter()->getFromTitle((string) $pagename);
|
$page = $this->services->newPageGetter()->getFromTitle((string) $pagename);
|
||||||
|
|
Loading…
Reference in a new issue