public function applyRules()
    {
        if (!$this->hasRules()) {
            return false;
        }

        $rules = $this->getRules();
        foreach ($rules as $rewrite) {
            add_rewrite_rule($rewrite[0], $rewrite[1], $rewrite[2]);
        }

        $wroteInDB = $this->flush();

        $message = $wroteInDB ?
            sprintf("Added <info>%d</info> and flushed the rewrite list.", count($rules)) :
            sprintf("Added <info>%d</info> while using the cached rewrites.", count($rules));

        Strata::app()->log($message, "<info>Rewriter</info>");

        return $wroteInDB;
    }
public function applyRules()
    {
        if (!$this->hasRules()) {
            return false;
        }

        $rules = $this->getRules();
        foreach ($rules as $rewrite) {
            add_rewrite_rule($rewrite[0], $rewrite[1], $rewrite[2]);
        }

        $wroteInDB = $this->flush();

        $message = $wroteInDB ?
            sprintf("Added <info>%d</info> and flushed the rewrite list.", count($rules)) :
            sprintf("Added <info>%d</info> while using the cached rewrites.", count($rules));

        Strata::app()->log($message, "<info>Rewriter</info>");

        return $wroteInDB;
    }
public function applyRules ( ) { if ( ! $ this -> hasRules ( ) ) { return false ; } $ rules = $ this -> getRules ( ) ; foreach ( $ rules as $ rewrite ) { add_rewrite_rule ( $ rewrite [ 0 ] , $ rewrite [ 1 ] , $ rewrite [ 2 ] ) ; } $ wroteInDB = $ this -> flush ( ) ; $ message = $ wroteInDB ? sprintf ( "Added <info>%d</info> and flushed the rewrite list." , count ( $ rules ) ) : sprintf ( "Added <info>%d</info> while using the cached rewrites." , count ( $ rules ) ) ; Strata :: app ( ) -> log ( $ message , "<info>Rewriter</info>" ) ; return $ wroteInDB ; }
Applies the rules that have been defined at runtime. Note that
the rules are added in the same order as they have been defined
and this may cause racing condition in how rules are applied.
@return boolean Returns whether the process has written in the database
Applies the rules that have been defined at runtime . Note that the rules are added in the same order as they have been defined and this may cause racing condition in how rules are applied .