SimplePie::get_cache_filename()publicWP 1.0

Return the filename (i.e. hash, without path and without extension) of the file to cache a given URL.

Метод класса: SimplePie{}

Хуков нет.

Возвращает

Строку. A filename (i.e. hash, without path and without extension).

Использование

$SimplePie = new SimplePie();
$SimplePie->get_cache_filename( $url );
$url(строка) (обязательный)
The URL of the feed to be cached.

Код SimplePie::get_cache_filename() WP 6.3.1

public function get_cache_filename($url)
{
	// Append custom parameters to the URL to avoid cache pollution in case of multiple calls with different parameters.
	$url .= $this->force_feed ? '#force_feed' : '';
	$options = array();
	if ($this->timeout != 10)
	{
		$options[CURLOPT_TIMEOUT] = $this->timeout;
	}
	if ($this->useragent !== SIMPLEPIE_USERAGENT)
	{
		$options[CURLOPT_USERAGENT] = $this->useragent;
	}
	if (!empty($this->curl_options))
	{
		foreach ($this->curl_options as $k => $v)
		{
			$options[$k] = $v;
		}
	}
	if (!empty($options))
	{
		ksort($options);
		$url .= '#' . urlencode(var_export($options, true));
	}
	return call_user_func($this->cache_name_function, $url);
}