Permalink
Browse files

Forward port of Pressflow 6 Smart Start functionality.

  • Loading branch information...
Aaron Levy
Aaron Levy committed Mar 2, 2011
1 parent 4979149 commit fa91b2fc80741cb8c42c2db618f0ef0ad890f4cc
Showing with 21 additions and 0 deletions.
  1. +11 −0 includes/bootstrap.inc
  2. +10 −0 sites/default/default.settings.php
View
@@ -2252,6 +2252,17 @@ function _drupal_bootstrap_database() {
function _drupal_bootstrap_variables() {
global $conf;
+ // Pressflow Smart Start
+ if (!empty($GLOBALS['databases']) && variable_get('pressflow_smart_start', FALSE)) {
+ try {
+ $result = db_query('SELECT s.name FROM {system} s WHERE s.name = :name', array(':name' => 'system'));
+ } catch (Exception $e) {
+ // Redirect to the installer if an essential table is missing.
+ include_once DRUPAL_ROOT . '/includes/install.inc';
+ install_goto('install.php');
+ }
+ }
+
// Initialize the lock system.
require_once DRUPAL_ROOT . '/' . variable_get('lock_inc', 'includes/lock.inc');
lock_initialize();
@@ -444,3 +444,13 @@
* Remove the leading hash signs to disable.
*/
# $conf['allow_authorize_operations'] = FALSE;
+
+/**
+ * Smart start:
+ *
+ * If you would prefer to be redirected to the installation system when a
+ * valid settings.php file is present but no tables are installed, remove
+ * the leading hash sign below.
+ */
+# $conf['pressflow_smart_start'] = TRUE;
+

0 comments on commit fa91b2f

Please sign in to comment.