Source for file Txtfileloaderstrategy.php
Documentation is available at Txtfileloaderstrategy.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
* Strategy pattern for loading a Rule from a text file.
* @author Greg Swindle <greg@swindle.net>
// $statements = $this->getStatements( $fileName );
foreach( $statements as $statement ) {
// Every statement in the RuleContext file should have
// four (4) tokens. If not, ignore it.
if( count( $tokens ) ==
$STATEMENT ) {
if( $tokens[ 1 ] ==
'EQUALS' ) {
$this->ruleContext->addVariable( $tokens[ 0 ], $tokens[ 2 ] );
elseif( $tokens[ 1 ] ==
'IS' ) {
$this->ruleContext->addProposition( $tokens[ 0 ], $tokens[ 2 ] );
Documentation generated on Thu, 24 Mar 2011 21:27:43 -0500 by phpDocumentor 1.4.1