How do you use this?
Opened this issue ยท 7 comments
Do you have any documentation or sample calls using this wrapper?
Add to your readme a couple simple api calls.
Hopefully this isn't a dick move but I've had success with this one and it has examples to get you up and running, hopefully the author of this package will add something similar to their readme.
I've included the files and tried to create the class, it's just crashes out.
require_once( 'mailchimp-api-php/Mailchimp.php' );
$mailchimp = new Mailchimp\Mailchimp( $mailchimp_api_key ); // <- tried it with and without the namespace
Could you provide us with any read-me or working samples to try?
I have time this week. I'll make a PR to add examples to the readme.
@kibblewhite do you get any PHP errors or is it not getting that far?
If you replace the require_once
line with the following, you should get all the classes loaded:
require 'mailchimp-api-php/vendor/autoload.php';
I have time this week. I'll make a PR to add examples to the readme.
@kibblewhite do you get any PHP errors or is it not getting that far?
No errors, just blank when I tried including the Mailchimp.php
Thanks, if you are able to get around to it, that would be awesome.
If you replace the
require_once
line with the following, you should get all the classes loaded:
require 'mailchimp-api-php/vendor/autoload.php';
I'm not able to generate the autoload because of restrictions and accessibility I have on my system.
So I was trying to including the files manually.
Composer fires off some errors, but that isn't a problem for you to solve. I'll tackle that else where.
The error I get from composer is:
Root package cannot require itself in its composer.json
The world where we depend on dependencies, rather than just include the file and run with it hey, lol
Oh yeah, composer can throw out some really unhelpful errors. Sometimes it's down to the system or composer version. I'm using Composer 1.7.3 if that helps.
If you're just including src/Mailchimp.php
, try also including the three files inside src/http
. The Mailchimp class relies on them, but they're not manually included because the library relies on Composer to handle it.
That might help.