/** * Static factory method used to turn an array or collection of configuration data into an instantiated object. * * @param array|Collection $config Configuration data * @return KinveyClient */ public static function factory($config = array()) { $client = new self($config['baseURL'], $config); $client->setDefaultOption('headers/Content-Type', 'application/json'); $client->setDefaultOption('X-Kinvey-API-Version', 2); $client->setAuthMode($config['defaultAuthMode']); $client = self::registerPlugins($client); return $client; }
/** * @param shibServerData $shibServerData * * @return shibUser */ public static function buildInstance(shibServerData $shibServerData) { $shibUser = new self(); $shibUser->shibServerData = $shibServerData; $ext_id = $shibUser->shibServerData->getLogin(); $shibUser->setExternalAccount($ext_id); $existing_usr_id = self::getUsrIdByExtId($ext_id); if ($existing_usr_id) { $shibUser->setId($existing_usr_id); $shibUser->read(); } $shibUser->setAuthMode('shibboleth'); return $shibUser; }