Commit ba01c8f8 authored by Adrian Rossouw's avatar Adrian Rossouw

working site install. you need to reverify the platform first.

parent 031b1e59
......@@ -186,7 +186,7 @@ class provisionService_db extends provisionService {
function generate_site_credentials() {
$creds = array();
// replace with service type
$db_type = drush_get_option('db_type');
$db_type = drush_get_option('db_type', 'mysql');
// As of Drupal 7 there is no more mysqli type
if (drush_drupal_major_version() >= 7) {
$db_type = ($db_type == 'mysqli') ? 'mysql' : $db_type;
......@@ -194,7 +194,7 @@ class provisionService_db extends provisionService {
//TODO - this should not be here at all
$creds['db_type'] = drush_set_option('db_type', $db_type, 'site');
$creds['db_host'] = drush_set_option('db_host', drush_get_option('db_host'), 'site');
$creds['db_host'] = drush_set_option('db_host', $this->remote_host, 'site');
$creds['db_passwd'] = drush_set_option('db_passwd', provision_password(), 'site');
$creds['db_name'] = drush_set_option('db_name', $this->suggest_db_name(), 'site');
$creds['db_user'] = drush_set_option('db_user', $creds['db_name'], 'site');
......
......@@ -15,7 +15,7 @@
* Check that we are trying to install a new site , and a new site only
*/
function drush_provision_drupal_provision_install_validate() {
if (!drush_get_option('uri')) {
if (!d()->uri) {
return drush_set_error("PROVISION_URL_REQUIRED", dt("You need to specify a valid url to install a site"));
}
if (_provision_drupal_site_exists()) {
......@@ -52,7 +52,7 @@ function drush_provision_drupal_provision_install() {
* If the install went south, and the site is not PROVISION_SITE_INSTALLED, clean up behind ourselves
*/
function drush_provision_drupal_provision_install_rollback() {
if (drush_get_option('uri')) {
if (d()->uri) {
if (!_provision_drupal_site_installed()) {
_provision_recursive_delete('sites/' . drush_get_option('uri'));
}
......
......@@ -73,11 +73,6 @@ function _provision_context_init() {
if (($context === 'platform' || $context === 'site') && drush_bootstrap_validate(DRUSH_BOOTSTRAP_DRUPAL_ROOT)) {
// i don't think i should be bootstrapping here yet ... but i have no choice yet.
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_ROOT);
if ($context === 'site') {
drush_set_default('profile', 'default');
drush_set_default('language', 'en');
drush_set_default('aliases', array());
}
}
define('PROVISION_CONTEXT_SERVER', $context === 'server');
......@@ -104,7 +99,6 @@ function provision_drupal_drush_exit() {
if (PROVISION_CONTEXT_SITE) {
if (drush_get_option('installed')) {
drush_set_option('site_id', drush_get_option('site_id'), 'site');
drush_set_option('client_email', drush_get_option('client_email'), 'site');
provision_save_site_data();
}
}
......
......@@ -38,8 +38,17 @@ function & d($name = NULL, $root_object = FALSE) {
function provision_environment_factory($name) {
$classes = array('server' => 'provisionServer', 'platform' => 'provisionPlatform', 'site' => 'provisionSite');
$options = drush_sitealias_get_record($name);
$type = isset($options['context_type']) ? $options['context_type'] : 'server';
$type = 'server';
$record = drush_sitealias_get_record($name);
$options = drush_get_context('options');
if (isset($record['context_type'])) {
$type = $record['context_type'];
}
elseif (isset($options['context_type'])) {
$type = $options['context_type'];
}
$classname = $classes[$type];
return new $classname($name);
......
Markdown is supported
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