コード例 #1
0
ファイル: Sql8.php プロジェクト: bjargud/drush
 public function get_db_spec()
 {
     $db_spec = NULL;
     if (drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION)) {
         $database = drush_get_option('database', 'default');
         $target = drush_get_option('target', 'default');
         if ($info = Database::getConnectionInfo($database)) {
             return $info[$target];
         }
     }
     return $db_spec;
 }
コード例 #2
0
/**
 * Initialize a command prior to validation.  If a command
 * needs to bootstrap to a higher level, this is best done in
 * the command init hook.  It is permisible to bootstrap in
 * any hook, but note that if bootstrapping adds more commandfiles
 * (*.drush.inc) to the commandfile list, the newly-added
 * commandfiles will not have any hooks called until the next
 * phase.  For example, a command that calls drush_bootstrap_max()
 * in drush_hook_COMMAND() would only permit commandfiles from
 * modules enabled in the site to participate in drush_hook_post_COMMAND()
 * hooks.
 */
function drush_COMMAND_init()
{
    drush_bootstrap_max();
}
コード例 #3
0
ファイル: ViewsCommands.php プロジェクト: jibran/drush
 /**
  * A completion callback.
  *
  * @return array
  *   An array of available view names.
  */
 static function complete()
 {
     drush_bootstrap_max();
     return array('values' => array_keys(\Drupal::entityTypeManager()->getStorage('view')->loadMultiple()));
 }