Caching data from plugin execution

Discussion in 'Integration' started by skippybosco, May 3, 2010.

  1. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Caching data from plugin execution [SOLVED]

    I have a plugin that I'm developing that makes use of a 2 step token based authentication process.

    example:

    1) get token
    2) logon using API userid & token
    3) perform <action>
    4) logout API userid

    For efficiency, I'd like to cache the token information for a logged in token and only go through steps 1 & 2 when receiving an error from 3 that the token I am using is invalid. (essentially this would cut 4 steps down to 1 for each action). Since the actions are done against an external URL, the savings is fairly significant.

    It would be ideal to store it as an aMember config field, but having trouble figuring out how to do that from within a plugin.

    Any advice or suggestions would be appreciated!
  2. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    For those interested:

    $db->config_set('config_value_name','new_value','0');

Share This Page