+function fwriteConstDef($rFile, $sConstName, $value)
+{
+ $sEscapedValue;
+
+ if (is_bool($value)) {
+ $sEscapedValue = $value ? 'true' : 'false';
+ } elseif (is_numeric($value)) {
+ $sEscapedValue = strval($value);
+ } elseif (!$value) {
+ $sEscapedValue = 'false';
+ } else {
+ $sEscapedValue = addQuotes(str_replace("'", "\\'", (string)$value));
+ }
+
+ fwrite($rFile, "@define('CONST_$sConstName', $sEscapedValue);\n");
+}
+
+