|
2 | 2 |
|
3 | 3 | namespace Subfission\Cas;
|
4 | 4 |
|
| 5 | +use CAS_ServiceBaseUrl_Interface; |
5 | 6 | use phpCAS;
|
6 | 7 | use Psr\Log\LoggerInterface;
|
7 | 8 |
|
@@ -67,26 +68,76 @@ public function setLogger(LoggerInterface $logger = null): void
|
67 | 68 | phpCAS::setLogger($logger);
|
68 | 69 | }
|
69 | 70 |
|
| 71 | + /** |
| 72 | + * phpCAS client initializer. |
| 73 | + * |
| 74 | + * @param string $server_version the version of the CAS server |
| 75 | + * @param string $server_hostname the hostname of the CAS server |
| 76 | + * @param int $server_port the port the CAS server is running on |
| 77 | + * @param string $server_uri the URI the CAS server is responding on |
| 78 | + * @param string|string[]|CAS_ServiceBaseUrl_Interface |
| 79 | + * $service_base_url the base URL (protocol, host and the |
| 80 | + * optional port) of the CAS client; pass |
| 81 | + * in an array to use auto discovery with |
| 82 | + * an allowlist; pass in |
| 83 | + * CAS_ServiceBaseUrl_Interface for custom |
| 84 | + * behavior. Added in 1.6.0. Similar to |
| 85 | + * serverName config in other CAS clients. |
| 86 | + * @param bool $changeSessionID Allow phpCAS to change the session_id |
| 87 | + * (Single Sign Out/handleLogoutRequests |
| 88 | + * is based on that change) |
| 89 | + * @param \SessionHandlerInterface $sessionHandler the session handler |
| 90 | + * |
| 91 | + * @return void a newly created CAS_Client object |
| 92 | + * @note Only one of the phpCAS::client() and phpCAS::proxy functions should be |
| 93 | + * called, only once, and before all other methods (except phpCAS::getVersion() |
| 94 | + * and phpCAS::setDebug()). |
| 95 | + */ |
70 | 96 | public function client(
|
71 |
| - string $server_version, |
72 |
| - string $server_hostname, |
73 |
| - int $server_port, |
74 |
| - string $server_uri, |
75 |
| - string $service_base_url, |
76 |
| - bool $changeSessionID = true, |
77 |
| - \SessionHandlerInterface $sessionHandler = null |
| 97 | + $server_version, |
| 98 | + $server_hostname, |
| 99 | + $server_port, |
| 100 | + $server_uri, |
| 101 | + $service_base_url, |
| 102 | + $changeSessionID = true, |
| 103 | + $sessionHandler = null |
78 | 104 | ): void {
|
79 | 105 | phpCAS::client($server_version, $server_hostname, $server_port, $server_uri, $service_base_url, $changeSessionID, $sessionHandler);
|
80 | 106 | }
|
81 | 107 |
|
| 108 | + /** |
| 109 | + * phpCAS proxy initializer. |
| 110 | + * |
| 111 | + * @param string $server_version the version of the CAS server |
| 112 | + * @param string $server_hostname the hostname of the CAS server |
| 113 | + * @param string $server_port the port the CAS server is running on |
| 114 | + * @param string $server_uri the URI the CAS server is responding on |
| 115 | + * @param string|string[]|CAS_ServiceBaseUrl_Interface |
| 116 | + * $service_base_url the base URL (protocol, host and the |
| 117 | + * optional port) of the CAS client; pass |
| 118 | + * in an array to use auto discovery with |
| 119 | + * an allowlist; pass in |
| 120 | + * CAS_ServiceBaseUrl_Interface for custom |
| 121 | + * behavior. Added in 1.6.0. Similar to |
| 122 | + * serverName config in other CAS clients. |
| 123 | + * @param bool $changeSessionID Allow phpCAS to change the session_id |
| 124 | + * (Single Sign Out/handleLogoutRequests |
| 125 | + * is based on that change) |
| 126 | + * @param \SessionHandlerInterface $sessionHandler the session handler |
| 127 | + * |
| 128 | + * @return void a newly created CAS_Client object |
| 129 | + * @note Only one of the phpCAS::client() and phpCAS::proxy functions should be |
| 130 | + * called, only once, and before all other methods (except phpCAS::getVersion() |
| 131 | + * and phpCAS::setDebug()). |
| 132 | + */ |
82 | 133 | public function proxy(
|
83 |
| - string $server_version, |
84 |
| - string $server_hostname, |
85 |
| - int $server_port, |
86 |
| - string $server_uri, |
87 |
| - string $service_base_url, |
88 |
| - bool $changeSessionID = true, |
89 |
| - \SessionHandlerInterface $sessionHandler = null |
| 134 | + $server_version, |
| 135 | + $server_hostname, |
| 136 | + $server_port, |
| 137 | + $server_uri, |
| 138 | + $service_base_url, |
| 139 | + $changeSessionID = true, |
| 140 | + $sessionHandler = null |
90 | 141 | ): void {
|
91 | 142 | phpCAS::proxy($server_version, $server_hostname, $server_port, $server_uri, $service_base_url, $changeSessionID, $sessionHandler);
|
92 | 143 | }
|
|
0 commit comments