amnuts / opcache-gui

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

Allow for the Opcache GUI to be autoloaded via Composer #23

Closed JackWH closed 7 years ago

JackWH commented 7 years ago

Currently, you can use Composer to install the index.php file in to your /vendor directory, but it can't be autoloaded by an more complex application or framework without using require_once(), which isn't ideal.

I've added namespacing to the class, and tagged it for autoload. This now allows for things like this (this example is in Laravel:)

Route::get('opcache', function() {
    \OpcacheGui\OpCacheService::init();
});
amnuts commented 7 years ago

Thanks for your contribution, @JackWH! To be honest, I never really thought of the gui being used within other systems like Laravel, more as a complete standalone script, so never went and namespaced it. :smile: