Permalink
Browse files

initial import of experimental YOS PHP5 Social SDK

  • Loading branch information...
1 parent 753cd39 commit 202169a1843c8cdff7c5d99dcf6ae1fc918a4f77 @dustinwhittle dustinwhittle committed Aug 20, 2009
Showing with 46,879 additions and 0 deletions.
  1. 0 LICENSE
  2. +136 −0 README.markdown
  3. +33 −0 docs/OPENID
  4. +60 −0 examples/common.inc.php
  5. +80 −0 examples/simpleauth/css/simpleauth.css
  6. BIN examples/simpleauth/img/indicator.gif
  7. BIN examples/simpleauth/img/lo-y-gsmall.gif
  8. BIN examples/simpleauth/img/nrm-grey.png
  9. +58 −0 examples/simpleauth/js/simpleauth.js
  10. +200 −0 examples/simpleauth/simpleauth.php
  11. +12 −0 examples/simpleauth/xrds.xml
  12. +68 −0 examples/yql.php
  13. +22 −0 lib/OAuth/LICENSE
  14. +780 −0 lib/OAuth/OAuth.php
  15. +74 −0 lib/OAuth/example/SimpleOAuthDataStore.php
  16. +14 −0 lib/OAuth/example/access_token.php
  17. +133 −0 lib/OAuth/example/client.php
  18. +26 −0 lib/OAuth/example/common.inc.php
  19. +21 −0 lib/OAuth/example/echo_api.php
  20. +108 −0 lib/OAuth/example/index.php
  21. +14 −0 lib/OAuth/example/request_token.php
  22. +552 −0 lib/OpenID/Auth/OpenID.php
  23. +1,023 −0 lib/OpenID/Auth/OpenID/AX.php
  24. +613 −0 lib/OpenID/Auth/OpenID/Association.php
  25. +471 −0 lib/OpenID/Auth/OpenID/BigMath.php
  26. +2,230 −0 lib/OpenID/Auth/OpenID/Consumer.php
  27. +109 −0 lib/OpenID/Auth/OpenID/CryptUtil.php
  28. +131 −0 lib/OpenID/Auth/OpenID/DatabaseConnection.php
  29. +113 −0 lib/OpenID/Auth/OpenID/DiffieHellman.php
  30. +548 −0 lib/OpenID/Auth/OpenID/Discover.php
  31. +100 −0 lib/OpenID/Auth/OpenID/DumbStore.php
  32. +62 −0 lib/OpenID/Auth/OpenID/Extension.php
  33. +618 −0 lib/OpenID/Auth/OpenID/FileStore.php
  34. +99 −0 lib/OpenID/Auth/OpenID/HMAC.php
  35. +197 −0 lib/OpenID/Auth/OpenID/Interface.php
  36. +112 −0 lib/OpenID/Auth/OpenID/KVForm.php
  37. +208 −0 lib/OpenID/Auth/OpenID/MemcachedStore.php
  38. +920 −0 lib/OpenID/Auth/OpenID/Message.php
  39. +78 −0 lib/OpenID/Auth/OpenID/MySQLStore.php
  40. +109 −0 lib/OpenID/Auth/OpenID/Nonce.php
  41. +91 −0 lib/OpenID/Auth/OpenID/OAuth.php
  42. +301 −0 lib/OpenID/Auth/OpenID/PAPE.php
  43. +352 −0 lib/OpenID/Auth/OpenID/Parse.php
  44. +113 −0 lib/OpenID/Auth/OpenID/PostgreSQLStore.php
  45. +569 −0 lib/OpenID/Auth/OpenID/SQLStore.php
  46. +71 −0 lib/OpenID/Auth/OpenID/SQLiteStore.php
  47. +521 −0 lib/OpenID/Auth/OpenID/SReg.php
  48. +1,760 −0 lib/OpenID/Auth/OpenID/Server.php
  49. +37 −0 lib/OpenID/Auth/OpenID/ServerRequest.php
  50. +462 −0 lib/OpenID/Auth/OpenID/TrustRoot.php
  51. +249 −0 lib/OpenID/Auth/OpenID/URINorm.php
  52. +147 −0 lib/OpenID/Auth/Yadis/HTTPFetcher.php
  53. +529 −0 lib/OpenID/Auth/Yadis/Manager.php
  54. +59 −0 lib/OpenID/Auth/Yadis/Misc.php
  55. +226 −0 lib/OpenID/Auth/Yadis/ParanoidHTTPFetcher.php
  56. +259 −0 lib/OpenID/Auth/Yadis/ParseHTML.php
  57. +249 −0 lib/OpenID/Auth/Yadis/PlainHTTPFetcher.php
  58. +374 −0 lib/OpenID/Auth/Yadis/XML.php
  59. +478 −0 lib/OpenID/Auth/Yadis/XRDS.php
  60. +234 −0 lib/OpenID/Auth/Yadis/XRI.php
  61. +72 −0 lib/OpenID/Auth/Yadis/XRIRes.php
  62. +382 −0 lib/OpenID/Auth/Yadis/Yadis.php
  63. +202 −0 lib/OpenID/LICENSE
  64. +139 −0 lib/OpenID/README
  65. +134 −0 lib/OpenID/examples/README
  66. +97 −0 lib/OpenID/examples/consumer/common.php
  67. +98 −0 lib/OpenID/examples/consumer/finish_auth.php
  68. +73 −0 lib/OpenID/examples/consumer/index.php
  69. +83 −0 lib/OpenID/examples/consumer/try_auth.php
  70. +517 −0 lib/OpenID/examples/detect.php
  71. +100 −0 lib/OpenID/examples/discover.php
  72. +5 −0 lib/OpenID/examples/server/index.php
  73. +164 −0 lib/OpenID/examples/server/lib/actions.php
  74. +95 −0 lib/OpenID/examples/server/lib/common.php
  75. +114 −0 lib/OpenID/examples/server/lib/render.php
  76. +58 −0 lib/OpenID/examples/server/lib/render/about.php
  77. +32 −0 lib/OpenID/examples/server/lib/render/idpXrds.php
  78. +31 −0 lib/OpenID/examples/server/lib/render/idpage.php
  79. +65 −0 lib/OpenID/examples/server/lib/render/login.php
  80. +56 −0 lib/OpenID/examples/server/lib/render/trust.php
  81. +34 −0 lib/OpenID/examples/server/lib/render/userXrds.php
  82. +178 −0 lib/OpenID/examples/server/lib/session.php
  83. +74 −0 lib/OpenID/examples/server/openid-server.css
  84. +48 −0 lib/OpenID/examples/server/server.php
  85. +558 −0 lib/OpenID/examples/server/setup.php
  86. +33 −0 lib/OpenSocial/auth/osapiAuth.php
  87. +37 −0 lib/OpenSocial/auth/osapiFCAuth.php
  88. +39 −0 lib/OpenSocial/auth/osapiHttpBasic.php
  89. +120 −0 lib/OpenSocial/auth/osapiOAuth2Legged.php
  90. +198 −0 lib/OpenSocial/auth/osapiOAuth3Legged.php
  91. +53 −0 lib/OpenSocial/auth/osapiSecurityToken.php
  92. +770 −0 lib/OpenSocial/external/OAuth.php
  93. +207 −0 lib/OpenSocial/external/XrdsSimpleParser.php
  94. +69 −0 lib/OpenSocial/io/osapiBatch.php
  95. +90 −0 lib/OpenSocial/io/osapiCurlProvider.php
  96. +30 −0 lib/OpenSocial/io/osapiHttpProvider.php
  97. +109 −0 lib/OpenSocial/io/osapiIO.php
  98. +83 −0 lib/OpenSocial/io/osapiLocalHttpProvider.php
  99. +88 −0 lib/OpenSocial/io/osapiRequest.php
  100. +184 −0 lib/OpenSocial/io/osapiRestIO.php
  101. +123 −0 lib/OpenSocial/io/osapiRpcIO.php
  102. +37 −0 lib/OpenSocial/logger/osapiAppender.php
  103. +38 −0 lib/OpenSocial/logger/osapiConsoleAppender.php
  104. +38 −0 lib/OpenSocial/logger/osapiDummyAppender.php
  105. +106 −0 lib/OpenSocial/logger/osapiFileAppender.php
  106. +118 −0 lib/OpenSocial/logger/osapiLogger.php
  107. +73 −0 lib/OpenSocial/model/osapiAccount.php
  108. +185 −0 lib/OpenSocial/model/osapiActivity.php
  109. +126 −0 lib/OpenSocial/model/osapiAddress.php
  110. +77 −0 lib/OpenSocial/model/osapiBodyType.php
  111. +97 −0 lib/OpenSocial/model/osapiCollection.php
  112. +28 −0 lib/OpenSocial/model/osapiComplexField.php
  113. +27 −0 lib/OpenSocial/model/osapiEmail.php
  114. +107 −0 lib/OpenSocial/model/osapiEnum.php
  115. +53 −0 lib/OpenSocial/model/osapiError.php
  116. +63 −0 lib/OpenSocial/model/osapiIdSpec.php
  117. +27 −0 lib/OpenSocial/model/osapiIm.php
  118. +62 −0 lib/OpenSocial/model/osapiListField.php
  119. +67 −0 lib/OpenSocial/model/osapiMediaItem.php
  120. +125 −0 lib/OpenSocial/model/osapiMessage.php
  121. +46 −0 lib/OpenSocial/model/osapiModel.php
  122. +89 −0 lib/OpenSocial/model/osapiName.php
  123. +144 −0 lib/OpenSocial/model/osapiOrganization.php
  124. +618 −0 lib/OpenSocial/model/osapiPerson.php
  125. +27 −0 lib/OpenSocial/model/osapiPhone.php
  126. +27 −0 lib/OpenSocial/model/osapiPhoto.php
  127. +45 −0 lib/OpenSocial/model/osapiUrl.php
  128. +136 −0 lib/OpenSocial/osapi.php
  129. +27 −0 lib/OpenSocial/providers/osapiFriendConnectProvider.php
  130. +46 −0 lib/OpenSocial/providers/osapiGoogleProvider.php
  131. +26 −0 lib/OpenSocial/providers/osapiHi5Provider.php
  132. +106 −0 lib/OpenSocial/providers/osapiMySpaceProvider.php
  133. +26 −0 lib/OpenSocial/providers/osapiNetlogProvider.php
  134. +111 −0 lib/OpenSocial/providers/osapiOrkutProvider.php
  135. +76 −0 lib/OpenSocial/providers/osapiPartuzaProvider.php
  136. +116 −0 lib/OpenSocial/providers/osapiPlaxoProvider.php
  137. +80 −0 lib/OpenSocial/providers/osapiProvider.php
  138. +84 −0 lib/OpenSocial/providers/osapiXrdsProvider.php
  139. +119 −0 lib/OpenSocial/service/osapiActivities.php
  140. +134 −0 lib/OpenSocial/service/osapiAppData.php
  141. +48 −0 lib/OpenSocial/service/osapiMessages.php
  142. +95 −0 lib/OpenSocial/service/osapiPeople.php
  143. +94 −0 lib/OpenSocial/service/osapiService.php
  144. +56 −0 lib/OpenSocial/service/osapiSystem.php
  145. +97 −0 lib/OpenSocial/storage/osapiApcStorage.php
  146. +135 −0 lib/OpenSocial/storage/osapiFileStorage.php
  147. +126 −0 lib/OpenSocial/storage/osapiMemcacheStorage.php
  148. +55 −0 lib/OpenSocial/storage/osapiStorage.php
  149. +170 −0 lib/Yahoo/YahooCurl.class.php
  150. +97 −0 lib/Yahoo/YahooOAuthAccessToken.class.php
  151. +315 −0 lib/Yahoo/YahooOAuthApplication.class.php
  152. +42 −0 lib/Yahoo/YahooOAuthApplicationException.class.php
  153. +92 −0 lib/Yahoo/YahooOAuthClient.class.php
  154. +85 −0 lib/Yahoo/YahooOAuthRequestToken.class.php
  155. +58 −0 lib/Yahoo/YahooYQLQuery.class.php
  156. 0 test/AllTests.php
  157. +12 −0 test/unit/OAuth/Mock_OAuthBaseStringRequest.php
  158. +57 −0 test/unit/OAuth/Mock_OAuthDataStore.php
  159. +47 −0 test/unit/OAuth/Mock_OAuthSignatureMethod_RSA_SHA1.php
  160. +10 −0 test/unit/OAuth/OAuthConsumerTest.php
  161. +314 −0 test/unit/OAuth/OAuthRequestTest.php
  162. +225 −0 test/unit/OAuth/OAuthServerTest.php
  163. +60 −0 test/unit/OAuth/OAuthSignatureMethodHmacSha1Test.php
  164. +79 −0 test/unit/OAuth/OAuthSignatureMethodPlaintextTest.php
  165. +43 −0 test/unit/OAuth/OAuthSignatureMethodRsaSha1Test.php
  166. +13 −0 test/unit/OAuth/OAuthTests.xml
  167. +20 −0 test/unit/OAuth/OAuthTokenTest.php
  168. +133 −0 test/unit/OAuth/OAuthUtilTest.php
  169. +106 −0 test/unit/OAuth/OAuth_TestServer.php
  170. +64 −0 test/unit/OAuth/common.php
  171. +794 −0 test/unit/OpenID/Auth/OpenID/AX.php
  172. +55 −0 test/unit/OpenID/Auth/OpenID/Association.php
  173. +379 −0 test/unit/OpenID/Auth/OpenID/AssociationResponse.php
  174. +302 −0 test/unit/OpenID/Auth/OpenID/AuthRequest.php
  175. +235 −0 test/unit/OpenID/Auth/OpenID/BigMath.php
  176. +2,556 −0 test/unit/OpenID/Auth/OpenID/Consumer.php
  177. +56 −0 test/unit/OpenID/Auth/OpenID/CryptUtil.php
  178. +160 −0 test/unit/OpenID/Auth/OpenID/DiffieHellman.php
  179. +783 −0 test/unit/OpenID/Auth/OpenID/Discover_OpenID.php
  180. +46 −0 test/unit/OpenID/Auth/OpenID/Extension.php
  181. +166 −0 test/unit/OpenID/Auth/OpenID/HMAC.php
  182. +261 −0 test/unit/OpenID/Auth/OpenID/KVForm.php
  183. +176 −0 test/unit/OpenID/Auth/OpenID/MemStore.php
  184. +1,252 −0 test/unit/OpenID/Auth/OpenID/Message.php
  185. +348 −0 test/unit/OpenID/Auth/OpenID/Negotiation.php
  186. +167 −0 test/unit/OpenID/Auth/OpenID/Nonce.php
  187. +230 −0 test/unit/OpenID/Auth/OpenID/OpenID_Yadis.php
  188. +246 −0 test/unit/OpenID/Auth/OpenID/PAPE.php
  189. +186 −0 test/unit/OpenID/Auth/OpenID/Parse.php
  190. +299 −0 test/unit/OpenID/Auth/OpenID/RPVerify.php
  191. +675 −0 test/unit/OpenID/Auth/OpenID/SReg.php
  192. +2,464 −0 test/unit/OpenID/Auth/OpenID/Server.php
  193. +705 −0 test/unit/OpenID/Auth/OpenID/StoreTest.php
  194. +62 −0 test/unit/OpenID/Auth/OpenID/TestUtil.php
  195. +173 −0 test/unit/OpenID/Auth/OpenID/TrustRoot.php
  196. +68 −0 test/unit/OpenID/Auth/OpenID/URINorm.php
  197. +320 −0 test/unit/OpenID/Auth/OpenID/Util.php
  198. +424 −0 test/unit/OpenID/Auth/OpenID/VerifyDisco.php
  199. +25 −0 test/unit/OpenID/Auth/OpenID/data/dhexch
  200. +29 −0 test/unit/OpenID/Auth/OpenID/data/dhpriv
  201. +49 −0 test/unit/OpenID/Auth/OpenID/data/hmac-sha1.txt
  202. +29 −0 test/unit/OpenID/Auth/OpenID/data/hmac-sha256.txt
  203. +594 −0 test/unit/OpenID/Auth/OpenID/data/linkparse.txt
  204. +650 −0 test/unit/OpenID/Auth/OpenID/data/n2b64
  205. +11 −0 test/unit/OpenID/Auth/OpenID/data/openid.html
  206. +11 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_openid.html
  207. +11 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_openid2.html
  208. +12 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_openid2_xrds.xml
  209. +11 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_openid2_xrds_no_local_id.xml
  210. +11 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_openid_1_and_2.html
  211. +16 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_openid_1_and_2_xrds.xml
  212. +17 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_openid_1_and_2_xrds_bad_delegate.xml
  213. +12 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_openid_and_yadis.html
  214. +10 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_openid_no_delegate.html
  215. +19 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_openid_ssl.xml
  216. +12 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_yadis_0entries.xml
  217. +15 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_yadis_2_bad_local_id.xml
  218. +22 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_yadis_2entries_delegate.xml
  219. +21 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_yadis_2entries_idp.xml
  220. +14 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_yadis_another_delegate.xml
  221. +12 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_yadis_idp.xml
  222. +13 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_yadis_idp_delegate.xml
  223. +11 −0 test/unit/OpenID/Auth/OpenID/data/test_discover_yadis_no_delegate.xml
  224. +149 −0 test/unit/OpenID/Auth/OpenID/data/trustroot.txt
  225. +87 −0 test/unit/OpenID/Auth/OpenID/data/urinorm.txt
  226. +153 −0 test/unit/OpenID/Auth/Yadis/DiscoverData.php
  227. +232 −0 test/unit/OpenID/Auth/Yadis/Discover_Yadis.php
  228. +88 −0 test/unit/OpenID/Auth/Yadis/ParseHTML.php
  229. +30 −0 test/unit/OpenID/Auth/Yadis/TestUtil.php
  230. +249 −0 test/unit/OpenID/Auth/Yadis/XRDS.php
  231. +144 −0 test/unit/OpenID/Auth/Yadis/XRI.php
  232. +90 −0 test/unit/OpenID/Auth/Yadis/Yadis.php
  233. +12 −0 test/unit/OpenID/Auth/Yadis/data/README
  234. +118 −0 test/unit/OpenID/Auth/Yadis/data/accept.txt
  235. +38 −0 test/unit/OpenID/Auth/Yadis/data/brian.multi.xrds
  236. +16 −0 test/unit/OpenID/Auth/Yadis/data/brian.multi_uri.xrds
  237. +16 −0 test/unit/OpenID/Auth/Yadis/data/brian.xrds
  238. +22 −0 test/unit/OpenID/Auth/Yadis/data/brian_priority.xrds
  239. +34 −0 test/unit/OpenID/Auth/Yadis/data/delegated-20060809-r1.xrds
  240. +34 −0 test/unit/OpenID/Auth/Yadis/data/delegated-20060809-r2.xrds
  241. +34 −0 test/unit/OpenID/Auth/Yadis/data/delegated-20060809.xrds
  242. +14 −0 test/unit/OpenID/Auth/Yadis/data/example-xrds.xml
  243. +7 −0 test/unit/OpenID/Auth/Yadis/data/no-xrd.xml
  244. +2 −0 test/unit/OpenID/Auth/Yadis/data/not-xrds.xml
  245. +22 −0 test/unit/OpenID/Auth/Yadis/data/pip.xrds
  246. +34 −0 test/unit/OpenID/Auth/Yadis/data/prefixsometimes.xrds
  247. +109 −0 test/unit/OpenID/Auth/Yadis/data/ref.xrds
  248. +34 −0 test/unit/OpenID/Auth/Yadis/data/sometimesprefix.xrds
  249. +25 −0 test/unit/OpenID/Auth/Yadis/data/spoof1.xrds
  250. +25 −0 test/unit/OpenID/Auth/Yadis/data/spoof2.xrds
  251. +37 −0 test/unit/OpenID/Auth/Yadis/data/spoof3.xrds
  252. +58 −0 test/unit/OpenID/Auth/Yadis/data/subsegments.xrds
  253. +137 −0 test/unit/OpenID/Auth/Yadis/data/test1-discover.txt
  254. +149 −0 test/unit/OpenID/Auth/Yadis/data/test1-parsehtml.txt
  255. +39 −0 test/unit/OpenID/Auth/Yadis/data/test1-xrd.xml
  256. +16 −0 test/unit/OpenID/Auth/Yadis/data/uri_priority.xrds
  257. +201 −0 test/unit/OpenID/TestDriver.php
  258. +22 −0 test/unit/Yahoo/YahooOAuthApplicationTest.php
  259. +37 −0 test/unit/Yahoo/YahooYQLQueryTest.php
