Further fixes to Managed_DataObject::_allCacheKeys(): now uses self::multicacheKey() to generate the (possibly compound) keys, which makes it match the order of the keys used when calling pkeyGet().
Further fixes to Managed_DataObject::_allCacheKeys(): now uses self::multicacheKey() to generate the (possibly compound) keys, which makes it match the order of the keys used when calling pkeyGet().

This should resolve the issues darkip was reporting with user_im_prefs entries returning null immediately after insertion (seen with memcached off, so it was happening even with the built-in in-process cache in the Cache base class).

What was happening was that the initial pkeyGet() would end up saving a negative cache entry under the form with the fields sorted in the key, as via multicacheKey():

    'statusnet:blaguette:user_im_prefs:screenname,transport:brionv,sms' => 'N;'

then we'd do an insert() on the new entry, saving cache entries for the non-sorted key names returned by _allCacheKeys():

    'statusnet:blaguette:user_im_prefs:transport,screenname:sms,brionv' => 'O...'
    'statusnet:blaguette:user_im_prefs:user_id,transport:1234,sms' => 'O...'

but the next query via pkeyGet() still saw the negative lookup cache from before, and came back with null.

Now, _allCacheKeys() sorts the fields in the keys by using the same key-builder function, and queries pick up the same thing you just inserted. :)

faulteh/gnu-social,bankonme/gnu-social,chimo/social,charlycoste/StatusNet,charnimda/lgbtpzn-social,UngPirat/freesocial,charlycoste/StatusNet,zcopley/StatusNet,bankonme/gnu-social,UngPirat/freesocial,d3vgru/StatusNet,faulteh/gnu-social,csarven/statusnet,foocorp/gnu-social,foocorp/gnu-social,sikevux/bsk-social,furtherfield/gnu-social,faulteh/gnu-social,eXcomm/gnu-social,xebia/statusnet-oauth2,chimo/social,eXcomm/gnu-social,Piratas/tortuga,charnimda/lgbtpzn-social,studio666/gnu-social,d3vgru/StatusNet,bankonme/gnu-social,gnusocial/mainline,csarven/statusnet,UngPirat/freesocial,gnusocial/mainline,foocorp/gnu-social,Piratas/tortuga,Piratas/tortuga,Piratas/tortuga,xebia/statusnet-oauth2,charnimda/lgbtpzn-social,furtherfield/gnu-social,bankonme/gnu-social,furtherfield/gnu-social,studio666/gnu-social,xebia/statusnet-oauth2,csarven/statusnet,charlycoste/StatusNet,minmb/statusnet,zcopley/StatusNet,furtherfield/gnu-social,eXcomm/gnu-social,studio666/gnu-social,eXcomm/gnu-social,csarven/statusnet,minmb/statusnet,sikevux/bsk-social,studio666/gnu-social,sikevux/bsk-social,sikevux/bsk-social,minmb/statusnet,gnusocial/mainline,gnusocial/mainline,d3vgru/StatusNet,zcopley/StatusNet,chimo/social,faulteh/gnu-social