-
Notifications
You must be signed in to change notification settings - Fork 314
Add Namespace Autoloader #3275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Add Namespace Autoloader #3275
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -59,7 +59,11 @@ public function log($level, $message, array $context = array()) { | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| public static function getConfig($_key, $_default = '') { | ||||||||||||||||||||||||
| if (self::$config === null) { | ||||||||||||||||||||||||
| self::$config = array_merge(config::getLogLevelPlugin(), config::byKeys(array('log::engine', 'log::formatter', 'log::level', 'addMessageForErrorLog', 'maxLineLog', 'maxSizeLog'))); | ||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||
| self::$config = array_merge(config::getLogLevelPlugin(), config::byKeys(array('log::engine', 'log::formatter', 'log::level', 'addMessageForErrorLog', 'maxLineLog', 'maxSizeLog'))); | ||||||||||||||||||||||||
| } catch (Exception $e) { | ||||||||||||||||||||||||
| self::$config = array(); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Comment on lines
+62
to
+66
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deux petites choses :
Proposition :
Suggested change
|
||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| if (isset(self::$config[$_key])) { | ||||||||||||||||||||||||
| return self::$config[$_key]; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -357,6 +357,9 @@ public function doUpdate() { | |||||||||||||||||||||||||||
| if (file_exists($cibDir)) { | ||||||||||||||||||||||||||||
| rrmdir($cibDir); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| // re generate composer autoloader | ||||||||||||||||||||||||||||
| $result = shell_exec(system::getCmdSudo() . ' composer dump-autoload --optimize --working-dir $WEBSERVER_HOME'); | ||||||||||||||||||||||||||||
| log::add(__CLASS__, 'debug', "Composer autoloader dump result:\n$result"); | ||||||||||||||||||||||||||||
|
Comment on lines
+360
to
+362
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Salut, quelques soucis sur ce
Je te propose ça :
Suggested change
Comme ça : chemin calculé en PHP, path échappé, erreurs capturées, et si ça plante ça casse pas la suite de l'update. |
||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||
| throw new Exception(__("Impossible de décompresser l'archive zip", __FILE__) . ' : ' . $tmp . ' => ' . ZipErrorMessage($res)); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Un point gênant sur
common.config.phpdansfiles: en mode Docker, ce fichier n'existe pas au moment dudocker build.Le
Dockerfileenchaîne step 9 puis step 10 deinstall.sh. Or step 9 (la copiecommon.config.sample.php → common.config.php) est skip en mode docker (install.sh:307,if [ "${INSTALLATION_TYPE}" != "docker" ]). Elle est faite plus tard parinstall/OS_specific/Docker/init.sh:98— mais c'est au démarrage du conteneur, pas au build.Du coup step 10 (qui lance
composer install) va planter au build de l'image officielle parce que composer ne trouvera pas le fichier listé dansfiles.Même souci pour le workflow CI, c'est d'ailleurs pour ça que tu as dû patcher
phpstan.yaml.Je propose de sortir
common.config.phpdefileset de garder unrequire_onceexplicite danscore.inc.phpavantvendor/autoload.php:"files": [ - "core/config/common.config.php", "core/php/utils.inc.php", "core/config/compatibility.config.php" ],date_default_timezone_set('Europe/Brussels'); +require_once __DIR__ . '/../config/common.config.php'; require_once __DIR__ . '/../../vendor/autoload.php';Comme ça tu peux aussi annuler la modif du workflow
phpstan.yaml.