Browse code

added appinfo/info.xml appinfo/signature.json CHANGELOG.txt lib/AppInfo/Application.php css/style.css providers/Plivo

DoubleBastionAdmin authored on 05/11/2025 13:35:09
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,77 @@
1
+<?php
2
+
3
+namespace GuzzleHttp\Cookie;
4
+
5
+/**
6
+ * Persists cookies in the client session
7
+ */
8
+class SessionCookieJar extends CookieJar
9
+{
10
+    /**
11
+     * @var string session key
12
+     */
13
+    private $sessionKey;
14
+
15
+    /**
16
+     * @var bool Control whether to persist session cookies or not.
17
+     */
18
+    private $storeSessionCookies;
19
+
20
+    /**
21
+     * Create a new SessionCookieJar object
22
+     *
23
+     * @param string $sessionKey          Session key name to store the cookie
24
+     *                                    data in session
25
+     * @param bool   $storeSessionCookies Set to true to store session cookies
26
+     *                                    in the cookie jar.
27
+     */
28
+    public function __construct(string $sessionKey, bool $storeSessionCookies = false)
29
+    {
30
+        parent::__construct();
31
+        $this->sessionKey = $sessionKey;
32
+        $this->storeSessionCookies = $storeSessionCookies;
33
+        $this->load();
34
+    }
35
+
36
+    /**
37
+     * Saves cookies to session when shutting down
38
+     */
39
+    public function __destruct()
40
+    {
41
+        $this->save();
42
+    }
43
+
44
+    /**
45
+     * Save cookies to the client session
46
+     */
47
+    public function save(): void
48
+    {
49
+        $json = [];
50
+        /** @var SetCookie $cookie */
51
+        foreach ($this as $cookie) {
52
+            if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
53
+                $json[] = $cookie->toArray();
54
+            }
55
+        }
56
+
57
+        $_SESSION[$this->sessionKey] = \json_encode($json);
58
+    }
59
+
60
+    /**
61
+     * Load the contents of the client session into the data array
62
+     */
63
+    protected function load(): void
64
+    {
65
+        if (!isset($_SESSION[$this->sessionKey])) {
66
+            return;
67
+        }
68
+        $data = \json_decode($_SESSION[$this->sessionKey], true);
69
+        if (\is_array($data)) {
70
+            foreach ($data as $cookie) {
71
+                $this->setCookie(new SetCookie($cookie));
72
+            }
73
+        } elseif (\strlen($data)) {
74
+            throw new \RuntimeException('Invalid cookie data');
75
+        }
76
+    }
77
+}
Browse code

removed appinfo/info.xml appinfo/signature.json CHANGELOG.txt lib/AppInfo/Application.php css/style.css providers/Plivo

DoubleBastionAdmin authored on 05/11/2025 13:12:22
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,77 +0,0 @@
1
-<?php
2
-
3
-namespace GuzzleHttp\Cookie;
4
-
5
-/**
6
- * Persists cookies in the client session
7
- */
8
-class SessionCookieJar extends CookieJar
9
-{
10
-    /**
11
-     * @var string session key
12
-     */
13
-    private $sessionKey;
14
-
15
-    /**
16
-     * @var bool Control whether to persist session cookies or not.
17
-     */
18
-    private $storeSessionCookies;
19
-
20
-    /**
21
-     * Create a new SessionCookieJar object
22
-     *
23
-     * @param string $sessionKey          Session key name to store the cookie
24
-     *                                    data in session
25
-     * @param bool   $storeSessionCookies Set to true to store session cookies
26
-     *                                    in the cookie jar.
27
-     */
28
-    public function __construct(string $sessionKey, bool $storeSessionCookies = false)
29
-    {
30
-        parent::__construct();
31
-        $this->sessionKey = $sessionKey;
32
-        $this->storeSessionCookies = $storeSessionCookies;
33
-        $this->load();
34
-    }
35
-
36
-    /**
37
-     * Saves cookies to session when shutting down
38
-     */
39
-    public function __destruct()
40
-    {
41
-        $this->save();
42
-    }
43
-
44
-    /**
45
-     * Save cookies to the client session
46
-     */
47
-    public function save(): void
48
-    {
49
-        $json = [];
50
-        /** @var SetCookie $cookie */
51
-        foreach ($this as $cookie) {
52
-            if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
53
-                $json[] = $cookie->toArray();
54
-            }
55
-        }
56
-
57
-        $_SESSION[$this->sessionKey] = \json_encode($json);
58
-    }
59
-
60
-    /**
61
-     * Load the contents of the client session into the data array
62
-     */
63
-    protected function load(): void
64
-    {
65
-        if (!isset($_SESSION[$this->sessionKey])) {
66
-            return;
67
-        }
68
-        $data = \json_decode($_SESSION[$this->sessionKey], true);
69
-        if (\is_array($data)) {
70
-            foreach ($data as $cookie) {
71
-                $this->setCookie(new SetCookie($cookie));
72
-            }
73
-        } elseif (\strlen($data)) {
74
-            throw new \RuntimeException("Invalid cookie data");
75
-        }
76
-    }
77
-}
Browse code

Added README.md appinfo/info.xml appinfo/signature.json lib/Controller/AuthorApiController.php and the providers directory

DoubleBastionAdmin authored on 20/08/2022 16:33:00
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,77 @@
1
+<?php
2
+
3
+namespace GuzzleHttp\Cookie;
4
+
5
+/**
6
+ * Persists cookies in the client session
7
+ */
8
+class SessionCookieJar extends CookieJar
9
+{
10
+    /**
11
+     * @var string session key
12
+     */
13
+    private $sessionKey;
14
+
15
+    /**
16
+     * @var bool Control whether to persist session cookies or not.
17
+     */
18
+    private $storeSessionCookies;
19
+
20
+    /**
21
+     * Create a new SessionCookieJar object
22
+     *
23
+     * @param string $sessionKey          Session key name to store the cookie
24
+     *                                    data in session
25
+     * @param bool   $storeSessionCookies Set to true to store session cookies
26
+     *                                    in the cookie jar.
27
+     */
28
+    public function __construct(string $sessionKey, bool $storeSessionCookies = false)
29
+    {
30
+        parent::__construct();
31
+        $this->sessionKey = $sessionKey;
32
+        $this->storeSessionCookies = $storeSessionCookies;
33
+        $this->load();
34
+    }
35
+
36
+    /**
37
+     * Saves cookies to session when shutting down
38
+     */
39
+    public function __destruct()
40
+    {
41
+        $this->save();
42
+    }
43
+
44
+    /**
45
+     * Save cookies to the client session
46
+     */
47
+    public function save(): void
48
+    {
49
+        $json = [];
50
+        /** @var SetCookie $cookie */
51
+        foreach ($this as $cookie) {
52
+            if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
53
+                $json[] = $cookie->toArray();
54
+            }
55
+        }
56
+
57
+        $_SESSION[$this->sessionKey] = \json_encode($json);
58
+    }
59
+
60
+    /**
61
+     * Load the contents of the client session into the data array
62
+     */
63
+    protected function load(): void
64
+    {
65
+        if (!isset($_SESSION[$this->sessionKey])) {
66
+            return;
67
+        }
68
+        $data = \json_decode($_SESSION[$this->sessionKey], true);
69
+        if (\is_array($data)) {
70
+            foreach ($data as $cookie) {
71
+                $this->setCookie(new SetCookie($cookie));
72
+            }
73
+        } elseif (\strlen($data)) {
74
+            throw new \RuntimeException("Invalid cookie data");
75
+        }
76
+    }
77
+}