Index: trunk/extensions/OpenID/Consumer.php |
— | — | @@ -50,13 +50,15 @@ |
51 | 51 | # Where to store transitory data. Can be 'memc' for the $wgMemc |
52 | 52 | # global caching object, or 'file' if caching is turned off |
53 | 53 | # completely and you need a fallback. |
| 54 | + |
| 55 | + # Default is memc unless the global cache is disabled. |
54 | 56 | |
55 | | - $wgOpenIDConsumerStoreType = 'memc'; |
| 57 | + $wgOpenIDConsumerStoreType = ($wgMainCacheType == CACHE_NONE) ? 'file' : 'memc'; |
56 | 58 | |
57 | 59 | # If the store type is set to 'file', this is is the name of a |
58 | 60 | # directory to store the data in. |
59 | 61 | |
60 | | - $wgOpenIDConsumerStorePath = NULL; |
| 62 | + $wgOpenIDConsumerStorePath = ($wgMainCacheType == CACHE_NONE) ? "/tmp/$wgDBname/openidconsumer/" : NULL; |
61 | 63 | |
62 | 64 | # Expiration time for the OpenID cookie. Lets the user re-authenticate |
63 | 65 | # automatically if their session is expired. Only really useful if |
Index: trunk/extensions/OpenID/OpenID.php |
— | — | @@ -172,6 +172,13 @@ |
173 | 173 | return new OpenID_MemcStore($prefix); |
174 | 174 | |
175 | 175 | case 'file': |
| 176 | + # Auto-create path if it doesn't exist |
| 177 | + if (!is_dir($options['path'])) { |
| 178 | + if (!mkdir($options['path'], 0770, true)) { |
| 179 | + $wgOut->errorPage('openidconfigerror', 'openidconfigerrortext'); |
| 180 | + return NULL; |
| 181 | + } |
| 182 | + } |
176 | 183 | return new Auth_OpenID_FileStore($options['path']); |
177 | 184 | |
178 | 185 | default: |
Index: trunk/extensions/OpenID/Server.php |
— | — | @@ -37,12 +37,12 @@ |
38 | 38 | # global caching object, or 'file' if caching is turned off |
39 | 39 | # completely and you need a fallback. |
40 | 40 | |
41 | | - $wgOpenIDServerStoreType = 'memc'; |
| 41 | + $wgOpenIDServerStoreType = ($wgMainCacheType == CACHE_NONE) ? 'file' : 'memc'; |
42 | 42 | |
43 | 43 | # If the store type is set to 'file', this is is the name of a |
44 | 44 | # directory to store the data in. |
45 | 45 | |
46 | | - $wgOpenIDServerStorePath = NULL; |
| 46 | + $wgOpenIDServerStorePath = ($wgMainCacheType == CACHE_NONE) ? "/tmp/$wgDBname/openidserver/" : NULL; |
47 | 47 | |
48 | 48 | # Outputs a Yadis (http://yadis.org/) XRDS file, saying that this server |
49 | 49 | # supports OpenID and lots of other jazz. |
Index: trunk/extensions/OpenID/README |
— | — | @@ -242,14 +242,18 @@ |
243 | 243 | one or both is "file", $wgOpenIDConsumerStorePath or |
244 | 244 | $wgOpenIDServerStorePath must be set, respectively (see below). If |
245 | 245 | either of these variables is set to an invalid value, an error page |
246 | | - will be displayed. |
| 246 | + will be displayed. The default is "memc", unless the main cache is |
| 247 | + set to CACHE_NONE (default for MW), in which case it is "file". |
247 | 248 | |
248 | 249 | * $wgOpenIDConsumerStorePath and $wgOpenIDServerStorePath -- strings |
249 | 250 | specifying the paths where OpenID assocation data should be stored |
250 | 251 | when acting as a relying party (consumer) or server, respectively. |
251 | 252 | Each of these need only be set if the store type settings (above) |
252 | 253 | are set to "file", respectively. These strings, if both are set, |
253 | | - MUST NOT be equal. |
| 254 | + MUST NOT be equal. If the store type is "file", the default here is |
| 255 | + "/tmp/$wgDBname/openidconsumer/" and "/tmp/$wgDBname/openidserver/" |
| 256 | + respectively. The path will be automatically created if it doesn't |
| 257 | + exist at runtime. |
254 | 258 | |
255 | 259 | == Skins == |
256 | 260 | |