Skip to content

Instantly share code, notes, and snippets.

@imcbride
Created July 11, 2017 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imcbride/cbdea5a9c007961c1920487d621d10db to your computer and use it in GitHub Desktop.
Save imcbride/cbdea5a9c007961c1920487d621d10db to your computer and use it in GitHub Desktop.
middlebury_profile_sync install
<?php
/**
* @file
* Contains install, uninstall and update functions for Middlebury Profile Sync.
*/
/**
* Implements hook_install().
*/
function middlebury_profile_sync_install() {
$directory = file_default_scheme() . '://middlebury_profile_sync';
// This would ideally use file_prepare_directory(), but that doesn't create
// the directory with sufficient write permissions and a check against the
// function in the module code later fails.
if (!is_dir($directory)) {
$file_system = \Drupal::service('file_system');
$file_system->mkdir($directory, 0777);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment