public function drushrc() {
        // @todo: Check if drushrc.php exists, load in any $conf changes.
        switch ($this->version) {
            case DrupalStackHelper::DRUPAL7:
                $this->fs->copy(CLI_ROOT . '/resources/stacks/drupal7/drushrc.php', Platform::sharedDir() . '/drushrc.php', true);
                break;
            case DrupalStackHelper::DRUPAL8:
                $this->fs->copy(CLI_ROOT . '/resources/stacks/drupal8/drushrc.php', Platform::sharedDir() . '/drushrc.php', true);
                break;
            default:
                throw new \Exception('Unsupported version of Drupal. Write a pull reuqest!');
        }

        // Replace template variables.
        $localSettings = file_get_contents(Platform::sharedDir() . '/drushrc.php');
        // @todo this expects proxy to be running.
        $localSettings = str_replace('{{ project_domain }}', $this->projectName . '.' . $this->projectTld, $localSettings);
        file_put_contents(Platform::sharedDir() . '/drushrc.php', $localSettings);

        if (!file_exists(Platform::webDir() . '/sites/default/drushrc.php')) {
            $this->fs->symlink($this->getRelativeLinkToShared() . 'drushrc.php', Platform::webDir() . '/sites/default/drushrc.php');
        }
    }
public function drushrc() {
        // @todo: Check if drushrc.php exists, load in any $conf changes.
        switch ($this->version) {
            case DrupalStackHelper::DRUPAL7:
                $this->fs->copy(CLI_ROOT . '/resources/stacks/drupal7/drushrc.php', Platform::sharedDir() . '/drushrc.php', true);
                break;
            case DrupalStackHelper::DRUPAL8:
                $this->fs->copy(CLI_ROOT . '/resources/stacks/drupal8/drushrc.php', Platform::sharedDir() . '/drushrc.php', true);
                break;
            default:
                throw new \Exception('Unsupported version of Drupal. Write a pull reuqest!');
        }

        // Replace template variables.
        $localSettings = file_get_contents(Platform::sharedDir() . '/drushrc.php');
        // @todo this expects proxy to be running.
        $localSettings = str_replace('{{ project_domain }}', $this->projectName . '.' . $this->projectTld, $localSettings);
        file_put_contents(Platform::sharedDir() . '/drushrc.php', $localSettings);

        if (!file_exists(Platform::webDir() . '/sites/default/drushrc.php')) {
            $this->fs->symlink($this->getRelativeLinkToShared() . 'drushrc.php', Platform::webDir() . '/sites/default/drushrc.php');
        }
    }
public function drushrc ( ) { // @todo: Check if drushrc.php exists, load in any $conf changes. switch ( $ this -> version ) { case DrupalStackHelper :: DRUPAL7 : $ this -> fs -> copy ( CLI_ROOT . '/resources/stacks/drupal7/drushrc.php' , Platform :: sharedDir ( ) . '/drushrc.php' , true ) ; break ; case DrupalStackHelper :: DRUPAL8 : $ this -> fs -> copy ( CLI_ROOT . '/resources/stacks/drupal8/drushrc.php' , Platform :: sharedDir ( ) . '/drushrc.php' , true ) ; break ; default : throw new \ Exception ( 'Unsupported version of Drupal. Write a pull reuqest!' ) ; } // Replace template variables. $ localSettings = file_get_contents ( Platform :: sharedDir ( ) . '/drushrc.php' ) ; // @todo this expects proxy to be running. $ localSettings = str_replace ( '{{ project_domain }}' , $ this -> projectName . '.' . $ this -> projectTld , $ localSettings ) ; file_put_contents ( Platform :: sharedDir ( ) . '/drushrc.php' , $ localSettings ) ; if ( ! file_exists ( Platform :: webDir ( ) . '/sites/default/drushrc.php' ) ) { $ this -> fs -> symlink ( $ this -> getRelativeLinkToShared ( ) . 'drushrc.php' , Platform :: webDir ( ) . '/sites/default/drushrc.php' ) ; } }
Write a drushrc
Write a drushrc