File: D:/HostingSpaces/SBogers10/reiskick.komma.nl/vendor/komma/kms/src/OPcache/OPcacheController.php
<?php declare(strict_types=1);
namespace Komma\KMS\OPcache;
use Illuminate\Routing\Controller;
class OPcacheController extends Controller
{
/**
* Resets php opcache and redirects you back to where you came from
*/
public function clearOPcache()
{
$response = redirect()->back();
$result = opcache_reset();
if($result) {
return $response->with([
'success' => __('KMS::global.opcache.cleared')
]);
} else {
$response->withErrors(['opcache' => __('KMS::global.opcache.disabled')]);
}
return $response;
}
}