Add caching to the auto_loader for interfaces (#7320)

* update auto loader to load and cache interfaces

* use new method to update the auto loader cache

* use new interface

* use new interface to trigger a cache flush

* update the console upgrade menu

* update the missing implements syntax

* add the clear_cache to the flush cache button
This commit is contained in:
frytimo
2025-03-15 09:13:36 -06:00
committed by GitHub
parent 99b3100ee9
commit 0a42d8f198
7 changed files with 251 additions and 98 deletions
+7 -12
View File
@@ -147,18 +147,13 @@ function show_upgrade_menu() {
* @global type $text
*/
function do_upgrade_auto_loader() {
global $text;
//remove temp file
unlink(sys_get_temp_dir() . '/' . auto_loader::FILE);
global $text, $autoload;
//remove temp files
unlink(sys_get_temp_dir() . '/' . auto_loader::CLASSES_FILE);
unlink(sys_get_temp_dir() . '/' . auto_loader::INTERFACES_FILE);
//create a new instance of the autoloader
$loader = new auto_loader();
//reload the classes
$loader->reload_classes();
echo "{$text['label-reloaded_classes']}\n";
//re-create cache file
if ($loader->update_cache()) {
echo "{$text['label-updated_cache']}\n";
}
$autoload->update();
echo "{$text['message-updated_autoloader']}\n";
}
/**
@@ -195,7 +190,7 @@ function do_filesystem_permissions($text, settings $settings) {
$directories[] = $log_directory . '/xml_cdr';
}
//update the auto_loader cache permissions file
$directories[] = sys_get_temp_dir() . '/' . auto_loader::FILE;
$directories[] = sys_get_temp_dir() . '/' . auto_loader::CLASSES_FILE;
//execute chown command for each directory
foreach ($directories as $dir) {
if ($dir !== null) {