You are here

function _google_tag_snippet_directory_prepare in GoogleTagManager 7

Same name and namespace in other branches
  1. 7.2 google_tag.install \_google_tag_snippet_directory_prepare()

Creates directory for snippet files, if not present.

Return value

bool Whether the directory exists (or was created) and is writable.

1 call to _google_tag_snippet_directory_prepare()
google_tag_update_7102 in ./google_tag.install
Create directory for snippet files, if not present.

File

./google_tag.install, line 156
Provides install, update, and uninstall functions.

Code

function _google_tag_snippet_directory_prepare() {

  // Create directory if not present.
  $directory = 'public://google_tag';
  $result = file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
  if (!$result) {
    drupal_set_message(t('An error occurred creating a directory for snippet files. Please try again or contact the site administrator if it persists.'));
  }
  return $result;
}