• Hi

    I use the mandrill api for PHP myself for one-off and for that I include the official mandrill class api.
    The name of the class is of course Mandrill.

    Now that I use your plugin , which is exactly what I need, I find out that the mandrill.class.php file is your facade class, which also uses the class name Mandrill.
    So now I have a collision with the official Mandrill class and yours.

    In my opinion you should namespace your class, so that it doesnt create a conflict. Call it WpMandrill instead of Mandrill.
    No I had to hack your pluging to do the change myself (on 3 spots or so) and can’t receive updates unless you amend this.

    Would you please?

    https://www.ads-software.com/plugins/wpmandrill/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Same problem.

    Thank you for your help.

    Thread Starter m.spierings

    (@mspierings)

    Issue still hasn’t been resolved.
    I am getting the error again after updating the plugin (overwriting my fix):

    <b>Fatal error</b>: Cannot redeclare class Mandrill in <b>/var/www/wordpress/wp-content/plugins/wpmandrill/lib/mandrill.class.php</b> on line <b>5</b>

    I don’t want to change the plugin version number to 99999 so that I never receive updates anymore and my hack remains active.

    Can you please look into this?
    So WpMandrill and Mandrill are already used by the official WP Mandrill package and by your plugin.

    So my fix was as follows:

    lib/mandrill.class.php:
    line 5: Class Mandrill -> Class MandrillAPI

    wpmandrill.php:
    line 461: self:$mandrill = new Mandrill (self….) -> self:@mandrill = new MandrillAPI( self..)

    This works, however it will be removed on plugin update if you won’t be able to apply the fix.

    Cheers

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Please don't use class name Mandrill in the lib folder mandrill class’ is closed to new replies.