Please do NOT expect all Feature Requests to be actioned automatically. Describing your proposal here will ensure the development team are aware of it, and they will give it careful consideration.

TOPIC: Recomendation GLOBAL VARS define('WT_DATA_DIR',

Recomendation GLOBAL VARS define('WT_DATA_DIR', 2 months 2 weeks ago #1

  • bgva2005
  • bgva2005's Avatar
  • Offline
  • New
  • Posts: 5
It is recomended to have ALL global vars in one single place.
For ejample you have definde define('WT_DATA_DIR', 'data/'); into the index.php file in two places.

webtrees-2.0.0-alpha.4
The administrator has disabled public write access.

Recomendation GLOBAL VARS define('WT_DATA_DIR', 2 months 2 weeks ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10844
You are right.

Global variables (and global constants and static variables) are all bad.

I am working slowly to remove them all...

FYI, I use tools such as PHAN, PHPSTAN and PSALM to help find issues like this. You'll see details of them in the file composer.json. Currently, they are reporting about a thousand violations.

The multiple definitions of WT_DATA_DIR were caused when I merged the setup script into the front-controller script.

These two processes have different request/response cycles, which means I need two different definitions of various settings so that support functions (e.g. translation) will work.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.
Powered by Kunena Forum