Skip to content

Commit

Permalink
Merge pull request #109 from austintoddj/analysis-8Peo4A
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
austintoddj authored Aug 12, 2016
2 parents 93f6ee7 + c58ccf2 commit ae766bd
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 142 deletions.
29 changes: 14 additions & 15 deletions app/Http/Controllers/Backend/ToolsController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

namespace App\Http\Controllers\Backend;

use File;
use Excel;
use Session;
use App\Models\Tag;
Expand All @@ -11,7 +11,6 @@
use App\Models\Migrations;
use Illuminate\Support\Facades\App;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Artisan;

class ToolsController extends Controller
Expand All @@ -32,6 +31,7 @@ public function index()
'timezone' => $_SERVER['APP_TIMEZONE'],
'status' => $status,
];

return view('backend.tools.index', compact('data'));
}

Expand All @@ -48,6 +48,7 @@ public function resetIndex()
} else {
Session::set('_reset-index', trans('messages.reset_index_error'));
}

return redirect(url('admin/tools'));
}

Expand All @@ -66,6 +67,7 @@ public function clearCache()
} else {
Session::set('_cache-clear', trans('messages.cache_clear_error'));
}

return redirect(url('admin/tools'));
}

Expand All @@ -81,9 +83,8 @@ protected function downloadUsers()
foreach ($users as $user) {
$sheet->appendRow($user);
}

});
})->store('csv', storage_path($date . '-canvas-archive'), true);
})->store('csv', storage_path($date.'-canvas-archive'), true);
}

protected function downloadPosts()
Expand All @@ -98,9 +99,8 @@ protected function downloadPosts()
foreach ($posts as $post) {
$sheet->appendRow($post);
}

});
})->store('csv', storage_path($date . '-canvas-archive'), true);
})->store('csv', storage_path($date.'-canvas-archive'), true);
}

protected function downloadTags()
Expand All @@ -115,9 +115,8 @@ protected function downloadTags()
foreach ($tags as $tag) {
$sheet->appendRow($tag);
}

});
})->store('csv', storage_path($date . '-canvas-archive'), true);
})->store('csv', storage_path($date.'-canvas-archive'), true);
}

protected function downloadPostTag()
Expand All @@ -132,9 +131,8 @@ protected function downloadPostTag()
foreach ($postTag as $pt) {
$sheet->appendRow($pt);
}

});
})->store('csv', storage_path($date . '-canvas-archive'), true);
})->store('csv', storage_path($date.'-canvas-archive'), true);
}

protected function downloadMigrations()
Expand All @@ -149,9 +147,8 @@ protected function downloadMigrations()
foreach ($migrations as $migration) {
$sheet->appendRow($migration);
}

});
})->store('csv', storage_path($date . '-canvas-archive'), true);
})->store('csv', storage_path($date.'-canvas-archive'), true);
}

/**
Expand All @@ -168,7 +165,7 @@ public function handleDownload()
$this->downloadMigrations();

$date = date('Y-m-d');
$path = storage_path($date . '-canvas-archive');
$path = storage_path($date.'-canvas-archive');
$filename = sprintf('%s.zip', $path);
$zip = new \ZipArchive();
$zip->open($filename, \ZipArchive::CREATE);
Expand All @@ -189,9 +186,9 @@ public function handleDownload()
}

$zip->close();
\File::deleteDirectory(storage_path($date . '-canvas-archive'));
\File::deleteDirectory(storage_path($date.'-canvas-archive'));

return response()->download(storage_path($date . '-canvas-archive.zip'))->deleteFileAfterSend(true);
return response()->download(storage_path($date.'-canvas-archive.zip'))->deleteFileAfterSend(true);
}

/**
Expand All @@ -207,6 +204,7 @@ public function enableMaintenanceMode()
} else {
Session::set('_enable-maintenance-mode', trans('messages.enable_maintenance_mode_error'));
}

return redirect(url('admin/tools'));
}

Expand All @@ -223,6 +221,7 @@ public function disableMaintenanceMode()
} else {
Session::set('_disable-maintenance-mode', trans('messages.disable_maintenance_mode_error'));
}

return redirect(url('admin/tools'));
}
}
8 changes: 2 additions & 6 deletions app/Http/Middleware/CheckForMaintenanceMode.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Routing\Route;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Original;

class CheckForMaintenanceMode extends Original
Expand All @@ -31,8 +30,6 @@ protected function shouldPassThrough($request)
return false;
}



/**
* Handle an incoming request.
*
Expand All @@ -59,8 +56,7 @@ public function handle($request, Closure $next)
}
}

if ($this->shouldPassThrough($request))
{
if ($this->shouldPassThrough($request)) {
return $response;
}

Expand Down
Loading

0 comments on commit ae766bd

Please sign in to comment.