deliciousbrains / wp-migrate-db

WordPress plugin that exports your database, does a find and replace on URLs and file paths, then allows you to save it to your computer.
https://wordpress.org/plugins/wp-migrate-db/
341 stars 513 forks source link

fixed bug where migrate db tried to create a new instance of an object w... #43

Open mnelson4 opened 10 years ago

mnelson4 commented 10 years ago

...hich MIGHT have a PRIVATE CONSTRUCTOR. I'm submitting this pull request because when we used wp-migrate-db with Event Espresso 4 (eventespresso.com), it gave us a fatal error because we're serializing objects to the database (specifically, as transients) which have a PRIVATE CONSTRUCTOR, because we're using them as singletons. (Eg, we have a class called EE_Cart, whose constructor is private, and on which you instead use a static function called instance() to get an instance of the object (and that function can call EE_Cart's constructor if it chooses)). Was there some special reason why you needed to create a separate object and modify it, instead of just modifying the object you unserialized? Anyways, with this change, I was succesfully able to run migrate-db with Event Espresso 4's data. Please let us know your thoughts on this.