Platformsh\Cli\Local\Toolstack\Drupal::processSettingsPhp PHP Method

processSettingsPhp() protected method

If the user has a custom settings.php file, and we symlink it into sites/default, then it will probably fail to pick up settings.local.php from the right place. So we need to copy the settings.php instead of symlinking it. See https://github.com/platformsh/platformsh-cli/issues/175
protected processSettingsPhp ( )
    protected function processSettingsPhp()
    {
        if ($this->copy) {
            // This behaviour only relates to symlinking.
            return;
        }
        $settingsPhpFile = $this->appRoot . '/settings.php';
        if (file_exists($settingsPhpFile)) {
            $this->output->writeln("Found a custom settings.php file: {$settingsPhpFile}");
            $this->fsHelper->copy($settingsPhpFile, $this->getWebRoot() . '/sites/default/settings.php');
            $this->output->writeln("  <comment>Your settings.php file has been copied (not symlinked) into the build directory." . "\n  You will need to rebuild if you edit this file.</comment>");
            $this->ignoredFiles[] = 'settings.php';
        }
    }