Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

CLI returns database string as Array, thus failing #18

Closed
martisj opened this Issue · 8 comments

4 participants

Martin Sjåstad Robert O'Rourke Dave Smith Tom J Nowell
Martin Sjåstad

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

Robert O'Rourke
Owner

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

Dave Smith

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

Tom J Nowell

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

Dave Smith

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

Tom J Nowell

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

Robert O'Rourke

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

Dave Smith

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

Robert O'Rourke
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.