Edit file File name : class.A2OptTest.php Content :<?php class A2OptTest extends A2OptBase { public function test() { header("Content-Type: text/plain"); echo "start {$_GET['test']}\n\n"; switch ($_GET['app']) { case 'wp': $this->wordpress(); break; case 'drupal': case 'drupal 9': $this->drupal(); break; case 'joomla': $this->joomla(); break; case 'magento': $this->magento(); break; case 'ps': $this->prestashop(); break; } } function drupal() { $drupal = $this->get_drupal(); switch ($_GET['test']) { case 'get_setting': var_dump($drupal->get_setting("cache_backends", true)); break; case 'get_variable': var_dump($drupal->get_variable("cache")); break; case 'enable_memcached': $drupal->enable_memcached("unix:///opt/memcached/run/wp/memcached-1.sock"); break; case 'enable_filecache': $drupal->enable_file_cache(); break; case 'disable_memcached': $drupal->disable_memcached(); break; case 'enable_cache': $drupal->enable_core_file_cache(); break; case 'enable_block_cache': $drupal->enable_core_block_cache(); break; case "enable_cache_cron": $drupal->enable_cache_cron(); break; case "disable_cache_cron": $drupal->disable_cache_cron(); break; } echo "end {$_GET['test']}\n\n"; } function magento(){ $magento = $this->get_magento(); switch($_GET['test']) { case "enable_mod_deflate": $magento->enable_mod_deflate(); break; case "disable_mod_deflate": $magento->disable_mod_deflate(); break; case "enable_expires": $magento->enable_expires(); break; case "disable_expires": $magento->disable_expires(); break; case "is_expires": var_dump($magento->is_expires()); break; } } function joomla(){ $joomla = $this->get_joomla(); switch($_GET['test']) { case "is_extension_enabled": var_dump($joomla->is_extension_enabled("PLG_SYSTEM_JCH_OPTIMIZE")); break; case "enable_extension": var_dump($joomla->enable_extension("PLG_SYSTEM_JCH_OPTIMIZE")); var_dump($joomla->is_extension_enabled("PLG_SYSTEM_JCH_OPTIMIZE")); break; case "disable_extension": var_dump($joomla->disable_extension("PLG_SYSTEM_JCH_OPTIMIZE")); var_dump($joomla->is_extension_enabled("PLG_SYSTEM_JCH_OPTIMIZE")); break; case "enable_jch_minimum": $joomla->set_extension_params("PLG_SYSTEM_JCH_OPTIMIZE",array("css"=>"0")); break; case "get_variable": $name = "caching"; if(isset($_GET['name'])){ $name = $_GET['name']; } echo $joomla->get_variable($name); break; case "set_variable": $value = 1; $name = "caching"; if(isset($_GET['value'])){ $value = $_GET['value']; } if(isset($_GET['name'])){ $name = $_GET['name']; } var_dump($joomla->set_variable("{$name}","{$value}")); break; case "uncomment_variable": header("Content-Type: text/plain;"); echo $joomla->uncomment_variable("caching"); break; case "comment_variable": header("Content-Type: text/plain;"); echo $joomla->uncomment_variable("caching"); break; } } function wordpress(){ } function prestashop(){ } function debug($msg){ echo "\n$msg\n"; } function get_drupal(){ return new A2OptDrupal((object) array('path'=>'/home/wp/public_html/drupal','domain'=>'example.com','instance'=>array('id'=>1,'socket'=>'unix:///opt/memcached/run/wp/memcached-1.sock'))); } function get_magento(){ return new A2OptMagento((object) array('path'=>'/home/wp/public_html/mage2','domain'=>'example.com','instance'=>array('id'=>1,'socket'=>'unix:///opt/memcached/run/wp/memcached-1.sock'))); } function get_joomla(){ return new A2OptJoomla((object) array('path'=>'/home/wp/public_html/joomla','domain'=>'example.com','instance'=>array('id'=>1,'socket'=>'unix:///opt/memcached/run/wp/memcached-1.sock'))); } }Save