Go to the source code of this file.
Functions | |
| MatchGateKeeperExample1 () | |
| MatchGateKeeperExample1 | ( | ) |
Definition at line 10 of file MatchGateKeeperExample1.php.
00011 { 00012 $objMatch = new MatchGateKeeper(); 00013 $objMatch->getAllowedMatch()->addItemName( "just" ); 00014 $objMatch->getAllowedMatch()->addItemName( "us" ); 00015 if ( $objMatch->match( "other" ) !== false ) return false; 00016 00017 $objMatch = new MatchGateKeeper(); 00018 $objMatch->getForbiddenMatch()->addItemRegularExpression("^set*"); 00019 $objMatch->getForbiddenMatch()->addItemRegularExpression("^get*"); 00020 $objMatch->getForbiddenMatch()->addItemName( "play" ); 00021 if ( $objMatch->match( "setSomething" ) !== false ) return false; 00022 if ( $objMatch->match( "getSomething" ) !== false ) return false; 00023 if ( $objMatch->match( "play" ) !== false ) return false; 00024 if ( $objMatch->match( "other" ) !== true) return false; 00025 00026 return true; 00027 } 00028 00029 if( MatchGateKeeperExample1() === TRUE ) 00030 { 00031 print "ok!"; 00032 }
1.5.9