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

You appear to be a bot. Output may be restricted

Description

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

Usage

$string = SimplePie::get_cache_filename( $url );

Parameters

$url
( string ) required – The URL of the feed to be cached.

Returns

string A filename (i.e. hash, without path and without extension).

Source

File name: wordpress/wp-includes/class-simplepie.php


Lines:

1 to 28 of 28
  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->SimplePie::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);
  }
 

 View on GitHub View on Trac