$files = array(); $files = array_merge($files, get_directory_contents($path, '', false, false)); if (file_exists(str_replace('/sources/', '/sources_custom/', $path))) { $files = array_merge($files, get_directory_contents(str_replace('/sources/', '/sources_custom/', $path), '', false, false)); } foreach ($files as $file) { if (substr($file, -4) == '.php') { $auto_probe[] = basename($file, '.php'); } } // Via addons table (non-bundled ones) global $SITE_INFO; $backup = $SITE_INFO; require_once $probe_dir . '/info.php'; $linked_db = new database_driver(get_db_site(), get_db_site_host(), get_db_site_user(), get_db_site_password(), get_table_prefix()); $auto_probe += collapse_1d_complexity('addon_name', $linked_db->query_select('addons', array('addon_name'))); $SITE_INFO = $backup; // Via filesystem (non-bundled ones) foreach ($addons['non_bundled'] as $addon => $files) { foreach ($files as $file) { if (file_exists($probe_dir . '/' . $file)) { $auto_probe[] = $addon; } } } $auto_probe = array_unique($auto_probe); // Find oldest modified file that has been modified since $cutoff_days = 0; $files = get_directory_contents($probe_dir); foreach ($files as $file) { $time = filemtime($probe_dir . '/' . $file);