Example #1
0
 public function fetch($repository, $working_directory)
 {
     $username = drush_prompt(dt('Please provide your username for this svn repository'), '');
     if (!drush_shell_exec("svn --username {$username} co {$repository} {$working_directory}")) {
         throw new RumRepositoryNotCheckedOutException($repository, $working_directory);
     }
 }
Example #2
0
 public function install($profile)
 {
     $options['account-name'] = drush_prompt(dt('Enter the administrator (uid=1) account name'));
     $options['account-pass'] = drush_prompt(dt('Enter the administrator (uid=1) password'));
     $options['account-mail'] = drush_prompt(dt('Enter the administrator (uid=1) e-mail address'));
     $options['locale'] = drush_prompt(dt('Enter your desired locale'));
     $options['site-name'] = drush_prompt(dt('Enter the name of your site'));
     $options['site-mail'] = drush_prompt(dt('Enter the global mail address of your site'));
     // Setting the options as a drush command specific context so the site install
     // routine picks it up.
     drush_set_context('specific', $options);
     // Determin the major version and launch version specific installation.
     drush_include_engine('drupal', 'site_install', drush_drupal_major_version());
     drush_core_site_install_version($profile, $options);
     drush_log(dt('Installation finished.'), 'success');
 }
<?php

#!/usr/bin/env drush
// Example of execution:
// drush scr /vagrant_sites/kms.dev/scripts/oracle/import_sqlldr_file.php --ctl=/vagrant_sites/kms.dev/sqlldr/kms_perms_extract.smuser.ctl
// check if we can bootstrap
$self = drush_sitealias_get_record('@self');
if (empty($self)) {
    drush_die("I can't bootstrap from the current location.", 0);
}
$conn = drush_prompt(dt('Please enter connection definition'));
if (drush_get_option('ctl')) {
    $pathinfo = pathinfo(drush_get_option('ctl'));
    $filepath_log = '/tmp/' . str_replace('.ctl', '.log', $pathinfo['basename']);
    $filepath_bad = '/tmp/' . str_replace('.ctl', '.bad', $pathinfo['basename']);
    $output = shell_exec(sprintf('sqlldr %s control=%s log=%s bad=%s', $conn, drush_get_option('ctl'), $filepath_log, $filepath_bad));
    drush_print($output);
    drush_print(dt('Sql loader done. Log saved: @log', array('@log' => $filepath_log)));
}