Esempio n. 1
0
 public function setUp()
 {
     if (self::$has_run) {
         return;
     }
     self::$has_run = TRUE;
     // Set the env vars that Drupal expects. Largely copied from drush.
     $url = parse_url($this->config->get('web_url'));
     if (array_key_exists('path', $url)) {
         $_SERVER['PHP_SELF'] = $url['path'] . '/index.php';
     } else {
         $_SERVER['PHP_SELF'] = '/index.php';
     }
     $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'];
     $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
     $_SERVER['REQUEST_METHOD'] = NULL;
     $_SERVER['SERVER_SOFTWARE'] = NULL;
     $_SERVER['HTTP_USER_AGENT'] = NULL;
     $_SERVER['HTTP_HOST'] = $url['host'];
     $_SERVER['SERVER_PORT'] = array_key_exists('port', $url) ? $url['port'] : NULL;
     define('DRUPAL_ROOT', $this->config->get('drupal_root'));
     define('UNISH_DRUSH', $this->config->get('drush'));
     define('UPAL_WEB_URL', $this->config->get('web_url'));
     define('UPAL_ROOT', $this->config->get('root'));
     define('UPAL_TMP', $this->config->get('tmp'));
     require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
     DrupalBootstrap::bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
 }
Esempio n. 2
0
 public function setUp()
 {
     DrupalBootstrap::bootstrap();
     // Use the test mail class instead of the default mail handler class.
     variable_set('mail_system', array('default-system' => 'TestingMailSystem'));
 }
                            }
                            break;
                    }
                }
            }
            // Define default values
            foreach ($this->defaultDefines as $key => $default_define) {
                if (!defined($key)) {
                    define($key, $default_define);
                }
            }
            if (defined('STACKSIGHT_TOKEN')) {
                if (defined('STACKSIGHT_APP_ID')) {
                    $this->ss_client = new SSDrupalClient(STACKSIGHT_TOKEN, SSClientBase::PLATFORM_DRUPAL, STACKSIGHT_APP_ID);
                } else {
                    $this->ss_client = new SSDrupalClient(STACKSIGHT_TOKEN, SSClientBase::PLATFORM_DRUPAL);
                }
                $handle_errors = FALSE;
                $handle_fatal_errors = TRUE;
                if (defined('STACKSIGHT_INCLUDE_LOGS') && STACKSIGHT_INCLUDE_LOGS == true) {
                    new SSLogsTracker($this->ss_client, $handle_errors, $handle_fatal_errors);
                }
                define('STACKSIGHT_BOOTSTRAPED', TRUE);
            }
        }
    }
}
if (defined('STACKSIGHT_TOKEN')) {
    $drupal_stacksight = new DrupalBootstrap($databases);
    $drupal_stacksight->init();
}
                            if (!defined('STACKSIGHT_INCLUDE_UPDATES')) {
                                define('STACKSIGHT_INCLUDE_UPDATES', $option);
                            }
                            break;
                    }
                }
            }
            // Define default values
            foreach ($this->defaultDefines as $key => $default_define) {
                if (!defined($key)) {
                    define($key, $default_define);
                }
            }
            if (defined('STACKSIGHT_TOKEN')) {
                if (defined('STACKSIGHT_APP_ID')) {
                    $this->ss_client = new SSDrupalClient(STACKSIGHT_TOKEN, SSClientBase::PLATFORM_DRUPAL, STACKSIGHT_APP_ID);
                } else {
                    $this->ss_client = new SSDrupalClient(STACKSIGHT_TOKEN, SSClientBase::PLATFORM_DRUPAL);
                }
                $handle_errors = FALSE;
                $handle_fatal_errors = TRUE;
                if (defined('STACKSIGHT_INCLUDE_LOGS') && STACKSIGHT_INCLUDE_LOGS == true) {
                    new SSLogsTracker($this->ss_client, $handle_errors, $handle_fatal_errors);
                }
                define('STACKSIGHT_BOOTSTRAPED', TRUE);
            }
        }
    }
}
$wp_stacksight = new DrupalBootstrap($databases);
$wp_stacksight->init();
 public function tearDown()
 {
     parent::tearDown();
     DrupalBootstrap::restoreDatabase();
 }
Esempio n. 6
0
 function setUp()
 {
     DrupalBootstrap::bootstrap();
 }