simplepie_get $cache_location parameter should be what's returned from simplepie_get_cache_location()

daph2001 - May 17, 2009 - 19:30
Project:SimplePie Core
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:active
Description

It would be better not to assume that the 2nd parameter to simplepie_get is relative to file_directory_path(). The main reason is that you can't use:

<?php

   simplepie_get
($url,simplepie_get_cache_location(),$cache_time);

?>

which means you have to call variable_get('simplepie_cache_location') from your own code.

#1

Freso - May 18, 2009 - 09:41
Version:6.x-1.0-beta1» 6.x-1.x-dev

Hm. I think I agree with you... but. I don't immediately see how to check whether the given path is relative or absolute. I see a few options here:

  1. Simply make the default argument NULL; that would trigger the else, which sets the cache location to simplepie_get_cache_location().
  2. Replace the current arguments, with an array argument. It would be trivial to add a "location relative to files dir" option then.

For this particular use case, you could use simplepie_get($url, NULL, $cache_time), I'm also mostly leaning towards replacing the default with that.

#2

daph2001 - September 24, 2009 - 15:00

It's a good solution - I now use NULL.

 
 

Drupal is a registered trademark of Dries Buytaert.