View
No changes.
View
@@ -0,0 +1,136 @@
+Yahoo! Social SDK - PHP5
+==========================
+
+Find documentation and support on Yahoo! Developer Network: http://developer.yahoo.com
+
+ * Yahoo! Application Platform - http://developer.yahoo.com/yap/
+ * Yahoo! Social APIs - http://developer.yahoo.com/social/
+ * Yahoo! Query Language - http://developer.yahoo.com/yql/
+
+Hosted on GitHub: http://github.com/yahoo/yos-social-php5/tree/master
+
+License
+=======
+
+@copyright: Copyrights for code authored by Yahoo! Inc. is licensed under the following terms:
+@license: BSD Open Source License
+
+Yahoo! Social SDK
+Software License Agreement (BSD License)
+Copyright (c) 2009, Yahoo! Inc.
+All rights reserved.
+
+Redistribution and use of this software in source and binary forms, with
+or without modification, are permitted provided that the following
+conditions are met:
+
+* Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the
+ following disclaimer.
+
+* Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the
+ following disclaimer in the documentation and/or other
+ materials provided with the distribution.
+
+* Neither the name of Yahoo! Inc. nor the names of its
+ contributors may be used to endorse or promote products
+ derived from this software without specific prior
+ written permission of Yahoo! Inc.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+The Yahoo! Social PHP SDK code is subject to the BSD license, see the LICENSE file.
+
+
+Requirements
+============
+
+The following dependencies are bundled with the Yahoo! PHP SDK, but are under
+terms of a separate license. See the bundled LICENSE files for more information:
+
+ * OAuth - http://code.google.com/p/oauth
+ * OpenID - http://www.openidenabled.com/php-openid/
+ * OpenSocial - http://code.google.com/p/opensocial-php-client/
+ * JSON - http://pear.php.net/Services_JSON
+
+
+=======
+
+After downloading and unpacking the release, copy the contents of 'lib'
+to a directory that is accessible via the PHP include_path method.
+
+
+Examples
+========
+
+## Fetching YQL:
+
+ $yql = new YahooYQLQuery();
+ $response = $yql->execute('select * from delicious.feeds.popular');
+
+ if(isset($response->query) && isset($response->query->results))
+ {
+ var_dump($response->query->results);
+ }
+ elseif(isset($response->error))
+ {
+ print sprintf('YQL query failed with error: "%s".', $response->error->description);
+ }
+ else
+ {
+ print 'YQL response malformed.';
+ }
+
+
+## Fetching Social Data:
+
+ # Yahoo! OAuth Credentials - http://developer.yahoo.com/dashboard/
+
+ $CONSUMER_KEY = '##';
+ $CONSUMER_SECRET = '##';
+ $APPLICATION_ID = '##';
+ $CALLBACK_URL = '##';
+
+ $oauthapp = new YahooOAuthApplication($CONSUMER_KEY, $CONSUMER_SECRET, $APPLICATION_ID, $CALLBACK_URL);
+
+ # Fetch request token
+ $request_token = $oauthapp->getRequestToken();
+
+ # Redirect user to authorization url
+ $redirect_url = $oauthapp->getAuthorizationUrl($request_token, $CALLBACK_URL);
+
+ # Exchange request token for authorized access token
+ $access_token = $oauthapp->getAccessToken($request_token);
+
+ # update access token
+ $oauthapp->token = $access_token;
+
+ # fetch user profile
+ $profile = $oauthapp->getProfile();
+
+ var_dump($profile);
+
+
+## Signing with SimpleAuth (OpenID + OAuth):
+
+ See the bundled sample code in examples/simpleauth/simpleauth.php.
+
+
+Tests
+=====
+
+The Yahoo! PHP SDK comes with a test suite to validate functionality. The tests also
+show functional examples and results. To run the test suite, simply execute the test suite:
+
+ php phpunit test/AllTests.php
View
@@ -0,0 +1,33 @@
+<?php
+
+$openid_store = new Auth_OpenID_FileStore(sys_get_temp_dir().'/openid2.db');
+$openid_consumer = new Auth_OpenID_Consumer($openid_store);
+
+$auth_request = $openid_consumer->begin('https://yahoo.com');
+$auth_request->addExtension(new Auth_OpenID_OAuthRequest(OAUTH_CONSUMER_KEY));
+
+// For OpenID 1, send a redirect. For OpenID 2, use a Javascript
+if ($auth_request->shouldSendRedirect()) {
+ header('Location: '.$auth_request->redirectURL(OAUTH_DOMAIN, OAUTH_DOMAIN)); exit;
+} else {
+ $content = $auth_request->htmlMarkup(OAUTH_DOMAIN, OAUTH_DOMAIN, false, array('id' => 'openid'));
+}
+
+$response = $consumer->complete($return_to);
+if ($response->status == Auth_OpenID_CANCEL) {
+ $msg = 'Verification cancelled.';
+} else if ($response->status == Auth_OpenID_FAILURE) {
+ $msg = "OpenID authentication failed: " . $response->message;
+} else if ($response->status == Auth_OpenID_SUCCESS) {
+ $openid = $response->getDisplayIdentifier();
+ $esc_identity = escape($openid);
+ $success = sprintf('You have successfully verified <a href="%s">%s</a> as your identity.<br><br>Here\'s your Yahoo! profile data fetched using the Yahoo! REST APIs', $esc_identity, $esc_identity);
+ if ($response->endpoint->canonicalID) {
+ $escaped_canonicalID = escape($response->endpoint->canonicalID);
+ $success .= ' (XRI CanonicalID: '.$escaped_canonicalID.') ';
+ }
+
+$oauth_resp = Auth_OpenID_OAuthResponse::fromSuccessResponse($response);
+$authorized_request_token = $oauth_resp->authorized_request_token;
+$authorized_verifier = $oauth_resp->authorized_verifier;
+}
@@ -0,0 +1,60 @@
+<?php
+
+# session storage
+ini_set('session.save_handler', 'files');
+session_save_path('/tmp/');
+session_start();
+
+# utf8
+mb_internal_encoding('UTF-8');
+mb_http_output('UTF-8');
+ob_start('mb_output_handler');
+
+# debug settings
+error_reporting(E_ALL); # | E_STRICT
+
+
+# set include path (required for openid libs)
+set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__).'/../../lib/openid/'.PATH_SEPARATOR.dirname(__FILE__).'/../../lib/');
+
+/**
+ * OAuth - http://oauth.googlecode.com/svn/code/php/
+ */
+require_once 'OAuth/OAuth.php';
+
+
+/**
+ * OpenID - http://www.openidenabled.com/php-openid/
+ */
+
+/**
+ * Require OpenID consumer.
+ */
+require_once "Auth/OpenID/Consumer.php";
+
+/**
+ * Require OpenID filestore.
+ */
+require_once "Auth/OpenID/FileStore.php";
+
+/**
+ * Require SReg Extension.
+ */
+require_once "Auth/OpenID/SReg.php";
+
+/**
+ * Require PAPE extension.
+ */
+require_once "Auth/OpenID/PAPE.php";
+
+/**
+ * Require OAuth extension.
+ */
+require_once "Auth/OpenID/OAuth.php";
+
+
+/**
+ * Require Yahoo! PHP5 SDK libraries
+ */
+require_once 'Yahoo/YahooOAuthApplication.class.php';
+
@@ -0,0 +1,80 @@
+
+body {
+ text-align: left;
+}
+
+img {
+ border: 0;
+}
+
+a {
+ text-decoration: none;
+ font-weight: bold;
+}
+
+/** yahoo signin button **/
+div.authbar {
+ width: 98%;
+ text-align: right;
+ display: block;
+}
+
+div#ysimpleauth-login { margin: 10px; padding: 4px; text-align: left; }
+
+span.svy-sg { margin:0;overflow:hidden;display:inline; }
+span.svy-sg a { border:0;overflow:visible;padding:0px;margin:4px;text-decoration:none;font: 100% times,verdana,sans-serif;cursor:pointer;float:left;*white-space:nowrap; }
+span.svy-sg span {float:left;position:relative; top:4px; left:4px; background:url(../img/nrm-grey.png) no-repeat 100% 100%;color:#000;font-weight:normal; }
+span.svy-sg span span { background-position:0 100%;top:0;left:-8px; }
+span.svy-sg span span span {background-position:0 0;top:-8px;left:0;margin-bottom:-4px; }
+span.svy-sg span span span span { background-position:100% 0;top:0;left:8px;margin-bottom:0;padding:4px 8px 0px 0px; }
+span.svy-sg span span span span span {left:0px;padding:0 48px 0 0;background:url(../img/lo-y-gsmall.gif) no-repeat 100% 50%; }
+span.svy-sg span span span span span.rtext {float:left;padding:0 0 0 3px;background:none; }
+
+/** yahoo login window overlay **/
+.yui-overlay-content { background-color: #000; font-size:93%; color: #fff; filter:alpha(opacity=0.6); opacity: 0.6; -moz-opacity: 0.6; z-index: 20000; width: 100%; height: 100%; margin:0; padding:0; border:0 }
+
+#profile, #updates, #socialgraph {
+ margin: 4em;
+ display: block;
+}
+
+#updates ul li, #socialgraph ul li {
+ list-style-type: none;
+ margin: 4px;
+ vertical-align: middle;
+}
+
+#updates ul li img, #socialgraph ul li img {
+ padding-top: 1px;
+ padding-right: 4px;
+}
+
+#socialgraph ul li {
+ display: inline;
+ padding: 1px;
+}
+
+
+/** vcard **/
+.vcard {
+ width: 24em;
+ color: #000;
+ text-align: left;
+ font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
+}
+
+.fn {
+ padding-top: 3em;
+ font-weight: bold;
+ font-size: 123.1%;
+}
+
+.vcard img {
+ float: left;
+ margin: 6px;
+}
+
+.vcard em {
+ margin-top: 1em;
+ display: block;
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,58 @@
+YUI({combine: true, timeout: 10000}).use('node', 'event', 'io', 'overlay', 'dump', 'json-parse', function (Y) {
+
+ if(Y.Node.get('#ysimpleauth-login'))
+ {
+ Y.on('click', function (e) {
+
+ // prevent default
+ e.preventDefault();
+
+ // create overlay + loading indicator
+ var overlay = new Y.Overlay({
+ width: '100%',
+ height: '100%',
+ bodyContent: '<div style="text-align: center; padding: 10px;">Signing in... <img width="43px" height="11px" src="img/indicator.gif" alt="Please finish signing in..." /></div>',
+ zIndex: 10000,
+ visible: true
+ });
+ overlay.render('body');
+ overlay.show();
+
+ // open popup window
+ var height = 500;
+ var width = 500;
+
+ var left = Math.max(0, Math.floor((e.target.get('winWidth') - width) / 2));
+ var top = Math.max(0, Math.floor((e.target.get('winHeight') - height) / 2));
+
+ var simpleauth = window.open('simpleauth.php?openid_mode=discover&popup=true', 'simpleauth', 'location=yes,status=yes,resizable=true,width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
+
+ // hide overlay when popup closes
+
+ // focus popup
+ simpleauth.window.focus();
+
+ // wait until oauth completes
+
+ // close popup window and refresh page for access token
+ popupMonitor = window.setTimeout(checkPopup, 500);
+ function checkPopup() {
+
+ if(false == simpleauth.closed)
+ {
+ simpleauth.window.focus();
+
+ popupMonitor = window.setTimeout(checkPopup, 500);
+ }
+ else
+ {
+ overlay.hide();
+ // window.location = 'simpleauth.php?openid_mode=oauth';
+ window.clearInterval();
+ }
+ }
+
+ }, '#ysimpleauth-login');
+ }
+
+});
Oops, something went wrong. Retry.

0 comments on commit 202169a

Please sign in to comment.