Move Vkontakte fields to configuration #477

Merged
merged 4 commits into from May 25, 2015

Projects

None yet

4 participants

@TrogWarZ
Contributor
  1. Now you can use HybridAuth config to set fields that will be taken from VKontakte for users.get and friends.get
  2. Refactor code to use api_base_url from \OAuth2Client
@nazar-pc
Contributor

This doesn't seem to be backward compatible.
Maybe, better assume old fields by default, but allow to redefine it using configuration?

@TrogWarZ
Contributor

@nazar-pc, can you provide example when it breaks something? I'll fix this shortly.

But i think they are backward-compatible. PR just add some new fields, but not removes old (see code below).
All fields, that defined in \Hybrid_User_Contact but not got from Vkontakte, wil be null but they will exist.

public $fields = [
    'identifier'  => 'uid',            // Old field saved
    'firstName'   => 'first_name',     // Old field saved
    'lastName'    => 'last_name',      // Old field saved
    'gender'      => 'sex',            // Old field saved
    'displayName' => 'screen_name',    // Old field saved
    'city'        => 'city',           // New one
    'country'     => 'country',        // New one
    'bdate'       => 'bdate',          // Old field saved
    'photoURL'    => 'photo_max_orig', // Old field saved
    'nickname'    => 'nickname',       // Old field saved
    'domain'      => 'domain',         // New one
    'timezone'    => 'timezone',       // Old field saved
    'photo_rec'   => 'photo_rec',      // Old field saved
    'photo_max'   => 'photo_max',      // New one
    'home_phone'  => 'home_phone',     // New one
    'home_town'   => 'home_town',      // Old field saved
];
@TrogWarZ
Contributor

Okay, i've changed field map to make compability more clear. Check this out, please.

@nazar-pc
Contributor

Ah, sorry, looks like I understood it wrong, seems to be fine indeed, did you test it (because I didn't yet)?

@TrogWarZ
Contributor

Yep, i use this code in my project and tested compability version from master and from my PR. It's good, just added new fields.
Now i've added more comments to fields map.

@miled miled merged commit a7933d5 into hybridauth:master May 25, 2015

1 check passed

Scrutinizer 21 new issues, 3 updated code elements
Details
@StorytellerCZ StorytellerCZ added this to the 2.x milestone May 27, 2015
@StorytellerCZ StorytellerCZ added a commit that referenced this pull request Sep 7, 2015
@StorytellerCZ StorytellerCZ Release v2.5.0
2.5.0 - September 7 2015
      New:
        #444 + #445 - Slack provider
        $474 - WarGaming OpenID provider
        #454 - xuite's oauth provider
        #480 - Improved inline documentation for IDE support
        #370 + #495 - [github] getUserContacts() implementation
(followers & following)
        #372 + #495 - [instagram] getUserContacts() implementation
(follows & followed-by)
        #519 - [Twitter] Add email option to Twitter API
      Fixes:
        #438 + #445 - [LinkedIn] getusercontacts error
        #446 + #447 - [Steam] xml parsing error
        #340 + #476 - Ensure session is saved before sending response
        #472 - [Facebook] Obsolete 'read_friendlists' FB permission was
changed to 'read_custom_friendlists'
        #453 - [Vkontakte] fix Undefined property: stdClass::$email
        #499 + #500 - [Facebook] Bug: treating hometown as current
location
        #523 - [Draugiem] API does not always return the birthday object
        #525 - [Facebook] Fixes getUserProfile v2.4 compatibility
        #532 + #533 [soundcloud] Provider doesn't implement
getUserProfile() and getUserContacts()
        #535 - [Draugiem] API does not always return the birthday object
      Changes:
        #477 - [Vkontakte] Move Vkontakte fields to configuration
        71531f2 - [Facebook] Adding birthday field to be retrieved
      Removed:
        #455 - [Viadeo] Viadeo connect not existing anymore
972005a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment