Auth_OpenID_FileStore.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  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_FileStore</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_FileStore</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 filesystem-based store for OpenID associations and</p>
  23. <p class="description"><p>nonces. This store should be safe for use in concurrent systems on both windows and unix (excluding NFS filesystems). There are a couple race conditions in the system, but those failure cases have been set up in such a way that the worst-case behavior is someone having to try to log in a second time.</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---FileStore.php.html">/Auth/OpenID/FileStore.php</a> (line <span class="field">39</span>)
  29. </p>
  30. <pre><a href="../OpenID/Auth_OpenID_OpenIDStore.html">Auth_OpenID_OpenIDStore</a>
  31. |
  32. --Auth_OpenID_FileStore</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_FileStore</span>
  46. <a href="#Auth_OpenID_FileStore" title="details" class="method-name">Auth_OpenID_FileStore</a>
  47. (<span class="var-type">string</span>&nbsp;<span class="var-name">$directory</span>)
  48. </div>
  49. <div class="method-definition">
  50. <span class="method-result">void</span>
  51. <a href="#clean" title="details" class="method-name">clean</a>
  52. ()
  53. </div>
  54. <div class="method-definition">
  55. <span class="method-result">void</span>
  56. <a href="#cleanupAssociations" title="details" class="method-name">cleanupAssociations</a>
  57. ()
  58. </div>
  59. <div class="method-definition">
  60. <span class="method-result">void</span>
  61. <a href="#cleanupNonces" title="details" class="method-name">cleanupNonces</a>
  62. ()
  63. </div>
  64. <div class="method-definition">
  65. <span class="method-result">void</span>
  66. <a href="#destroy" title="details" class="method-name">destroy</a>
  67. ()
  68. </div>
  69. <div class="method-definition">
  70. <span class="method-result">mixed</span>
  71. <a href="#getAssociation" title="details" class="method-name">getAssociation</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">$handle</span> = <span class="var-default">null</span>])
  73. </div>
  74. <div class="method-definition">
  75. <span class="method-result">string</span>
  76. <a href="#getAssociationFilename" title="details" class="method-name">getAssociationFilename</a>
  77. (<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>)
  78. </div>
  79. <div class="method-definition">
  80. <span class="method-result">bool</span>
  81. <a href="#removeAssociation" title="details" class="method-name">removeAssociation</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">$handle</span>)
  83. </div>
  84. <div class="method-definition">
  85. <span class="method-result">void</span>
  86. <a href="#storeAssociation" title="details" class="method-name">storeAssociation</a>
  87. (<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>)
  88. </div>
  89. <div class="method-definition">
  90. <span class="method-result">bool</span>
  91. <a href="#useNonce" title="details" class="method-name">useNonce</a>
  92. (<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>)
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. <a name="sec-methods"></a>
  98. <div class="info-box">
  99. <div class="info-box-title">Methods</div>
  100. <div class="nav-bar">
  101. <a href="#sec-description">Description</a> |
  102. <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
  103. </div>
  104. <div class="info-box-body">
  105. <A NAME='method_detail'></A>
  106. <a name="methodAuth_OpenID_FileStore" id="Auth_OpenID_FileStore"><!-- --></a>
  107. <div class="oddrow">
  108. <div class="method-header">
  109. <span class="method-title">Constructor Auth_OpenID_FileStore</span> (line <span class="line-number">49</span>)
  110. </div>
  111. <!-- ========== Info from phpDoc block ========= -->
  112. <p class="short-description">Initializes a new <a href="../OpenID/Auth_OpenID_FileStore.html">Auth_OpenID_FileStore</a>. This initializes the nonce and association directories, which are subdirectories of the directory passed in.</p>
  113. <div class="method-signature">
  114. <span class="method-result">Auth_OpenID_FileStore</span>
  115. <span class="method-name">
  116. Auth_OpenID_FileStore
  117. </span>
  118. (<span class="var-type">string</span>&nbsp;<span class="var-name">$directory</span>)
  119. </div>
  120. <ul class="parameters">
  121. <li>
  122. <span class="var-type">string</span>
  123. <span class="var-name">$directory</span><span class="var-description">: This is the directory to put the store directories in.</span> </li>
  124. </ul>
  125. </div>
  126. <a name="methodclean" id="clean"><!-- --></a>
  127. <div class="evenrow">
  128. <div class="method-header">
  129. <span class="method-title">clean</span> (line <span class="line-number">440</span>)
  130. </div>
  131. <!-- ========== Info from phpDoc block ========= -->
  132. <div class="method-signature">
  133. <span class="method-result">void</span>
  134. <span class="method-name">
  135. clean
  136. </span>
  137. ()
  138. </div>
  139. </div>
  140. <a name="methodcleanupAssociations" id="cleanupAssociations"><!-- --></a>
  141. <div class="oddrow">
  142. <div class="method-header">
  143. <span class="method-title">cleanupAssociations</span> (line <span class="line-number">604</span>)
  144. </div>
  145. <!-- ========== Info from phpDoc block ========= -->
  146. <div class="method-signature">
  147. <span class="method-result">void</span>
  148. <span class="method-name">
  149. cleanupAssociations
  150. </span>
  151. ()
  152. </div>
  153. <hr class="separator" />
  154. <div class="notes">Redefinition of:</div>
  155. <dl>
  156. <dt><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodcleanupAssociations">Auth_OpenID_OpenIDStore::cleanupAssociations()</a></dt>
  157. </dl>
  158. </div>
  159. <a name="methodcleanupNonces" id="cleanupNonces"><!-- --></a>
  160. <div class="evenrow">
  161. <div class="method-header">
  162. <span class="method-title">cleanupNonces</span> (line <span class="line-number">119</span>)
  163. </div>
  164. <!-- ========== Info from phpDoc block ========= -->
  165. <div class="method-signature">
  166. <span class="method-result">void</span>
  167. <span class="method-name">
  168. cleanupNonces
  169. </span>
  170. ()
  171. </div>
  172. <hr class="separator" />
  173. <div class="notes">Redefinition of:</div>
  174. <dl>
  175. <dt><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodcleanupNonces">Auth_OpenID_OpenIDStore::cleanupNonces()</a></dt>
  176. </dl>
  177. </div>
  178. <a name="methoddestroy" id="destroy"><!-- --></a>
  179. <div class="oddrow">
  180. <div class="method-header">
  181. <span class="method-title">destroy</span> (line <span class="line-number">77</span>)
  182. </div>
  183. <!-- ========== Info from phpDoc block ========= -->
  184. <div class="method-signature">
  185. <span class="method-result">void</span>
  186. <span class="method-name">
  187. destroy
  188. </span>
  189. ()
  190. </div>
  191. </div>
  192. <a name="methodgetAssociation" id="getAssociation"><!-- --></a>
  193. <div class="evenrow">
  194. <div class="method-header">
  195. <span class="method-title">getAssociation</span> (line <span class="line-number">232</span>)
  196. </div>
  197. <!-- ========== Info from phpDoc block ========= -->
  198. <p class="short-description">Retrieve an association. If no handle is specified, return the association with the most recent issue time.</p>
  199. <div class="method-signature">
  200. <span class="method-result">mixed</span>
  201. <span class="method-name">
  202. getAssociation
  203. </span>
  204. (<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>])
  205. </div>
  206. <ul class="parameters">
  207. <li>
  208. <span class="var-type"></span>
  209. <span class="var-name">$server_url</span> </li>
  210. <li>
  211. <span class="var-type"></span>
  212. <span class="var-name">$handle</span> </li>
  213. </ul>
  214. <hr class="separator" />
  215. <div class="notes">Redefinition of:</div>
  216. <dl>
  217. <dt><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodgetAssociation">Auth_OpenID_OpenIDStore::getAssociation()</a></dt>
  218. <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>
  219. </dl>
  220. </div>
  221. <a name="methodgetAssociationFilename" id="getAssociationFilename"><!-- --></a>
  222. <div class="oddrow">
  223. <div class="method-header">
  224. <span class="method-title">getAssociationFilename</span> (line <span class="line-number">150</span>)
  225. </div>
  226. <!-- ========== Info from phpDoc block ========= -->
  227. <p class="short-description">Create a unique filename for a given server url and</p>
  228. <p class="description"><p>handle. This implementation does not assume anything about the format of the handle. The filename that is returned will contain the domain name from the server URL for ease of human inspection of the data directory.</p></p>
  229. <div class="method-signature">
  230. <span class="method-result">string</span>
  231. <span class="method-name">
  232. getAssociationFilename
  233. </span>
  234. (<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>)
  235. </div>
  236. <ul class="parameters">
  237. <li>
  238. <span class="var-type"></span>
  239. <span class="var-name">$server_url</span> </li>
  240. <li>
  241. <span class="var-type"></span>
  242. <span class="var-name">$handle</span> </li>
  243. </ul>
  244. </div>
  245. <a name="methodremoveAssociation" id="removeAssociation"><!-- --></a>
  246. <div class="evenrow">
  247. <div class="method-header">
  248. <span class="method-title">removeAssociation</span> (line <span class="line-number">338</span>)
  249. </div>
  250. <!-- ========== Info from phpDoc block ========= -->
  251. <p class="short-description">Remove an association if it exists. Do nothing if it does not.</p>
  252. <div class="method-signature">
  253. <span class="method-result">bool</span>
  254. <span class="method-name">
  255. removeAssociation
  256. </span>
  257. (<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>)
  258. </div>
  259. <ul class="parameters">
  260. <li>
  261. <span class="var-type"></span>
  262. <span class="var-name">$server_url</span> </li>
  263. <li>
  264. <span class="var-type"></span>
  265. <span class="var-name">$handle</span> </li>
  266. </ul>
  267. <hr class="separator" />
  268. <div class="notes">Redefinition of:</div>
  269. <dl>
  270. <dt><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodremoveAssociation">Auth_OpenID_OpenIDStore::removeAssociation()</a></dt>
  271. <dd>This method removes the matching association if it's found, and returns whether the association was removed or not.</dd>
  272. </dl>
  273. </div>
  274. <a name="methodstoreAssociation" id="storeAssociation"><!-- --></a>
  275. <div class="oddrow">
  276. <div class="method-header">
  277. <span class="method-title">storeAssociation</span> (line <span class="line-number">182</span>)
  278. </div>
  279. <!-- ========== Info from phpDoc block ========= -->
  280. <p class="short-description">Store an association in the association directory.</p>
  281. <div class="method-signature">
  282. <span class="method-result">void</span>
  283. <span class="method-name">
  284. storeAssociation
  285. </span>
  286. (<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>)
  287. </div>
  288. <ul class="parameters">
  289. <li>
  290. <span class="var-type"></span>
  291. <span class="var-name">$server_url</span> </li>
  292. <li>
  293. <span class="var-type"></span>
  294. <span class="var-name">$association</span> </li>
  295. </ul>
  296. <hr class="separator" />
  297. <div class="notes">Redefinition of:</div>
  298. <dl>
  299. <dt><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodstoreAssociation">Auth_OpenID_OpenIDStore::storeAssociation()</a></dt>
  300. <dd>This method puts an Association object into storage, retrievable by server URL and handle.</dd>
  301. </dl>
  302. </div>
  303. <a name="methoduseNonce" id="useNonce"><!-- --></a>
  304. <div class="evenrow">
  305. <div class="method-header">
  306. <span class="method-title">useNonce</span> (line <span class="line-number">360</span>)
  307. </div>
  308. <!-- ========== Info from phpDoc block ========= -->
  309. <p class="short-description">Return whether this nonce is present. As a side effect, mark it as no longer present.</p>
  310. <div class="method-signature">
  311. <span class="method-result">bool</span>
  312. <span class="method-name">
  313. useNonce
  314. </span>
  315. (<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>)
  316. </div>
  317. <ul class="parameters">
  318. <li>
  319. <span class="var-type"></span>
  320. <span class="var-name">$server_url</span> </li>
  321. <li>
  322. <span class="var-type"></span>
  323. <span class="var-name">$timestamp</span> </li>
  324. <li>
  325. <span class="var-type"></span>
  326. <span class="var-name">$salt</span> </li>
  327. </ul>
  328. <hr class="separator" />
  329. <div class="notes">Redefinition of:</div>
  330. <dl>
  331. <dt><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methoduseNonce">Auth_OpenID_OpenIDStore::useNonce()</a></dt>
  332. <dd>Called when using a nonce.</dd>
  333. </dl>
  334. </div>
  335. <h4>Inherited Methods</h4>
  336. <a name='inherited_methods'><!-- --></a>
  337. <!-- =========== Summary =========== -->
  338. <p>Inherited From <span class="classname"><a href="../OpenID/Auth_OpenID_OpenIDStore.html">Auth_OpenID_OpenIDStore</a></span></p>
  339. <blockquote>
  340. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodcleanup">Auth_OpenID_OpenIDStore::cleanup()</a></span><br>
  341. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodcleanupAssociations">Auth_OpenID_OpenIDStore::cleanupAssociations()</a></span><br>
  342. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodcleanupNonces">Auth_OpenID_OpenIDStore::cleanupNonces()</a></span><br>
  343. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodgetAssociation">Auth_OpenID_OpenIDStore::getAssociation()</a></span><br>
  344. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodremoveAssociation">Auth_OpenID_OpenIDStore::removeAssociation()</a></span><br>
  345. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodreset">Auth_OpenID_OpenIDStore::reset()</a></span><br>
  346. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodstoreAssociation">Auth_OpenID_OpenIDStore::storeAssociation()</a></span><br>
  347. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methodsupportsCleanup">Auth_OpenID_OpenIDStore::supportsCleanup()</a></span><br>
  348. <span class="method-name"><a href="../OpenID/Auth_OpenID_OpenIDStore.html#methoduseNonce">Auth_OpenID_OpenIDStore::useNonce()</a></span><br>
  349. </blockquote>
  350. </div>
  351. </div>
  352. <p class="notes" id="credit">
  353. 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>
  354. </p>
  355. </div></body>
  356. </html>