/[drupal]/contributions/modules/flickrmodule/flickr.module
ViewVC logotype

Diff of /contributions/modules/flickrmodule/flickr.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.8, Sat Aug 5 05:21:54 2006 UTC revision 1.9, Sat Aug 5 05:27:06 2006 UTC
# Line 177  function flickr_get_cached_file_contents Line 177  function flickr_get_cached_file_contents
177        // do nothing. XXX: Add stats code here.        // do nothing. XXX: Add stats code here.
178      }      }
179    else {    else {
180      $f  = fopen($file,"r");                  if (function_exists('curl_init')) {
181      $f2 = fopen($cache_filename,"w+");                          $ch = curl_init();
182      while ($r = fread($f,8192))                          curl_setopt($ch, CURLOPT_URL, $file);
183        {                          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
184          fwrite($f2,$r);                          $file_contents = curl_exec($ch);
185        }                          curl_close($ch);
186      fclose($f2);                  }
187      fclose($f);                  else {
188                      $file_contents = file_get_contents($file);
189                    }
190    
191                    $fh = fopen($cache_filename, 'w+');
192                    fwrite($fh, $file_contents);
193                    fclose($fh);
194    }    }
195    return file_get_contents ($cache_filename); // Return the file contents from the cache    return file_get_contents ($cache_filename); // Return the file contents from the cache
196  }  }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.2