3 * Strips out all fluid functions (experimental)
6 'addFK','addIndex','addUniqueConstraint','createTable',
7 'widenColumn','buildFK','addColumn','wipeAll'
9 $code = file_get_contents('rb.php');
10 $functionDefs = array();
11 foreach($functions as $function) {
12 $functionDefs[] = "public function $function";
13 $functionDefs[] = "private function $function";
14 $functionDefs[] = "protected function $function";
15 $functionDefs[] = "public static function $function";
16 $functionDefs[] = "private static function $function";
17 $functionDefs[] = "protected static function $function";
19 $functionDefs[] = 'class Fluid extends Repository';
20 foreach( $functionDefs as $function ) {
21 while( strpos( $code, $function ) !== FALSE ) {
22 $begin = strpos( $code, $function );
25 while( $char !== '{' && $char !== ';' ) {
27 $char = substr( $code, $pointer, 1);
31 $code = substr( $code, 0, $begin-1 ) . substr( $code, $pointer );
37 $beginOfFunction = $pointer;
38 while( !( $char === '}' && $nesting === 0 ) ) {
39 $char = substr( $code, $pointer, 1);
40 if ($char === '{') { $nesting ++; echo "($nesting)"; }
41 if ($char === '}') { $nesting --; echo "($nesting)"; }
44 $code = substr( $code, 0, $begin-1 ) . substr( $code, $pointer );
49 file_put_contents('rbf.php', $code);