YoastSEO_Vendor\GuzzleHttp\Cookie
FileCookieJar::save() public Yoast 1.0
Saves the cookies to a file.
{} Это метод класса: FileCookieJar{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$FileCookieJar = new FileCookieJar(); $FileCookieJar->save( $filename );
- $filename(строка) (обязательный)
- File to save
Код FileCookieJar::save() FileCookieJar::save Yoast 15.6.2
public function save($filename)
{
$json = [];
foreach ($this as $cookie) {
/** @var SetCookie $cookie */
if (\YoastSEO_Vendor\GuzzleHttp\Cookie\CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
$json[] = $cookie->toArray();
}
}
$jsonStr = \YoastSEO_Vendor\GuzzleHttp\json_encode($json);
if (\false === \file_put_contents($filename, $jsonStr)) {
throw new \RuntimeException("Unable to save file {$filename}");
}
}