coder_upgrade_install

Versions
mediamosa-21
coder_upgrade_install()

Implement hook_install().

Code

sites/all/modules/coder/coder_upgrade/coder_upgrade.install, line 15

<?php
function coder_upgrade_install() {
  // Create the top-level module directory.
  // Because the core function is now recursive, we could start with the
  // subdirectories. However, this code is clean and allows for one else block.
  $dir = file_directory_path() . '/' . DEADWOOD_DIR;
  if (file_prepare_directory($dir, FILE_CREATE_DIRECTORY)) {
    // Create the old and new module directories.
    $dir = file_directory_path() . '/' . DEADWOOD_OLD;
    if (!file_prepare_directory($dir, FILE_CREATE_DIRECTORY)) {
      drupal_set_message(st('The files directory at %directory can not be written to. This is the default directory searched by Coder Upgrade for modules to be converted.', array('%directory' => $dir)), 'error');
    }
    $dir = file_directory_path() . '/' . DEADWOOD_NEW;
      if (!file_prepare_directory($dir, FILE_CREATE_DIRECTORY)) {
        drupal_set_message(st('The files directory at %directory can not be written to. This is the default directory to which Coder Upgrade writes converted module code.', array('%directory' => $dir)), 'error');
    }
    // Create the patch directory.
    $dir = file_directory_path() . '/' . DEADWOOD_PATCH;
    if (!file_prepare_directory($dir, FILE_CREATE_DIRECTORY)) {
      drupal_set_message(st('The files directory at %directory can not be written to. This is the default directory to which Coder Upgrade writes patch files.', array('%directory' => $dir)), 'error');
    }
  }
  else {
    drupal_set_message(st('Your files directory at %directory can not be written to. Coder Upgrade places converted module code in subdirectories of this directory.', array('%directory' => $dir)), 'error');
  }
}
?>