Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f4931ae
N°4789 - Parse datamodel module.xxx.php files instead of interpreting…
odain-cbd Aug 20, 2025
1c025cc
N°4789 - fix broken setup + tests
odain-cbd Aug 20, 2025
29cf775
N°4789 - replace legacy eval by module file parsing
odain-cbd Aug 25, 2025
5937cf8
N°4789 - handle constants and if conditional structures
odain-cbd Aug 25, 2025
ee626e2
N°4789 - compute boolean expressions
odain-cbd Aug 25, 2025
ba0ba8c
N°4789 - make autoselect and dependencies work as well
odain-cbd Aug 26, 2025
6e43612
cleanup
odain-cbd Aug 26, 2025
bf8392e
N°4789 - fix BeforeWritingConfig calls during setup
odain-cbd Aug 26, 2025
f54aa8a
N°4789 - refactor and split in ModuleDiscoveryEvaluationService + han…
odain-cbd Aug 27, 2025
e19a921
N°4789 - PR review changes with Romain
odain-cbd Aug 27, 2025
a229033
PR review + code cleanup + added usecases and test cover
odain-cbd Sep 1, 2025
026abfa
temp evaluation work
odain-cbd Sep 2, 2025
3b32e13
replace eval by iTop custom evaluation classes
odain-cbd Sep 2, 2025
a1cb92c
move PhpParser/Evaluation classes in a specific namespave + composer …
odain-cbd Sep 2, 2025
2708947
fix broken setup
odain-cbd Sep 2, 2025
9103af1
fix broken setup
odain-cbd Sep 2, 2025
6aa3249
complete Evaluators list + autoload
odain-cbd Sep 3, 2025
7ecebb9
cleanup useless testing resources
odain-cbd Sep 3, 2025
6da1d7a
cleanup + replace last eval call in VariableEvaluator
odain-cbd Sep 3, 2025
5e182d5
fix few Evaluators code
odain-cbd Sep 4, 2025
bad6886
enhance nikic evaluators + test with/without nikic lib
odain-cbd Sep 4, 2025
947e0a8
Evaluator fixes/enhancements + tests
odain-cbd Sep 5, 2025
6bdc838
bump to nikic fork temporarly
odain-cbd Sep 5, 2025
91279a0
bump nikic-parser fork + use only nikic fork evaluation + cleanup it…
odain-cbd Sep 9, 2025
a658c29
review with Romain: use distinct whitelists in setup time/runtime + m…
odain-cbd Sep 9, 2025
9436a02
PhpExpressionEvaluator used via constructor and not as a service
odain-cbd Sep 9, 2025
1353d2f
dumpautoload again after rebase
odain-cbd Sep 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"laminas/laminas-mail": "^2.11",
"laminas/laminas-servicemanager": "^3.5",
"league/oauth2-google": "^4.0.1",
"nikic/php-parser": "~5.6.0",
"nikic/php-parser": "dev-master",
"pear/archive_tar": "~1.4.14",
"pelago/emogrifier": "^7.2.0",
"psr/log": "^3.0.0",
Expand All @@ -41,6 +41,10 @@
"symfony/stopwatch": "~6.4.0",
"symfony/web-profiler-bundle": "~6.4.0"
},
"repositories": [{
"type": "vcs",
"url": "https://github.com/Combodo/PHP-Parser"
}],
"suggest": {
"ext-libsodium": "Required to use the AttributeEncryptedString.",
"ext-openssl": "Can be used as a polyfill if libsodium is not installed",
Expand Down
30 changes: 18 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 2 additions & 14 deletions core/config.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2852,20 +2852,8 @@ public function UpdateIncludes($sModulesDir, $aSelectedModules = null)
}
}
}
if (isset($aModuleInfo['installer']))
{
$sModuleInstallerClass = $aModuleInfo['installer'];
if (!class_exists($sModuleInstallerClass))
{
throw new Exception("Wrong installer class: '$sModuleInstallerClass' is not a PHP class - Module: ".$aModuleInfo['label']);
}
if (!is_subclass_of($sModuleInstallerClass, 'ModuleInstallerAPI'))
{
throw new Exception("Wrong installer class: '$sModuleInstallerClass' is not derived from 'ModuleInstallerAPI' - Module: ".$aModuleInfo['label']);
}
$aCallSpec = array($sModuleInstallerClass, 'BeforeWritingConfig');
call_user_func_array($aCallSpec, array($this));
}

RunTimeEnvironment::CallInstallerHandler($aModuleInfo, "BeforeWritingConfig", [$this]);
}
}
$this->SetAddOns($aAddOns);
Expand Down
5 changes: 4 additions & 1 deletion lib/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
echo $err;
}
}
throw new RuntimeException($err);
trigger_error(
$err,
E_USER_ERROR
);
}

require_once __DIR__ . '/composer/autoload_real.php';
Expand Down
5 changes: 0 additions & 5 deletions lib/bin/php-parse.bat

This file was deleted.

38 changes: 2 additions & 36 deletions lib/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,12 @@
*/
class InstalledVersions
{
/**
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
* @internal
*/
private static $selfDir = null;

/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/
private static $installed;

/**
* @var bool
*/
private static $installedIsLocalDir;

/**
* @var bool|null
*/
Expand Down Expand Up @@ -320,24 +309,6 @@ public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();

// when using reload, we disable the duplicate protection to ensure that self::$installed data is
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
// so we have to assume it does not, and that may result in duplicate data being returned when listing
// all installed packages for example
self::$installedIsLocalDir = false;
}

/**
* @return string
*/
private static function getSelfDir()
{
if (self::$selfDir === null) {
self::$selfDir = strtr(__DIR__, '\\', '/');
}

return self::$selfDir;
}

/**
Expand All @@ -354,24 +325,19 @@ private static function getInstalled()
$copiedLocalDir = false;

if (self::$canGetVendors) {
$selfDir = self::getSelfDir();
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
$vendorDir = strtr($vendorDir, '\\', '/');
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
self::$installedByVendor[$vendorDir] = $required;
$installed[] = $required;
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $required;
self::$installedIsLocalDir = true;
$copiedLocalDir = true;
}
}
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
$copiedLocalDir = true;
}
}
}

Expand Down
Loading