Closed llaville closed 3 years ago
Hi @llaville, that is something I'm planning to do but need to make sure that the fully built index.php is still available, because one of the good things about this gui is that it's one file only to get up and running. But one day it'll be done. 😀
I've tidied this up in the v3
branch - plus I've changed the namespace of the class.
I haven't completed all the work I want to do on it yet, but it's a better split if you just want to use the class to integrate into your own setup, or if you want to compile to a single index.php
file (by using composer build
).
If you want to check it out and see if works for you, please feel free and drop any feedback. Just remember that it's not quite complete yet.
Hello @amnuts
I've just tested the branch v3, and the new code LGTM.
Only test the standalone class Amnuts\Opcache\Service
like that in a Symfony Controller :
namespace App\Controller;
use Amnuts\Opcache\Service;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class ToolsController extends AbstractController
{
/**
* @Route("/opcache", name="opcache")
*/
public function opcacheGui()
{
// custom options - empty if we used defaults
$options = [];
$opcache = new Service($options);
return $this->render('default/opcache.html.twig', [
'opcache_gui_html' => $opcache->getData()['version'],
'opcache_overview' => $opcache->getData()['overview'],
'opcache_files' => $opcache->getData()['files'],
]);
}
}
Thanks a lot to do the work !
I've now merged into master and released version 3.0.0, which includes better separation between the PHP and JavaScript as mentioned above.
Hello,
I'd like that the
OpcacheGui\OpcacheService
class and html render are split in two different files. That will allow to re-used the class with another renderer than the default provided, and include it in our custom design.Currently i must to the trick as follow :
Thanks Laurent