You are here

function _yr_verdata_local_file in Yr Weatherdata 6.2

Same name and namespace in other branches
  1. 7 yr_verdata.module \_yr_verdata_local_file()

Function for resolving directory location and initiating a local file for storing the xml.

Parameters

$location:

Return value

Returns the file destination for loading and saving data.

3 calls to _yr_verdata_local_file()
yr_verdata_generate in ./yr_verdata.module
Function for generating a forecast for a location. This function should only be called after having checked if there is an up-to-date cache available, as this will load and parse an xml-file, possibly getting it from a remote host first, which is…
yr_verdata_load_location in ./yr_verdata.module
Function for loading a location from the database, and adding the path to the file.
_yr_verdata_refresh_xml in ./yr_verdata.module
Function for updating an xml file from yr.no on cron run.

File

./yr_verdata.module, line 1145
yr_verdata.module This file contains the code for getting the forecast from yr.no and displaying it on a Drupal site.

Code

function _yr_verdata_local_file($location) {

  // Check that the directory exists.
  $yr_dir = file_directory_path() . '/yr_verdata';
  file_check_directory($yr_dir, FILE_CREATE_DIRECTORY);
  $destination = $yr_dir . '/' . $location->file;
  return $destination;
}