diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b6cc6e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/public/.htaccess + diff --git a/bootstrap.php b/bootstrap.php index 275bb91..6e8573d 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -53,7 +53,9 @@ /** * Setup routing */ -switch(trim($_SERVER['REQUEST_URI'], '/')) { + +$request = explode('/', $_SERVER['REQUEST_URI']); +switch(end($request)) { case 'configuration': ob_start(); require __DIR__ . '/template/configuration.phtml'; diff --git a/public/.htaccess.dist b/public/.htaccess.dist new file mode 100644 index 0000000..7a6bc6d --- /dev/null +++ b/public/.htaccess.dist @@ -0,0 +1,6 @@ +RewriteEngine on +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_URI} !=favicon.ico +RewriteRule ^ /index.php [L] + diff --git a/public/js/main.js b/public/js/main.js index 2edb478..eee061e 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -108,7 +108,7 @@ if ($(td).hasClass('active')) { $(td).removeClass('active'); - td.querySelector('img').src = '/style/toggle-expand.png'; + td.querySelector('img').src = 'style/toggle-expand.png'; td.querySelector('img').setAttribute('alt', '+'); var rows = document.querySelectorAll('.script'); for (var i = 0, l = rows.length; i < l; i++) { @@ -120,7 +120,7 @@ } } else { $(td).addClass('active'); - td.querySelector('img').src = '/style/toggle-collapse.png'; + td.querySelector('img').src = 'style/toggle-collapse.png'; td.querySelector('img').setAttribute('alt', '-'); var rows = document.querySelectorAll('.script'); for (var i = 0, l = rows.length; i < l; i++) { diff --git a/template/cached.phtml b/template/cached.phtml index 70e33ba..6c9501f 100644 --- a/template/cached.phtml +++ b/template/cached.phtml @@ -20,7 +20,7 @@ foreach($status->getCachedScripts() as $data) { $scripts) { ?> - +translate('scripts.directory.script_count'), count($scripts)); ?> + +translate('scripts.directory.script_count'), count($scripts)); ?> translate('scripts.full_path'); ?> @@ -38,7 +38,7 @@ foreach($status->getCachedScripts() as $data) { -
+ diff --git a/template/configuration.phtml b/template/configuration.phtml index 687fbe2..ea0d299 100644 --- a/template/configuration.phtml +++ b/template/configuration.phtml @@ -10,7 +10,7 @@ $classCycler = new OpCacheGUI\Presentation\ClassCycler(['odd', 'even']); translate('config.' . $key); ?> - + diff --git a/template/page.phtml b/template/page.phtml index 5a7b40b..564d9a3 100644 --- a/template/page.phtml +++ b/template/page.phtml @@ -3,20 +3,20 @@ OpCacheGUI 1.0 - - + +
@@ -33,8 +33,8 @@
  • Maintained by Pieter Hordijk
  • - - - + + + diff --git a/template/status.phtml b/template/status.phtml index 0891da6..dea0a33 100644 --- a/template/status.phtml +++ b/template/status.phtml @@ -6,7 +6,7 @@ $classCycler = new OpCacheGUI\Presentation\ClassCycler(['odd', 'even']);

    translate('status.title'); ?> - + @@ -15,7 +15,7 @@ $classCycler = new OpCacheGUI\Presentation\ClassCycler(['odd', 'even']); getStatusInfo() as $key => $statusItem) { ?> translate('status.' . $key); ?> - +