Exemplo n.º 1
0
 public function db_exists()
 {
     $current = drush_get_context('DRUSH_SIMULATE');
     drush_set_context('DRUSH_SIMULATE', FALSE);
     // Suppress output. We only care about return value.
     $return = $this->query("SELECT 1;", NULL, drush_bit_bucket());
     drush_set_context('DRUSH_SIMULATE', $current);
     return $return;
 }
Exemplo n.º 2
0
// Load a drushrc.php file from the 'drush' folder at the root of the current
// git repository. Customize as desired.
// (Script by grayside; @see: http://grayside.org/node/93)
$repo_dir = drush_get_option('root') ? drush_get_option('root') : getcwd();
$success = drush_shell_exec('cd %s && git rev-parse --show-toplevel 2> ' . drush_bit_bucket(), $repo_dir);
if ($success) {
    $output = drush_shell_exec_output();
    $repo = $output[0];
    // If drush directory is not found, look for a parent git repo which might contain the drush folder
    if (!is_dir($repo . '/drush')) {
        $success = drush_shell_exec('cd %s && cd .. && git rev-parse --show-toplevel 2> ' . drush_bit_bucket(), $repo);
        if ($success) {
            $output = drush_shell_exec_output();
            $repo = $output[0];
            if (!is_dir($repo . '/drush')) {
                $success = drush_shell_exec('cd %s && cd .. && git rev-parse --show-toplevel 2> ' . drush_bit_bucket(), $repo);
                if ($success) {
                    $output = drush_shell_exec_output();
                    $repo = $output[0];
                }
            }
        }
    }
    if (is_dir($repo . '/drush')) {
        $options['config'] = $repo . '/drush/drushrc.php';
        $options['include'] = $repo . '/drush/commands';
        $options['alias-path'] = $repo . '/drush/aliases';
        //print_r($options); // can be used to debug which directories it finds.
    }
}
$override = array('language_default' => (object) array('language' => 'en'));
Exemplo n.º 3
0
 * command line.  Unary flags such as "--verbose" are overridden via special
 * "--no-xxx" options (e.g. "--no-verbose").
 *
 * Limitation: If 'verbose' is set in a command-specific option, it must be
 * cleared by '--no-verbose', not '--no-v', and visa-versa.
 */
// Ensure all rsync commands use verbose output.
# $command_specific['rsync'] = array('verbose' => TRUE);
// Prevent drush ssh command from adding a cd to Drupal root before provided command.
# $command_specific['ssh'] = array('cd' => FALSE);
// Additional folders to search for scripts.
// Separate by : (Unix-based systems) or ; (Windows).
# $command_specific['script']['script-path'] = 'sites/all/scripts:profiles/myprofile/scripts';
// Always show release notes when running pm-update or pm-updatecode.
# $command_specific['pm-update'] = array('notes' => TRUE);
# $command_specific['pm-updatecode'] = array('notes' => TRUE);
// Set a predetermined username and password when using site-install.
# $command_specific['site-install'] = array('account-name' => 'alice', 'account-pass' => 'secret');
/**
 * Load a drushrc file from the 'drush' folder at the root of the current
 * git repository.  Example script below by Grayside.  Customize as desired.
 * @see: http://grayside.org/node/93.
 */
$repo_dir = drush_get_option('root') ? drush_get_option('root') : getcwd();
if (drush_shell_exec('cd %s && git rev-parse --show-toplevel 2> ' . drush_bit_bucket(), $repo_dir)) {
    $output = drush_shell_exec_output();
    $repo_top = $output[0];
    $options['config'] = $repo_top . '/drush/drushrc.php';
    $options['include'] = $repo_top . '/drush/commands';
    $options['alias-path'] = $repo_top . '/drush/aliases';
}