diff --git a/install.php b/install.php index fe6dcbed..6c4fa8d0 100644 --- a/install.php +++ b/install.php @@ -435,8 +435,8 @@ function write_config() { // {{{ mkdir("data/config", 0755, true); } - if(!file_put_contents("data/config/shimmie.conf.php", $file_content)) { - $h_file_content = htmlentities($file_content); + if(!file_put_contents("data/config/shimmie.conf.php", $file_content, LOCK_EX)) { + $h_file_content = htmlentities($file_content);[ print <<

Shimmie Installer

diff --git a/tests/all_tests.php b/tests/all_tests.php index 026604db..1f181d40 100644 --- a/tests/all_tests.php +++ b/tests/all_tests.php @@ -30,15 +30,23 @@ define("_TRAVIS_DATABASE", $db); $test_suite = new TestSuite('Shimmie tests'); $test_suite->add(new ShimmieInstallerTest()); -// -// From index.php -// +// Wait for the config file to be written. -clearstatcache(); +$timeout = 5; + +while ($timeout > 0 && !file_exists("data/config/shimmie.conf.php")) { + sleep(1); + $timout--; + clearstatcache(); +} require_once("core/sys_config.inc.php"); include "data/config/shimmie.conf.php"; +// +// The code below is from index.php +// + // set up and purify the environment _version_check(); _sanitise_environment();