You are here

function hosting_subdirs_install in Hosting 7.3

Same name and namespace in other branches
  1. 7.4 subdirs/hosting_subdirs.install \hosting_subdirs_install()

Implements hook_install().

1 call to hosting_subdirs_install()
hosting_subdirs_update_7000 in subdirs/hosting_subdirs.install
Set hosting_subdirs module to run before hosting_site.

File

subdirs/hosting_subdirs.install, line 10
Database schemas and update functions for the hosting_subdirs module.

Code

function hosting_subdirs_install() {

  // Get the weight of the hosting_site module.
  $result = db_select('system', 's')
    ->fields('s', array(
    'weight',
  ))
    ->condition('name', 'hosting_site', '=')
    ->execute();
  $weight = !empty($result) ? $result
    ->fetchField() : 0;

  // Set our module to run before hosting_site.
  // @see: hosting_subdirs_node_presave().
  db_update('system')
    ->fields(array(
    'weight' => $weight - 1,
  ))
    ->condition('name', 'hosting_subdirs', '=')
    ->execute();
}