Manual talk:How to debug

Jump to navigation Jump to search

About this board

Previous discussion was archived at Manual talk:How to debug/Archive 1 on 2019-01-23.

wfDebugLog works on web page but not in phpunit

Qdinar (talkcontribs)

when i put wfDebugLog in a php file it works when i open a local mediawiki page, but not when i run phpunit test.

Qdinar (talkcontribs)

it is permission problem. phpunit runs by user, local page runs by www-data. when i tried log file in user home folder, it works.

Reply to "wfDebugLog works on web page but not in phpunit"

Please explain wfDebugLog in more detail

Otheus (talkcontribs)

1. Please explain how wfDebugLog actually works. What happens if no debug-group array is defined? What happens if it is defined but the particular group is not? For instance, if wfDebugLog("test","string") and "test" is not an element in in the groups variable, what happens?

2. How can we overwrite the string-emit function so that the debug lines contain useful information, such as session-id or sever-unique-id or process-id, and date-time stamp?

3. In the "LegacyLogger" factory definition, there is reference to PSR-3 logging, and that wfDebug is considered 'legacy'. Where is this non-legacy logging feature documented?

BDavis (WMF) (talkcontribs)
Reply to "Please explain wfDebugLog in more detail"
Berot3 (talkcontribs)

I have question regarding the php.ini-conf "session.save_path".

Is this in MediaWiki 1.35 used for anything else than the setup (mw-config)?

At least on windows it writes to the windows-temp folder if this config is not set.

If this is only for setup than I'm fine with it. Since user-login are not stored there since some versions, there is nothing left, right?

Reply to "session.save_path?"
Otheus (talkcontribs)

> xdebug_on; php5 /vagrant/mediawiki/tests/phpunit/phpunit.php --wiki=wiki /vagrant/mediawiki/extensions/Extension/tests/phpunit/SomeTest.php; xdebug_off

Yeah, that command doesn't exist. And php5? Really?

BDavis (WMF) (talkcontribs)

xdebug_on and xdebug_off are shell functions included in MediaWiki-Vagrant. They set and clear the environment variables XDEBUG_CONFIG and PHP_IDE_CONFIG. The docs could make this more clear.

The explicit use of php5 is also a dated reference to MediaWiki-Vagrant configuration. Modern MediaWiki-Vagrant usage should be just php or possibly php7.2. The legacy php5 was once needed to select a Zend-based PHP runtime rather than an HHVM runtime.

There are no older topics