user1258361
user1258361

Reputation: 1133

Running a custom MediaWiki php script from command line: php script does nothing and produces no error messages

I need to modify the Data Transfer plugin so that I can import a CSV from the command line (without interacting with the web interface).

So I studied and modified the DT_ImportCSV.php file so it uses a command line argument to get the name of the input file. In addition, I added some executable code so that it isn't just class declarations.

I save it as DT_ImportCSV2.php and run it as "php DT_ImportCSV2.php myfile.csv". Nothing happens and no error messages displayed. In addition, I added some printf calls in my program and none of them print anything.

Upvotes: 0

Views: 246

Answers (1)

lambshaanxy
lambshaanxy

Reputation: 23042

Your PHP script is aborting before it reaches those lines. There are a million possible reasons why, start by turning on debugging and checking the logs as instructed here:

http://www.mediawiki.org/wiki/Manual:How_to_debug

Upvotes: 1

Related Questions