Commit e945a47c authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian
Browse files

Provision no longer uses a db. removed the .install

parent 0a8ae41b
// $Id$
* @file Install file for provision module
* Configure the module weights for the core modules, to ensure that the
* hooks always fire in a predictable pattern.
* Provision module - does necessary setup for an task to occur.
* Mysql module - creates the necessary database settings
* Drupal module - manages installations and the like.
* Apache module - ensures that web server can see the site
function provision_install() {
db_query("UPDATE {system} SET weight = 0 WHERE type='module' AND name='provision'");
db_query("UPDATE {system} SET weight = 1 WHERE type='module' AND name='provision_mysql'");
db_query("UPDATE {system} SET weight = 2 WHERE type='module' AND name='provision_drupal'");
db_query("UPDATE {system} SET weight = 3 WHERE type='module' AND name='provision_apache'");
* Implementation of hook_requirements
* Make sure that the POSIX library is available, and that we are not running on a windows based host.
* Make sure that site is not installed in a subdirectory, but that the DocumentRoot directive points at the installation.
* Make sure the site is not being installed in sites/default
* @TODO: make sure the required modules are installed in the right places
function provision_requirements($phase) {
global $base_path;
$t = get_t();
$has_posix = function_exists('posix_uname');
$requirements['posix']['title'] = $t('POSIX library');
$requirements['posix']['value'] = ($has_posix) ? $t('Enabled') : $t('Not found');
if (!$has_posix) {
$requirements['posix']['description'] = $t('<p>The <a href="@helpurl">POSIX library</a> has not been compiled into PHP.</p>', array("@helpurl" => '')) .
$t("<p><strong>This library is not available on Windows based hosts</strong>, and you will not be able to install this system.</p>");
$requirements['posix']['severity'] = REQUIREMENT_ERROR;
$is_in_docroot = $base_path == '/';
$docroot = $_SERVER['DOCUMENT_ROOT'];
$requirements['docroot']['title'] = $t("Document root");
$requirements['docroot']['value'] = ($is_in_docroot) ? $t('Correct') :
$t("Installed in the @subdir sub directory of @root", array('@root' => rtrim($docroot, '/'), '@subdir' => trim($base_path, '/')));
if (!$is_in_docroot) {
$requirements['docroot']['value'] = $t("Drupal has been installed in a subdirectory.
You will need to modify your virtual host configuration to point a ServerName directly at the installation path.");
$requirements['docroot']['severity'] = REQUIREMENT_ERROR;
$url = parse_url($GLOBALS['base_url']);
$conf_path = (conf_path() == 'sites/default');
$requirements['confpath']['title'] = $t('Configuration path');
$requirements['confpath']['value'] = conf_path();
if (!$conf_path) {
$requirements['confpath']['description'] = $t('Provision may only be installed as the default site in a Drupal installation. It is currently installed in the "sites/@url" directory. Please move this directory to "sites/default".', array('@url' => $url['host']));
$requirements['confpath']['severity'] = REQUIREMENT_ERROR;
return $requirements;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment