Qual: Improve dol_syslog (#30782)

* Qual: 🛟 Fix reference to $db with $this->db

# Qual: reference to $db with $this->db

$db was undeclared, use $this->db.

* Fix suspected issue with environment max size and md5sum working on limited files

* Qual: Fix LDAP typing

* Qual: Improve dol_syslog

# Qual: Improve dol_syslog

The changes:
- Keep the log file open for less time (better for concurrency);
- Open the log file only to append data (no internal preparation for writing);
- Avoids re-assigning a constant array;
- Add PHPDoc information about the array parameters and return values;
- May reduce the computation of global settings;
- Result in a slight performance improvement.
This commit is contained in:
MDW
2024-08-29 08:49:27 +02:00
committed by GitHub
parent 5f968dcebe
commit e6630cd7d1
5 changed files with 63 additions and 41 deletions

View File

@@ -129,6 +129,14 @@ if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; the
${SUDO} "${MYSQL}" -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -e 'FLUSH PRIVILEGES;'
sum=$(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f -exec md5sum {} + | LC_ALL=C sort | md5sum)
cnt=$(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f -exec md5sum {} + | wc)
echo "OLDSUM $sum COUNT:$cnt"
# shellcheck disable=2046
sum=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f) | LC_ALL=C sort | md5sum)
# shellcheck disable=2046
cnt=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f) | wc)
echo "NEWSUM $sum COUNT:$cnt"
load_cache=0
if [ -r "$DB_CACHE_FILE".md5 ] && [ -r "$DB_CACHE_FILE" ] && [ -x "$(which "${MYSQLDUMP}")" ] ; then
cache_sum="$(<"$DB_CACHE_FILE".md5)"