コード例 #1
0
ファイル: bottom_stats.php プロジェクト: Nikitian/fl-ru-damp
                           $res1[$k]['sum'] = $res1[$k]['sum'] + round($v['fm_sum'],2); 
                           $res1[$k]['ammount'] = $res1[$k]['ammount'] + $v['cnt'];
                       }
                   }
               }
           }
       }
       if ( $res1 ) {
           ksort($res1);
           foreach ( $res1 as $d ) {
               array_push($res, $d);
           }
       }
   }*/
 if ($i == 43) {
     $res = pf::getOp($date_from, $date_to, $bYear, $bYearAll);
     foreach ($res as $kRes => $iRes) {
         $res[$kRes]['sum'] = round($iRes['sum'] / EXCH_TR, 2);
     }
 }
 if ($i != 43 && !in_array($i, $is_number_project)) {
     $res = getOP($graphStyle[$i]['op_codes'], $date_from, $date_to, $bYear, $graphStyle[$i]['addit'], $ignored_uids, $bYearAll);
 }
 if (in_array($i, $is_number_project)) {
     $res = getOPProject($date_from, $date_to, $bYear, $bYearAll, $ignored_uids, $graphStyle[$i]['addit']);
 }
 $aTemp = $res;
 if ($bYearAll) {
     for ($ii = 0; $ii < count($aTemp); $ii++) {
         $aTemp[$ii]['_day'] = array_search($aTemp[$ii]['_day'], $graphLabels) + 1;
     }
コード例 #2
0
ファイル: OptionsTest.php プロジェクト: allard-archive/pfw
 function test_set_skip_multi()
 {
     $pf = new pf();
     $pf->parseRulebase('set skip on { lo0, enc0 }');
     $this->assertEqual(trim($pf->generate(false, false)), 'set skip on { lo0 enc0 }');
 }
コード例 #3
0
ファイル: FilterTest.php プロジェクト: allard-archive/pfw
 function test_other()
 {
     $pf = new pf();
     $pf->parseRulebase('pass all flags S/SA');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all flags S/SA');
     $pf = new pf();
     $pf->parseRulebase('pass inet all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass inet all');
     $pf = new pf();
     $pf->parseRulebase('pass inet6 all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass inet6 all');
     $pf = new pf();
     $pf->parseRulebase('pass all user root');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all user root');
     $pf = new pf();
     $pf->parseRulebase('pass all user {root www}');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all user { root www }');
     $pf = new pf();
     $pf->parseRulebase('pass all group wheel');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all group wheel');
     $pf = new pf();
     $pf->parseRulebase('pass all queue default');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all queue default');
     $pf = new pf();
     $pf->parseRulebase('pass all queue (default, small)');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all queue (default, small)');
     $pf = new pf();
     $pf->parseRulebase('pass all label test');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all label "test"');
     $pf = new pf();
     $pf->parseRulebase('pass all tag test');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all tag "test"');
     $pf = new pf();
     $pf->parseRulebase('pass all tagged test');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all tagged "test"');
     $pf = new pf();
     $pf->parseRulebase('pass all probability 10');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all probability 10');
     $pf = new pf();
     $pf->parseRulebase('pass fastroute all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass fastroute all');
     $pf = new pf();
     $pf->parseRulebase('pass route-to 1.2.3.4 all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass route-to 1.2.3.4 all');
     $pf = new pf();
     $pf->parseRulebase('pass reply-to 1.2.3.4 all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass reply-to 1.2.3.4 all');
     $pf = new pf();
     $pf->parseRulebase('pass dup-to 1.2.3.4 all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass dup-to 1.2.3.4 all');
     $pf = new pf();
     $pf->parseRulebase('pass all allow-opts');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass all allow-opts');
     $pf = new pf();
     $pf->parseRulebase('block in from any os "nmap" to any');
     $this->assertEqual(trim($pf->generate(false, false)), 'block in from any os "nmap" to any');
     $pf = new pf();
     $pf->parseRulebase('block in from any os { "nmap", "Windows 95" } to any');
     $this->assertEqual(trim($pf->generate(false, false)), 'block in from any os { "nmap" "Windows 95" } to any');
     $pf = new pf();
     $pf->parseRulebase('pass in \\
  all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass in all');
     $pf = new pf();
     $pf->parseRulebase('pass in route-to ($inf1 $gw1) all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass in route-to { ($inf1 $gw1) } all');
     $pf = new pf();
     $pf->parseRulebase('pass in route-to { ($inf1 $gw1), ($inf2, $gw2) } all');
     $this->assertEqual(trim($pf->generate(false, false)), 'pass in route-to { ($inf1 $gw1) ($inf2 $gw2) } all');
 }
コード例 #4
0
ファイル: NatTest.php プロジェクト: allard-archive/pfw
 function test_anchors()
 {
     $pf = new pf();
     $pf->parseRulebase('nat-anchor "authpf/*"');
     $this->assertEqual(trim($pf->generate(false, false)), 'nat-anchor "authpf/*"');
     $pf = new pf();
     $pf->parseRulebase('rdr-anchor "authpf/*"');
     $this->assertEqual(trim($pf->generate(false, false)), 'rdr-anchor "authpf/*"');
     $pf = new pf();
     $pf->parseRulebase('rdr-anchor "authpf/*"');
     $this->assertEqual(trim($pf->generate(false, false)), 'rdr-anchor "authpf/*"');
 }