blacksmith-8.x-1.x-dev/blacksmith.install
blacksmith.install
<?php use Drupal\Core\File\FileSystem; /** * @file * Installation file for the Blacksmith module. */ /** * Implements hook_install(). * * @noinspection PhpUnused */ function blacksmith_install() { // Define the default content source path if it is not set yet. if (!$directory = Drupal::config('blacksmith.settings')->get('source.path')) { $site_path = Drupal::service('site.path'); $directory = $site_path . '/blacksmith'; Drupal::configFactory()->getEditable('blacksmith.settings')->set('source.path', $directory)->save(); } // Create the source content directory and ensure it's writable. Drupal::service('file_system')->prepareDirectory($directory, FileSystem::CREATE_DIRECTORY | FileSystem::MODIFY_PERMISSIONS); }