Skip to content

Instantly share code, notes, and snippets.

@icecreammatt
Created April 7, 2014 22:29
Show Gist options
  • Save icecreammatt/10069071 to your computer and use it in GitHub Desktop.
Save icecreammatt/10069071 to your computer and use it in GitHub Desktop.
For fixing Drupal Registory after moving folder location
<?php
define('DRUPAL_ROOT', getcwd());
$_SERVER['HTTP_HOST'] = 'default';
$_SERVER['PHP_SELF'] = '/index.php';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['SERVER_SOFTWARE'] = NULL;
$_SERVER['REQUEST_METHOD'] = 'GET';
$_SERVER['QUERY_STRING'] = '';
$_SERVER['PHP_SELF'] = $_SERVER['REQUEST_URI'] = '/';
$_SERVER['HTTP_USER_AGENT'] = 'console';
require_once DRUPAL_ROOT . '/includes/database/database.inc';
require_once DRUPAL_ROOT . '/includes/database/query.inc';
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
require_once DRUPAL_ROOT . '/includes/common.inc';
require_once DRUPAL_ROOT . '/modules/system/system.module';
drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);
registry_rebuild();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment