Slim Framework 2 Using sdk Php Mercadolivre

0

Hello,

When attempting to load the sdk php from the mercadolive in a slim framework 2 project, it returns error 500. This only happens when I start the class, so I think I'm starting wrong, but I've tried it in many ways and it does not solve.

The index.php looks like this:

    <?php
//Autoload
require 'vendor/autoload.php';

//Instanciando objeto
$app = new \Slim\Slim(array(
    'templates.path' => 'templates',
    'debug' => true,
));

/*$app->add(new SessionCookie([
    'access_token' => '',
    'expires_in' => '',
    'refresh_token' => ''
]));*/

$app->get('/', function() use ($app) {
    require 'Meli/configApp.php';
    $meli = new Meli\Meli($appId, $secretKey);

echo $appId;
    /*$data['title'] = 'Pagina Principal';

    $app->render('home.php', ["data" => $data], 200);*/
});

$app->run();
?>

I put the $ appId variable to make sure that configApp.php was loaded. If I comment the $ meli line, it returns normal, so the problem is loading Meli.

    
asked by anonymous 15.03.2018 / 15:29

0 answers