Skip to content
Snippets Groups Projects
Commit ba01c8f8 authored by Adrian Rossouw's avatar Adrian Rossouw
Browse files

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

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