# Qual: Enable and fix phan notices for scripts
phpstan is already enable on scripts, so there is no reason to not
enable phan.
This enables phan and fixes the notices at the same time
Adaptation of detect_dolibarr_main_data_root to handle more cases, especially when servers don't have htdocs
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* Fix language
* Fix language
* Fix language
* Fix language
* Fix language
* Fix language
* Fix language
* CI Missing language key
* Update eventorganization.lang
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
Previous commit 3c883c4b31 added support
for parsing option -- in particular -c/--config -- and added some way of
detecting invalid arguments. But the detection was incorrect.
getopt will stop looking for arguments when it detects a non-argument
(dash-prefixed) which is not an option parameter, but checking that
options were all consumed should be done right after by comparing the
options up to this last non-argument and those that were detected.
This only displays the first unrecognized option, mimicking the
behaviour of most software.
htdocs/install/step2.php has two optional argv parameters: action and
selectlang.
It doesn't have any version indicator, and thus doesn't have any
constraint on the number of parameters, so remove it from inc.php.
The constraint can still be re-included in the other files including
inc.php, as well as the other script-specific options.
This commit adds support for --help and --config to provide a different
config file when running upgrade.php from commandline. The argv array
is patched afterwards as if the options were never given so that it
stays transparent for the code path that are not aware of those
arguments.
The intention behind is incrementally move the usage of argc/argv to
this location and force help/usage from there, in particular for
upgrading.
The rationale for the --config addition is to be able to provide a
different path for conf.php when multiple dolibarr instance are using
the same readonly htdocs folder, which is already possible by modifying
the `include_path` from PHP for the htdocs/ directory but not for the
htdocs/install directory since relative paths are used to fetch the
config file. Since the use-case is to upgrade/migrate a Dolibarr
instance from CLI, it makes sense to be able to select for which
instance (and database parameters) the upgrade should take place.