Auth_OpenID_MemcachedStore.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <!-- template designed by Marco Von Ballmoos -->
  6. <title>Docs For Class Auth_OpenID_MemcachedStore</title>
  7. <link rel="stylesheet" href="../media/stylesheet.css" />
  8. <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
  9. </head>
  10. <body>
  11. <div class="page-body">
  12. <h2 class="class-name">Class Auth_OpenID_MemcachedStore</h2>
  13. <a name="sec-description"></a>
  14. <div class="info-box">
  15. <div class="info-box-title">Description</div>
  16. <div class="nav-bar">
  17. <span class="disabled">Description</span> |
  18. <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
  19. </div>
  20. <div class="info-box-body">
  21. <!-- ========== Info from phpDoc block ========= -->
  22. <p class="short-description">This is a memcached-based store for OpenID associations and nonces.</p>
  23. <p class="description"><p>As memcache has limit of 250 chars for key length, server_url, handle and salt are hashed with sha1().</p><p>Most of the methods of this class are implementation details. People wishing to just use this store need only pay attention to the constructor.</p></p>
  24. <ul class="tags">
  25. <li><span class="field">author:</span> JanRain, Inc. &lt;<a href="mailto:openid@janrain.com">openid@janrain.com</a>&gt;</li>
  26. </ul>
  27. <p class="notes">
  28. Located in <a class="field" href="_Auth---OpenID---MemcachedStore.php.html">/Auth/OpenID/MemcachedStore.php</a> (line <span class="field">36</span>)
  29. </p>
  30. <pre><a href="../OpenID/Auth_OpenID_OpenIDStore.html">Auth_OpenID_OpenIDStore</a>
  31. |
  32. --Auth_OpenID_MemcachedStore</pre>
  33. </div>
  34. </div>
  35. <a name="sec-method-summary"></a>
  36. <div class="info-box">
  37. <div class="info-box-title">Method Summary</span></div>
  38. <div class="nav-bar">
  39. <a href="#sec-description">Description</a> |
  40. <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
  41. </div>
  42. <div class="info-box-body">
  43. <div class="method-summary">
  44. <div class="method-definition">
  45. <span class="method-result">Auth_OpenID_MemcachedStore</span>
  46. <a href="#Auth_OpenID_MemcachedStore" title="details" class="method-name">Auth_OpenID_MemcachedStore</a>
  47. (<span class="var-type">resource</span>&nbsp;<span class="var-name">$connection</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$compress</span> = <span class="var-default">false</span>])
  48. </div>
  49. <div class="method-definition">
  50. <span class="method-result">void</span>
  51. <a href="#associationKey" title="details" class="method-name">associationKey</a>
  52. (<span class="var-type"></span>&nbsp;<span class="var-name">$server_url</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$handle</span> = <span class="var-default">null</span>])
  53. </div>
  54. <div class="method-definition">
  55. <span class="method-result">void</span>
  56. <a href="#associationServerKey" title="details" class="method-name">associationServerKey</a>
  57. (<span class="var-type"></span>&nbsp;<span class="var-name">$server_url</span>)
  58. </div>
  59. <div class="method-definition">
  60. <span class="method-result">void</span>
  61. <a href="#getAssociation" title="details" class="method-name">getAssociation</a>
  62. (<span class="var-type"></span>&nbsp;<span class="var-name">$server_url</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$handle</span> = <span class="var-default">null</span>])
  63. </div>
  64. <div class="method-definition">
  65. <span class="method-result">void</span>
  66. <a href="#removeAssociation" title="details" class="method-name">removeAssociation</a>
  67. (<span class="var-type"></span>&nbsp;<span class="var-name">$server_url</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$handle</span>)
  68. </div>
  69. <div class="method-definition">
  70. <span class="method-result">void</span>
  71. <a href="#storeAssociation" title="details" class="method-name">storeAssociation</a>
  72. (<span class="var-type"></span>&nbsp;<span class="var-name">$server_url</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$association</span>)
  73. </div>
  74. <div class="method-definition">
  75. <span class="method-result">void</span>
  76. <a href="#supportsCleanup" title="details" class="method-name">supportsCleanup</a>
  77. ()
  78. </div>
  79. <div class="method-definition">
  80. <span class="method-result">void</span>
  81. <a href="#useNonce" title="details" class="method-name">useNonce</a>
  82. (<span class="var-type"></span>&nbsp;<span class="var-name">$server_url</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$timestamp</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$salt</span>)
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <a name="sec-methods"></a>
  88. <div class="info-box">
  89. <div class="info-box-title">Methods</div>
  90. <div class="nav-bar">
  91. <a href="#sec-description">Description</a> |
  92. <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
  93. </div>
  94. <div class="info-box-body">
  95. <A NAME='method_detail'></A>
  96. <a name="methodAuth_OpenID_MemcachedStore" id="Auth_OpenID_MemcachedStore"><!-- --></a>
  97. <div class="evenrow">
  98. <div class="method-header">
  99. <span class="method-title">Constructor Auth_OpenID_MemcachedStore</span> (line <span class="line-number">44</span>)
  100. </div>
  101. <!-- ========== Info from phpDoc block ========= -->
  102. <p class="short-description">Initializes a new <a href="../OpenID/Auth_OpenID_MemcachedStore.html">Auth_OpenID_MemcachedStore</a> instance.</p>
  103. <p class="description"><p>Just saves memcached object as property.</p></p>
  104. <div class="method-signature">
  105. <span class="method-result">Auth_OpenID_MemcachedStore</span>
  106. <span class="method-name">
  107. Auth_OpenID_MemcachedStore
  108. </span>
  109. (<span class="var-type">resource</span>&nbsp;<span class="var-name">$connection</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$compress</span> = <span class="var-default">false</span>])
  110. </div>
  111. <ul class="parameters">
  112. <li>
  113. <span class="var-type">resource</span>
  114. <span class="var-name">$connection</span><span class="var-description">: connection Memcache connection resourse</span> </li>
  115. <li>
  116. <span class="var-type"></span>
  117. <span class="var-name">$compress</span> </li>
  118. </ul>
  119. </div>
  120. <a name="methodassociationKey" id="associationKey"><!-- --></a>
  121. <div class="oddrow">
  122. <div class="method-header">
  123. <span class="method-title">associationKey</span> (line <span class="line-number">186</span>)
  124. </div>
  125. <!-- ========== Info from phpDoc block ========= -->
  126. <p class="short-description">Memcache key is prefixed with 'openid_association_' string.</p>
  127. <div class="method-signature">
  128. <span class="method-result">void</span>
  129. <span class="method-name">
  130. associationKey
  131. </span>
  132. (<span class="var-type"></span>&nbsp;<span class="var-name">$server_url</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$handle</span> = <span class="var-default">null</span>])
  133. </div>
  134. <ul class="parameters">
  135. <li>
  136. <span class="var-type"></span>
  137. <span class="var-name">$server_url</span> </li>
  138. <li>
  139. <span class="var-type"></span>
  140. <span class="var-name">$handle</span> </li>
  141. </ul>
  142. </div>
  143. <a name="methodassociationServerKey" id="associationServerKey"><!-- --></a>
  144. <div class="evenrow">
  145. <div class="method-header">
  146. <span class="method-title">associationServerKey</span> (line <span class="line-number">194</span>)
  147. </div>
  148. <!-- ========== Info from phpDoc block ========= -->
  149. <p class="short-description">Memcache key is prefixed with 'openid_association_' string.</p>
  150. <div class="method-signature">
  151. <span class="method-result">void</span>
  152. <span class="method-name">
  153. associationServerKey
  154. </span>
  155. (<span class="var-type"></span>&nbsp;<span class="var-name">$server_url</span>)
  156. </div>
  157. <ul class="parameters">
  158. <li>
  159. <span class="var-type"></span>
  160. <span class="var-name">$server_url</span> </li>
  161. </ul>
  162. </div>
  163. <a name="methodgetAssociation" id="getAssociation"><!-- --></a>
  164. <div class="oddrow">
  165. <div class="method-header">
  166. <span class="method-title">getAssociation</span> (line <span class="line-number">91</span>)
  167. </div>
  168. <!-- ========== Info from phpDoc block ========= -->
  169. <p class="short-description">Read association from memcached. If no handle given</p>
  170. <p class="description"><p>and multiple associations found, returns latest issued</p></p>
  171. <div class="method-signature">
  172. <span class="method-result">void</span>
  173. <span class="method-name">
  174. getAssociation
  175. </span>
  176. (<span class="var-type"></span>&nbsp;<span class="var-name">$server_url</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$handle</span> = <span class="var-default">null</span>])
  177. </div>
  178. <ul class="parameters">
  179. <li>
  180. <span class="var-type"></span>
  181. <span class="var-name">$server_url</span> </li>
  182. <li>
  183. <span class="var-type"></span>
  184. <span class="var-name">$handle</span> </li>
  185. </ul>
  186. <hr class="separator" />
  187. <div class="notes">Redefinition of:</div>
  188. <dl>
  189. <dt><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodgetAssociation">Auth_OpenID_OpenIDStore::getAssociation()</a></dt>
  190. <dd>This method returns an Association object from storage that matches the server URL and, if specified, handle. It returns null if no such association is found or if the matching association is expired.</dd>
  191. </dl>
  192. </div>
  193. <a name="methodremoveAssociation" id="removeAssociation"><!-- --></a>
  194. <div class="evenrow">
  195. <div class="method-header">
  196. <span class="method-title">removeAssociation</span> (line <span class="line-number">125</span>)
  197. </div>
  198. <!-- ========== Info from phpDoc block ========= -->
  199. <p class="short-description">Immediately delete association from memcache.</p>
  200. <div class="method-signature">
  201. <span class="method-result">void</span>
  202. <span class="method-name">
  203. removeAssociation
  204. </span>
  205. (<span class="var-type"></span>&nbsp;<span class="var-name">$server_url</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$handle</span>)
  206. </div>
  207. <ul class="parameters">
  208. <li>
  209. <span class="var-type"></span>
  210. <span class="var-name">$server_url</span> </li>
  211. <li>
  212. <span class="var-type"></span>
  213. <span class="var-name">$handle</span> </li>
  214. </ul>
  215. <hr class="separator" />
  216. <div class="notes">Redefinition of:</div>
  217. <dl>
  218. <dt><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodremoveAssociation">Auth_OpenID_OpenIDStore::removeAssociation()</a></dt>
  219. <dd>This method removes the matching association if it's found, and returns whether the association was removed or not.</dd>
  220. </dl>
  221. </div>
  222. <a name="methodstoreAssociation" id="storeAssociation"><!-- --></a>
  223. <div class="oddrow">
  224. <div class="method-header">
  225. <span class="method-title">storeAssociation</span> (line <span class="line-number">55</span>)
  226. </div>
  227. <!-- ========== Info from phpDoc block ========= -->
  228. <p class="short-description">Store association until its expiration time in memcached.</p>
  229. <p class="description"><p>Overwrites any existing association with same server_url and handle. Handles list of associations for every server.</p></p>
  230. <div class="method-signature">
  231. <span class="method-result">void</span>
  232. <span class="method-name">
  233. storeAssociation
  234. </span>
  235. (<span class="var-type"></span>&nbsp;<span class="var-name">$server_url</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$association</span>)
  236. </div>
  237. <ul class="parameters">
  238. <li>
  239. <span class="var-type"></span>
  240. <span class="var-name">$server_url</span> </li>
  241. <li>
  242. <span class="var-type"></span>
  243. <span class="var-name">$association</span> </li>
  244. </ul>
  245. <hr class="separator" />
  246. <div class="notes">Redefinition of:</div>
  247. <dl>
  248. <dt><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodstoreAssociation">Auth_OpenID_OpenIDStore::storeAssociation()</a></dt>
  249. <dd>This method puts an Association object into storage, retrievable by server URL and handle.</dd>
  250. </dl>
  251. </div>
  252. <a name="methodsupportsCleanup" id="supportsCleanup"><!-- --></a>
  253. <div class="evenrow">
  254. <div class="method-header">
  255. <span class="method-title">supportsCleanup</span> (line <span class="line-number">202</span>)
  256. </div>
  257. <!-- ========== Info from phpDoc block ========= -->
  258. <p class="short-description">Report that this storage doesn't support cleanup</p>
  259. <div class="method-signature">
  260. <span class="method-result">void</span>
  261. <span class="method-name">
  262. supportsCleanup
  263. </span>
  264. ()
  265. </div>
  266. <hr class="separator" />
  267. <div class="notes">Redefinition of:</div>
  268. <dl>
  269. <dt><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodsupportsCleanup">Auth_OpenID_OpenIDStore::supportsCleanup()</a></dt>
  270. <dd>Report whether this storage supports cleanup</dd>
  271. </dl>
  272. </div>
  273. <a name="methoduseNonce" id="useNonce"><!-- --></a>
  274. <div class="oddrow">
  275. <div class="method-header">
  276. <span class="method-title">useNonce</span> (line <span class="line-number">165</span>)
  277. </div>
  278. <!-- ========== Info from phpDoc block ========= -->
  279. <p class="short-description">Create nonce for server and salt, expiring after $Auth_OpenID_SKEW seconds.</p>
  280. <div class="method-signature">
  281. <span class="method-result">void</span>
  282. <span class="method-name">
  283. useNonce
  284. </span>
  285. (<span class="var-type"></span>&nbsp;<span class="var-name">$server_url</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$timestamp</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$salt</span>)
  286. </div>
  287. <ul class="parameters">
  288. <li>
  289. <span class="var-type"></span>
  290. <span class="var-name">$server_url</span> </li>
  291. <li>
  292. <span class="var-type"></span>
  293. <span class="var-name">$timestamp</span> </li>
  294. <li>
  295. <span class="var-type"></span>
  296. <span class="var-name">$salt</span> </li>
  297. </ul>
  298. <hr class="separator" />
  299. <div class="notes">Redefinition of:</div>
  300. <dl>
  301. <dt><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methoduseNonce">Auth_OpenID_OpenIDStore::useNonce()</a></dt>
  302. <dd>Called when using a nonce.</dd>
  303. </dl>
  304. </div>
  305. <h4>Inherited Methods</h4>
  306. <a name='inherited_methods'><!-- --></a>
  307. <!-- =========== Summary =========== -->
  308. <p>Inherited From <span class="classname"><a href="../OpenID/Auth_OpenID_OpenIDStore.html">Auth_OpenID_OpenIDStore</a></span></p>
  309. <blockquote>
  310. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodcleanup">Auth_OpenID_OpenIDStore::cleanup()</a></span><br>
  311. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodcleanupAssociations">Auth_OpenID_OpenIDStore::cleanupAssociations()</a></span><br>
  312. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodcleanupNonces">Auth_OpenID_OpenIDStore::cleanupNonces()</a></span><br>
  313. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodgetAssociation">Auth_OpenID_OpenIDStore::getAssociation()</a></span><br>
  314. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodremoveAssociation">Auth_OpenID_OpenIDStore::removeAssociation()</a></span><br>
  315. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodreset">Auth_OpenID_OpenIDStore::reset()</a></span><br>
  316. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodstoreAssociation">Auth_OpenID_OpenIDStore::storeAssociation()</a></span><br>
  317. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodsupportsCleanup">Auth_OpenID_OpenIDStore::supportsCleanup()</a></span><br>
  318. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methoduseNonce">Auth_OpenID_OpenIDStore::useNonce()</a></span><br>
  319. </blockquote>
  320. </div>
  321. </div>
  322. <p class="notes" id="credit">
  323. Documentation generated on Tue, 21 Apr 2009 11:31:31 -0700 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.2</a>
  324. </p>
  325. </div></body>
  326. </html>