I tried running the script on my server with short and long options, none worked. I saw that the database string was printing out as Array.
In my error_log i get this:
[24-Jan-2013 16:46:35] PHP Warning: getopt() [function.getopt]: No support for long options in this build in /home2/martint0/public_html/tilini/do-the-db-dance.php on line 46
Thanks @martisj, we've not had any time to correct this ourselves yet but this should make it easy to pin down.
Has this been resolved at all? Looks like there's been activity on the repo. I really want to make use of the CLI as a dependency for another script I have...
I've been using the cli script and not noticed this, the error message you posted suggests it's something to do with your build of PHP, namely that long options require PHP 5.3 or above, can you verify you're running on 5.3+?
@Tarendai sorry if this seems silly but could you provide an example of usage of the CLI script? Would really be very helpful.
The standard example in the header of the cli file should work fine, it works fine for me:
php searchreplacedb2cli.php -h localhost -u root -d test -c utf-8 -s "findMe" -r "replaceMe"`
As I mentioned earlier, can you verify you're running on PHP 5.3+? Long options were added in PHP 5.3, and your error message says that your build of PHP doesnt support them, thus PHP 5.3 is a minimum requirement for this script
@getdave did @Tarendai's reply help at all? Did you find out which version of PHP you're using?
@sanchothefat I will review this at the first opportunity I get. I can confirm I am on PHP 5.3+. I will report back. Many thanks.
There's a new script and CLI version now so worth checking again with that. Reopen this issue or open a new one and link to here if necessary.