Skip to content

Commit

Permalink
Strip Tokens from one_src_file
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Schwarze authored and Benjamin Schwarze committed Jun 1, 2017
1 parent c0a608d commit 444c3b6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build/build_one_src_file.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ function addSrc($Name, $Target) {
$File = fopen($Name, "r");
try {
while (! feof($File)) {
fwrite($Target, fread($File, 102400));
$buffer = fread($File, 102400);
$buffer = str_replace(['<?php', '?>'], ['', ''], $buffer);
fwrite($Target, $buffer);
}
}
finally {
Expand All @@ -18,11 +20,9 @@ function addSrc($Name, $Target) {
$DistDir = realpath(dirname(__FILE__) . "/../dist/one_src_file");
$TargetFile = "$DistDir/phosphor7.php";



$Target = fopen($TargetFile, "w");
try {
fputs($Target,'<?php define("PHOSPHOR7_EXTERNAL_REQUIRE_MANAGEMENT", 1); ?>');
fputs($Target, '<?php define("PHOSPHOR7_EXTERNAL_REQUIRE_MANAGEMENT", 1);');

addSrc("$SrcDir/p7_global.php", $Target);
addSrc("$SrcDir/p7_ctypes.php", $Target);
Expand All @@ -35,6 +35,8 @@ function addSrc($Name, $Target) {
addSrc("$SrcDir/s7_peer.php", $Target);
addSrc("$SrcDir/s7_micro_client.php", $Target);
addSrc("$SrcDir/phosphor7.php", $Target);

fputs($Target, PHP_EOL . '?>');
}
finally {
fclose($Target);
Expand Down

0 comments on commit 444c3b6

Please sign in to comment.