File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,6 +47,14 @@ class Client
4747 */
4848 protected $ timeout = 5 ;
4949
50+ /**
51+ * Cookie storage path
52+ *
53+ * @var int $cookie [= false]
54+ * @access protected
55+ */
56+ protected $ cookie = false ;
57+
5058 /**
5159 * Instance of DatingVIP\cURL\Request lib.
5260 *
@@ -100,6 +108,20 @@ public function setTimeout($timeout)
100108 : $ this ->timeout = $ timeout ;
101109 }
102110
111+ /**
112+ * Set cookie storage file
113+ *
114+ * @param string $file
115+ * @access public
116+ * @return bool
117+ */
118+ public function setCookieStorage ($ file )
119+ {
120+ $ this ->cookie = (string ) $ file ;
121+
122+ return !empty ($ this ->cookie );
123+ }
124+
103125 /**
104126 * Execute API command.
105127 *
@@ -157,6 +179,10 @@ private function curl()
157179 $ this ->curl ->setCredentials ($ this ->user , $ this ->pass );
158180 }
159181
182+ if ($ this ->cookie && is_writeable (dirname ($ this ->cookie ))) {
183+ $ this ->curl ->setCookieStorage ($ this ->cookie );
184+ }
185+
160186 return $ this ->curl ->setTimeout ($ this ->timeout );
161187 }
162188
You can’t perform that action at this time.
0 commit comments