You are here

hosting_platform.install in Hosting 5

File

platform/hosting_platform.install
View source
<?php

function hosting_platform_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {hosting_platform} (\n        vid int(10) unsigned NOT NULL default '0',\n        nid int(10) unsigned NOT NULL default '0',\n        publish_path longtext,\n        web_server int(11) NOT NULL default '0',\n        release_id int(11) NOT NULL default '0',\n        verified int(11) NOT NULL default '0',\n        PRIMARY KEY  (vid)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
  }
}

/**
 * Re-synch all platform to correctly set up the
 * master url, so redirects on disabled sites will
 * work correctly.
 */
function hosting_platform_update_1() {
  include_once drupal_get_path('module', 'hosting_task') . '/hosting_task.module';
  $ret = array();
  $result = db_query("SELECT nid FROM {node} WHERE type='platform' AND status=1");
  while ($platform = db_fetch_object($result)) {
    hosting_add_task($platform->nid, 'synch');
  }
  return $ret;
}

Functions

Namesort descending Description
hosting_platform_install
hosting_platform_update_1 Re-synch all platform to correctly set up the master url, so redirects on disabled sites will work correctly.