amnuts / opcache-gui

A clean, effective and responsive interface for Zend OPcache
1.21k stars 197 forks source link

Feature request: boolean to hide files #8

Closed troyengel closed 8 years ago

troyengel commented 8 years ago

I'm making my cache statics for APCu and OPcache public; the Files tab is an information leak of parts of your server you don't want showing up (paths to files restricted and/or hidden from users, private applications, etc.). There isn't a good, clean way to stop this...

The easiest hack I did was to the compileState() function and re-used the allow_invalidate option like so:

        $files = [];
        if ($this->getOption('allow_invalidate') && !empty($status['scripts'])) {

The use of the Files tab is so embedded in the code there isn't really a nice way without a ton of refactoring to make it disappear. My hack works though, maybe in spirit it's good enough (i.e. add a new option 'allow_files' and use it discreetly) without a ton of code change.

amnuts commented 8 years ago

Thanks for the feedback. Release 2.2.0 (https://github.com/amnuts/opcache-gui/releases/tag/v2.2.0) adds an option to toggle the file list.