Debugging php cli-scripts from a docker container in NetBeans

Hello. Recently I made a script to replace my real php interpreter in NetBeans settings.

As you probably know NB can’t run dockerized php cli scripts. here I will show you how I solved this problem. Now instead of using terminal I just press Run or Debug button in NB GUI to start my session. AFAICS this solution is pretty good.

I started from something really simple:

#!/bin/bash
docker exec test-php php \
    -dxdebug.mode=debug \
    -dxdebug.start_with_request=1 \
    `basename ${BASH_ARGV[0]}` \
    "${@:1:$#-1}"

But this is not universal and does not take into account all the parameters I can set in ‘Project Properties’ > ‘Run Configurations’:

Reset user password in MediaWiki

Preamble

One of MediaWiki user lost his password, we need to restore access to user’s account.

Reset using maintenance script (recommended): log into server, cd into maintenance directory and run

sudo php changePassword.php --user=username --password=NEWPASS

(Source)

Reset using database: log in your database using privileged user and run

UPDATE prefix_user SET user_password = MD5( CONCAT( user_id, '-', MD5( 'NEWPASS' ) ) ) WHERE user_id = 1

(Source)

Ensure your prefix_, user_id and are correct NEWPASS according your situation.