# Qual: Optimisation in load criteria (dol_dir_list)
By moving the "$sortcriteria" conditions into the load conditions, the
comparison between strings is less frequent.
The original test can probably even be removed as it is part of load_*.
The only side-effect that I can see is with the hook, but I think
in theory there should not be a negative side-effect, only a positive
one as this tells the hook to load the data we need without relying
on the hook to make the proper interpretation of the searchcriteria.
* Qual: Refactor for distinction between encodings
# Qual: Refactor for distinction between encodings
Renamed path/file variable to equivalents with prefix os_ and utf8.
Also added $utf8_fullpath to optimize.
* Fix: Fix mixed os_path/utf8_path
# Fix: Fix mixed os_path/utf8_path
This fixes the mixing of a os_path encoding en utf8_path encoding
by reorganising the statement order.
Also avoid a os_encode call by reusing data already available.
* Qual: Apply php-cs-fixer to make only manual changes stand-out
# Qual: Apply php-cs-fixer to make only manual changes stand-out
A few changes will be proposed in the future to these files. This already commits
the esthetic changes using php-cs-fixes.
* Qual: Apply php-cs-fixer to make only manual changes stand-out
# Qual: Apply php-cs-fixer to make only manual changes stand-out
A few changes will be proposed in the future to these files. This already commits
the esthetic changes using php-cs-fixes.
* Qual: Apply php-cs-fixer to make only manual changes stand-out
# Qual: Apply php-cs-fixer to make only manual changes stand-out
A few changes will be proposed in the future to these files. This already commits
the esthetic changes using php-cs-fixes.
* feat(api): Add updateLine to Bank api + add salaries api
* feat(api): Add "deleteLine" to bank api
* fix(api): Remove unneeded mandatory field "salary"
* feat(api): Add PaymentSalaries and PaymentExpenseReports API
* fix(bankaccount): Fix bad phpdoc return type
* fix(bankaccount): Fix bad phpdoc return type and comments
* add updateLabel function to AccountLine
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
* Qual: Remove useless ignore case on regex
# Qual: Remove useless ignore case on regex
The ignore case on this regex is useless and may have a performance impact.
* Qual: Fastest test first, and test object type
# Qual: Fastest test first, and test object type
The test on nohook should be fastest, and the instanceof test helps
static tool checkers and supposedly also helps performance
# Qual: Add verification on filters (dol_dir_list)
As-is, '/' must be escaped in the regexes, this adds code to enforce
that requirement and avoid mistakes.
Even if the mathod using '{}' as delimiters is applied this check
could remain in place.
Also, returning empty array immediately - when the directory could
not be opened, closedir() can not be applied.
* FIX: Fix unneeded access outside open_basedir when looking for modules
# FIX: Fix unneeded access outside open_basedir when looking for modules
Change the order in which the if conditions are tested so that an is_dir("dir/..") is avoided
by first testing if the subpath starts with a dot.
Also changed uppercased the first 3 letters of the file before comparing to CVS.
Finally, improved the typing hint and documentation.
The PHPUNIT test failed like this:
```
35) ExportTest::testExportModulesDatasets
is_dir(): open_basedir restriction in effect. File(D:\a\dolibarr\dolibarr\htdocs/..) is not within the allowed path(s): (D:\a\dolibarr\dolibarr\htdocs;D:\a\dolibarr\dolibarr\documents;D:\a\dolibarr\dolibarr\test;D:\a\dolibarr\dolibarr\dev\initdemo;c:\tools\php)
D:\a\dolibarr\dolibarr\htdocs\core\lib\functions2.lib.php:100
D:\a\dolibarr\dolibarr\htdocs\exports\class\export.class.php:119
D:\a\dolibarr\dolibarr\test\phpunit\ExportTest.php:463
```
* Fix spelling
# FIX: Check valid mail server record correction.
The test for isValidMXRecord did not pass on Windows platform:
```bash
php -r '$a=getmxrr("yhaoo.com", $mxhosts, $weight);var_dump([$a,$mxhosts]);'
array(2) {
[0] =>
bool(true)
[1] =>
array(1) {
[0] =>
string(1) "."
}
}
array(2) {
[0] =>
bool(true)
[1] =>
array(3) {
[0] =>
string(21) "mta5.am0.yahoodns.net"
[1] =>
string(21) "mta7.am0.yahoodns.net"
[2] =>
string(21) "mta6.am0.yahoodns.net"
}
}
```
So an "invalid" MX record can be returned as a dot '.'.
* fix warnings in select_resource_list
* fix warnings in select_resource_list
* fix warnings in select_resource_list
* fix warnings in select_resource_list