Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove file headers in rb.

  • Loading branch information...
commit b9f543106ce6dd9a4f1e58eacab182cd85f4878f 1 parent 4bb1dc7
@gabordemooij authored
Showing with 13 additions and 2 deletions.
  1. +13 −2 replica.php
View
15 replica.php
@@ -9,13 +9,13 @@
if ($a && isset($a->flavour)) {
$fl = $a->flavour->__toString();
if (!isset($code[$fl])) $code[$fl] = $code['default'];
- $code[$fl] .= file_get_contents( $item ) . "\n";
+ $code[$fl] .= '===BOUNDARY==='.file_get_contents( $item ) . "\n";
echo "Adding: $item to flavour: $fl \n";
}
else {
echo "Adding: $item \n";
$c = file_get_contents( $item ) . "\n";
- foreach($code as $k=>$codeFlav) $code[$k] .= $c;
+ foreach($code as $k=>$codeFlav) $code[$k] .= '===BOUNDARY==='.$c;
}
}
foreach($code as $f=>$codeFlav) {
@@ -28,6 +28,17 @@ class R extends RedBean_Facade{
}
";
+//Remove headers
+$x = explode('===BOUNDARY===',$code[$f]);
+$clean = '';
+$i = 0;
+foreach($x as $file) {
+ $i++;
+ if ($i < 3) { $clean .= $file; continue; }
+ $clean .= substr($file,strpos($file,'*/')+2);
+}
+$code[$f] = $clean;
+
//Clean php tags and whitespace from codebase.
$code[$f] = "<?php ".str_replace( array("<?php", "<?", "?>"), array("", "", ""), $code[$f]);
file_put_contents("rb".($f==='default' ? '' : $f).".php", $code[$f]);
Please sign in to comment.
Something went wrong with that request. Please try again.