when i put wfDebugLog in a php file it works when i open a local mediawiki page, but not when i run phpunit test.
Manual talk:How to debug
Jump to navigation Jump to search
Reply to "wfDebugLog works on web page but not in phpunit"
Reply to "Please explain wfDebugLog in more detail"
Reply to "session.save_path?"
The explicit use of
wfDebugLog works on web page but not in phpunit
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.
Please explain wfDebugLog in more detail
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?
Manual:Structured logging may answer some of your logging related questions.
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?
What is this xdebug_on?
> 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?
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