this-> GetRulesDB

(Caronte Pcode version 2.0)

Description

CS_RulesDB this->GetRulesDB (void);

Loads the regular expressions it in a CS_RulesDB class variable, the records in the CS_RulesDB have values separated by character 2.

Example.

Source:

In this example there is a rule with this values:

score : 3.000 ; name : TEST ; where search : RAW BODY; regular expression : VIAGRA ; regular expression command : is

#import( class , HashArray )
#import( class , CS_RulesDB )

CS_ADMIN_SCRIPT this = new CS_ADMIN_SCRIPT($_this);

int Main(CAdminRequest pRequest, CAdminResponse pResponse)
{

CS_RulesDB db = this->GetRulesDB();

HashArray indexkey = new HashArray();
db->ViewRules(indexkey);

for (int i = 0; i < indexkey->GetRecordCount(); i++)
{

this->Print("Score: " + this->Split(indexkey->GetByIndexS(i),2,0) + "\n");
this->Print("Where: " + this->Split(indexkey->GetByIndexS(i),2,1) + "\n");
this->Print("Re command: " + this->Split(indexkey->GetByIndexS(i),2,2) + "\n");
this->Print("Regular expression: " + this->Split(indexkey->GetByIndexS(i),2,3) + "\n");

}

delete indexkey;

return 0;

}




Out:
Score: 3.000
Where: 3
Re command: 5
Regular expression: VIAGRA