Files
iTop/setup/feature_removal/get_model_reflection.php
odain 9cdc707bc5 N°8760 - Audit uninstall of extensions that declare classes - first prototype
N°8760 - Audit uninstall of extensions that declare classes - be able to trace DM classes created_in

N°8760 - be able to test with additional extensions installed in test SDK

N°8760 - provide a service dedicated to extension removal

N°8760 - compute all rules by default

add comment

adapt audit to both extension and mtp
2025-12-04 17:19:18 +01:00

40 lines
884 B
PHP

<?php
require_once(dirname(__DIR__, 2).'/approot.inc.php');
require_once(APPROOT.'application/application.inc.php');
$sEnv = null;
if (isset($argv)) {
foreach ($argv as $iArg => $sArg) {
if (preg_match('/^--env=(.*)$/', $sArg, $aMatches)) {
$sEnv = $aMatches[1];
}
}
}
if (is_null($sEnv)) {
echo "No environment provided (--env) to read datamodel.";
exit(1);
}
$sConfFile = utils::GetConfigFilePath($sEnv);
try {
MetaModel::Startup($sConfFile, false /* $bModelOnly */, true /* $bAllowCache */, false /* $bTraceSourceFiles */, $sEnv);
}
catch (\Throwable $e) {
\IssueLog::Error("Cannot read model from provided environment", null,
[
'env' => $sEnv,
'error' => $e->getMessage(),
'stack' => $e->getTraceAsString(),
]
);
echo "Cannot read model from provided environment";
exit(1);
}
$aClasses = MetaModel::GetClasses();
echo json_encode($aClasses);