You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,11 @@
1
+
# 1.0.2
2
+
3
+
* Made caching function and variable static to accommodate sites/apps that use more than one client or do backend processing of
4
+
multiple different patrons using saved tokens. If you were directly calling cache function or variable in your app, you will need to change those calls from static to non static
5
+
* Added access token to hash mechanism that creates hashes for request cache
6
+
* Added args to get_data function that calls the API
7
+
* Implemented a 'skip_read_from_cache' var to skip reading a request from cache in case it exists in the cache
8
+
1
9
# 1.0.0
2
10
3
11
* Library moved to use Patreon API v2 endpoints and calls
// Check if this request exists in the cache and if so, return it directly - avoids repeated requests to API in the same page run for same request string
85
85
86
-
if ( isset( self::$request_cache[$api_request_hash] ) ) {
87
-
returnself::$request_cache[$api_request_hash];
88
-
}
86
+
if ( !isset( $args['skip_read_from_cache'] ) ) {
87
+
if ( isset( $this->request_cache[$api_request_hash] ) ) {
88
+
return$this->request_cache[$api_request_hash];
89
+
}
90
+
}
89
91
90
92
// Request is new - actually perform the request
91
93
@@ -96,12 +98,12 @@ public function get_data($suffix) {
96
98
97
99
// don't try to parse a 500-class error, as it's likely not JSON
// This function manages the array that is used as the cache for API requests. What it does is to accept a md5 hash of entire query string (GET, with url, endpoint and options and all) and then add it to the request cache array
158
160
159
161
// If the cache array is larger than 50, snip the first item. This may be increased in future
0 commit comments