Indefero

Indefero Commit Details


Date:2010-08-30 02:00:20 (14 years 3 months ago)
Author:Thomas Keller
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:adae73080c7f83ed3f6db21469edd531a85f8084
Parents: b648e6f7a72f84d49db67a03c7b6822105876253
Message:simplify and harden the configuration file writeouts, didn't knew file_put_contents was around for so long already...

Changes:

File differences

src/IDF/Plugin/SyncMonotone.php
157157
158158
159159
160
161
162
163
160
161
162
163
164
164165
165166
166167
......
205206
206207
207208
208
209
210
211
209
210
211
212
213
214
215
212216
213217
214218
END;
$rcfile = $projectpath.'/monotonerc';
// FIXME: sanity
$fp = fopen($rcfile, 'w');
fwrite($fp, $monotonerc);
fclose($fp);
if (!file_put_contents($rcfile, $monotonerc, LOCK_EX)) {
throw new IDF_Scm_Exception(sprintf(
__('Could not write mtn configuration file "%s"'), $rcfile)
));
}
//
// step 4) read in and append the usher config with the new server
$parsed_config[] = $new_server;
$usher_rc = IDF_Scm_Monotone_BasicIO::compile($parsed_config);
// FIXME: more sanity - what happens on failing writes?
$fp = fopen($usher_config, 'w');
fwrite($fp, $usher_rc);
fclose($fp);
// FIXME: more sanity - what happens on failing writes? we do not
// have a backup copy of usher.conf around...
if (!file_put_contents($usher_config, $usher_rc, LOCK_EX)) {
throw new IDF_Scm_Exception(sprintf(
__('Could not write usher configuration file "%s"'), $usher_config)
));
}
//
// step 5) reload usher to pick up the new configuration

Archive Download the corresponding diff file

Page rendered in 0.07859s using 13 queries.