FuelPHP Bin
<?php class Controller_Admin_Php_Opcache extends \Admin\Controller_Admin { public function before($data = null) { parent::before($data); if ($this->request->action !== 'index' and ! function_exists('opcache_get_status')) { \Session::set_flash('error', gettext('Opcache is disabled or not installed.')); \Response::redirect(\Uri::admin() . 'hosting/php/opcache/'); } } public function router($method, $params) { if (in_array($method, array('index', 'config', 'scripts', 'graphs'))) { if ( ! \Auth::has_access('opcache.view')) { throw new \HttpForbiddenException(); } $this->template->content = $this->theme->view('php/opcache/' . $method); if (function_exists('opcache_get_status')) { $this->template->content->config = opcache_get_configuration(); $this->template->content->status = opcache_get_status(); $this->template->content->translation = \Config::load('translation/opcache'); } } elseif (in_array($method, array('reset', 'invalidate'))) { if ( ! \Auth::has_access('opcache.reset')) { // TODO throw new \HttpForbiddenException(); } if ($method === 'reset') { if (opcache_reset()) { \Session::set_flash('success', gettext('Opcache successfully cleaned.')); } else { \Session::set_flash('error', gettext('Opcache cannot be cleaned.')); } } else { $file = \Input::param('file'); $file = urldecode($file); // var_dump(urldecode($file)); exit; if (opcache_invalidate($file, true)) { \Session::set_flash('success', gettext('File successfully invalidated.')); } else { \Session::set_flash('error', gettext('File cannot be invalidated.')); } } return \Response::redirect(\Uri::admin() . 'hosting/php/opcache/scripts'); } else { throw new \HttpNotFoundException(); } } }