I am trying to get the Bronto api PHP lib to work with composers autoload. But no go. What is missing?
Composer.json:
{
"require": {
"slim/slim": "2.4.*",
"bronto/bronto-api-php-client": "dev-master"
},
"minimum-stability": "dev"
}
index.php
<?php
require '../vendor/autoload.php';
$app = new \Slim\Slim();
$app->get('/', function () {
$bronto = new \Bronto_Api();
$bronto->setToken($token); // Or pass $token to the constructor of Bronto_Api
$bronto->login(); // Only needs to be called once
});
$app->run();
Slim's framework loads fine. I just keep getting a 'Fatal error: Class 'Bronto_Api' not found in /app/location/'.
Any ideas on what could be going on?
This is 3 years after the original question was asked but I had the same problem trying to add the package to a Laravel project I was working on. I resolved it by adding the following to my composer.json (the one belonging to my project).
"autoload": {
"psr-0": {
"Bronto_": "./vendor/bronto/bronto-api-php-client/Symfony/Component/Console/src/"
}
}
It feels a little dirty but works OK.