/** * Identical to the parent constructor, except that * we start a PHP session to store the user ID and * access token if during the course of execution * we discover them. * * @param Array $config the application configuration. * @see BaseMeli::__construct in Meli.php */ public function __construct($config, $sm = NULL) { if (is_null($sm)) { $sm = new SessionManager(); } $sm->start(); parent::__construct($config); }
/** * Initialize a MercadoLibre Application. * * The configuration: * - countryId: the country ID * - appId: the application ID * - secret: the application secret * * @param array $config The application configuration */ public function __construct($config) { if (isset($config['mockUrl'])) { self::$API_DOMAIN = $config['mockUrl']; self::$IS_MOCK = true; } $this->setAppId($config['appId']); $this->setAppSecret($config['secret']); $this->initApp($config['appId']); }