File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -21,17 +21,29 @@ class BrowserClient extends Client
2121 CURLOPT_TIMEOUT => 15
2222 );
2323
24+ protected static $ storage_dir ;
25+
2426 /** @var string Where the cookies are stored */
2527 protected $ cookie_file ;
2628
2729 public function __construct ()
2830 {
2931 parent ::__construct ();
3032
31- $ cookie_file = join (DIRECTORY_SEPARATOR , [sys_get_temp_dir (), "BrowserClient " ]);
33+ $ cookie_file = join (DIRECTORY_SEPARATOR , [static :: getStorageDirectory (), "BrowserClient " ]);
3234 $ this ->setCookieFile ($ cookie_file );
3335 }
3436
37+ protected function getStorageDirectory ()
38+ {
39+ return static ::$ storage_dir ? static ::$ storage_dir : sys_get_temp_dir ();
40+ }
41+
42+ public static function setStorageDirectory ($ path )
43+ {
44+ static ::$ storage_dir = $ path ;
45+ }
46+
3547 /**
3648 * Format ip:port or null to use direct connection
3749 * @param $proxy_server
You can’t perform that action at this time.
0 commit comments