HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/beerten.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;
    }
}