Skip to content

Commit

Permalink
Merge pull request #9 from olegabr/master
Browse files Browse the repository at this point in the history
write configuration only if it does not exists
  • Loading branch information
olegabr authored Oct 20, 2016
2 parents 2f5a3d1 + b531956 commit 1435abf
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,14 @@ protected function composerFrameworkInstall ($package) {
chmod ($strTargetDir, 0777);
}

// fix up the configuration file
$strFile = file_get_contents($strConfigDirectory . '/configuration.inc.sample.php');
if ($strFile) {
$strFile = str_replace (['{docroot}', '{vd}', '{subdir}'], [$strDocRoot, '', $strSubDirectory], $strFile);
file_put_contents($strConfigDirectory . '/configuration.inc.php', $strFile);
// write configuration.inc.php only if it does not exists
if (!file_exists($strConfigDirectory . '/configuration.inc.php')) {
// fix up the configuration file
$strFile = file_get_contents($strConfigDirectory . '/configuration.inc.sample.php');
if ($strFile) {
$strFile = str_replace (['{docroot}', '{vd}', '{subdir}'], [$strDocRoot, '', $strSubDirectory], $strFile);
file_put_contents($strConfigDirectory . '/configuration.inc.php', $strFile);
}
}
}

Expand Down

0 comments on commit 1435abf

Please sign in to comment.