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: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ should be changed to:
19
19
## New OAuth2 PKCE Authentication effective April 1, 2022
20
20
As of March 31, 2022, Constant Contact will no longer be supporting versions of this library before 22.3. You must upgrade you app on the Constant Contact site. A new secret is also suggested. You must also upgrade to the 22.3 version of this library. The only code change needed is to pass the parameter array ($_GET) to acquireAccessToken instead of the single code parameter.
21
21
22
-
This library now requires PHP Session support for authentication. See [PHP Manual](https://www.php.net/manual/en/session.security.php) and [a good best practices article](https://www.phparch.com/2018/01/php-sessions-in-depth/).
22
+
This library now requires PHP Session support for authentication. See [PHP Manual](https://www.php.net/manual/en/session.security.php) and [a good best practices article](https://www.phparch.com/2018/01/php-sessions-in-depth/). You can provide your own session management by specifying a callback with **setSessionCallback**.
23
23
24
24
## Namespaces
25
25
This library normalizes the [Constant Contact API](https://v3.developer.constantcontact.com/api_guide/index.html) to modern PHP class standards. All endpoints are first character capitialized. Underscores are removed and followed by a capital letter. Each end point is a class with methods matching the standard REST methods (ie. put, post, delete, put, etc.). The methods take required and optional parameters matching the name specified in the Constant Contact YAML API. In addition, this library supports all definitions of types in the API. See below.
Copy file name to clipboardExpand all lines: src/ConstantContact/Client.php
+69-13Lines changed: 69 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,14 @@
2
2
3
3
namespacePHPFUI\ConstantContact;
4
4
5
+
/**
6
+
* The Client class needs to store authentication information between PHP sessions in order to function correctly. The class defaults to normal PHP $_SESSION handling,
7
+
* but you can specify a callback via **setSessionCallback** to provide a different persistence model. The callback function signature is:
8
+
*
9
+
* @param string $key used to store or retrieve $value
10
+
* @param ?string $value if null, value should be returned and key deleted, if not null, value should be stored by key.
11
+
* @return string $value from store or value passed in on set (ignored)
12
+
*/
5
13
class Client
6
14
{
7
15
publicstring$accessToken = '';
@@ -26,13 +34,14 @@ class Client
26
34
27
35
privatestring$next = '';
28
36
37
+
private$sessionCallback = null;
38
+
29
39
/**
30
40
* Construct a client.
31
41
*
32
-
* By default, all scopes are enabled. You can remove any, or
33
-
* set new ones.
42
+
* By default, all scopes are enabled. You can remove any, or set new ones.
0 commit comments