$sEnv]); $sPHPExec = trim(\MetaModel::GetConfig()->Get('php_path')); $sOutput = ""; $iRes = 0; exec(sprintf("$sPHPExec %s/get_model_reflection.php --env='%s'", __DIR__, $sEnv), $sOutput, $iRes); if ($iRes != 0) { \IssueLog::Error("Cannot get classes", null, ['env' => $sEnv, 'code' => $iRes, "output" => $sOutput]); throw new CoreException("Cannot get classes"); } $aClasses = json_decode($sOutput[0] ?? null, true); if (false === $aClasses) { \IssueLog::Error("Invalid JSON", null, ["output" => $sOutput]); throw new Exception("cannot get classes"); } if (!is_array($aClasses)) { \IssueLog::Error("not an array", null, ["classes" => $aClasses]); throw new Exception("cannot get classes"); } return $aClasses; } }