N°7629 Deprecate utils::GetClassesForInterface in favor of InterfaceDiscovery::FindItopClasses

Improve caching strategy and robustness
This commit is contained in:
Romain Quetiez
2024-07-06 12:08:51 +02:00
parent 147aad9221
commit baf85e7a80
19 changed files with 845 additions and 112 deletions

View File

@@ -16,6 +16,8 @@
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
use Combodo\iTop\Service\InterfaceDiscovery\InterfaceDiscovery;
require_once(APPROOT.'core/tar-itop.class.inc.php');
interface BackupArchive
@@ -272,7 +274,7 @@ class DBBackup
$aExtraFiles = MetaModel::GetModuleSetting('itop-backup', 'extra_files', []);
}
foreach (utils::GetClassesForInterface('iBackupExtraFilesExtension', '', ['[\\\\/]lib[\\\\/]', '[\\\\/]node_modules[\\\\/]', '[\\\\/]test[\\\\/]', '[\\\\/]tests[\\\\/]']) as $sExtensionClass)
foreach (InterfaceDiscovery::GetInstance()->FindItopClasses(iBackupExtraFilesExtension::class) as $sExtensionClass)
{
/** @var iBackupExtraFilesExtension $oExtensionInstance */
$oExtensionInstance = new $sExtensionClass();