kevinkt
(Kevin)
January 5, 2016, 3:40am
1
I need to “require” something from my vendors folder. It’s for integration with the Aweber api. However, I’m not sure how to specify a path into the vendors folder.
This is my views php file.
require_once('aweber\aweber_api\aweber_api.php');
Is what I’m trying to do.
I tried using
use aweber\aweber\aweber_api\aweber_api;
But this didn’t work for me.
Bizley
(Bizley)
January 5, 2016, 9:54am
2
According to the composer.json for this project it should be
"aweber/aweber":"*"
jacmoe
(Jacob Moena)
January 5, 2016, 11:41am
3
Judging from what’s in the composer configuration file for that project and the example provided you shouldn’t need to require or use anything.
Because of the way that Composer autoloads, you simply new whatever object it is that you need.
new AWeberAPI(whatever..
Bizley
(Bizley)
January 5, 2016, 4:27pm
4
Oh, sorry. I don’t know why I thought it’s about composer…
Like @jacmoe said call new AWeberAPI. Try to use:
use aweber\aweber\AWeberAPI;
kevinkt
(Kevin)
January 5, 2016, 8:16pm
5
Bizley:
Oh, sorry. I don’t know why I thought it’s about composer…
Like @jacmoe said call new AWeberAPI. Try to use:
use aweber\aweber\AWeberAPI;
Tried that and I get this error:
Class 'aweber\aweber\AWeberAPI' not found
jacmoe
(Jacob Moena)
January 5, 2016, 8:27pm
6
Try not using it.
Just [i]‘new AWeberAPI(arguments)’
[/i]However, I must say that the API seems to suck big time - perhaps there is a better alternative on Packagist?
kevinkt
(Kevin)
January 5, 2016, 8:32pm
7
jacmoe:
Try not using it.
Just [i]‘new AWeberAPI(arguments)’
[/i]However, I must say that the API seems to suck big time - perhaps there is a better alternative on Packagist?
When I do that it still says class not found.
Yeah the Aweber API does suck. I see 3 other packages on packagist, but not sure if they’d be any better. The demo code uses the “require” statement, which is the issue we’re facing here. If only they had some demo code I could work with…
jacmoe
(Jacob Moena)
January 5, 2016, 9:02pm
8
OK - this might be the solution:
Seems like you need to perform some jerry-rigging yourself.