CLI returns database string as Array, thus failing #18

Closed
martisj opened this Issue Jan 25, 2013 · 8 comments

Projects

None yet

4 participants

@martisj
martisj commented Jan 25, 2013

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

@roborourke
Contributor

Thanks @martisj, we've not had any time to correct this ourselves yet but this should make it easy to pin down.

@getdave
Contributor
getdave commented Jun 11, 2013

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...

@tomjn
Contributor
tomjn commented Jun 11, 2013

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+?

@getdave
Contributor
getdave commented Jun 11, 2013

@Tarendai sorry if this seems silly but could you provide an example of usage of the CLI script? Would really be very helpful.

@tomjn
Contributor
tomjn commented Jun 11, 2013

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

@roborourke
Contributor

@getdave did @Tarendai's reply help at all? Did you find out which version of PHP you're using?

@getdave
Contributor
getdave commented Oct 1, 2013

@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.

@roborourke
Contributor

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.

@roborourke roborourke closed this Feb 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment