Project

General

Profile

1 38716 eri.katsar
<?php
2
require_once('./js/log4php/Logger.php');
3
include_once('./promoteNums.php');
4
include_once('./promoteCharts.php');
5
6
class PromoteCache
7
{
8
             public function __construct($action){
9
	     $this->log = Logger::getLogger(__CLASS__);
10
             Logger::configure('./js/log4php/log4php.xml');
11
12
              $this->log->info("Calling scripts to promote Cache....");
13
	     $this->log->info("Script Mode:".$action);
14
15
if ($action=='promoteNums')
16
{$this->promoteNums();}
17
else if ($action=='promoteCharts')
18
{$this->promoteCharts();}
19
else if ($action=='promoteAll')
20
{ $this->promoteAll(); }
21
else if ($action=='help')
22
{
23
$this->log->info("Availiable options: promoteNums-> Promotes Stats Numbers Only; promoteCharts -> Promote Chart Queries ; promoteAll->Promote every entry in the cache.");
24
}
25
else
26
{
27
$this->log->info("Wrong argument given. Availiable are: promoteNums, promoteCharts , promoteAll.");}
28
29
}
30
31
32
public function promoteNums(){
33
$this->log->info(" Promoting Numbers...");
34
$csn = new PromoteShadowNums();
35
$csn->replace();
36
$this->log->info("Done!");
37
}
38
39
public function promoteCharts()
40
{
41
$this->log->info("Promoting Charts...");
42
$csn = new PromoteCharts();$csn->replace();
43
$this->log->info("Done!");
44
}
45
46
public function refreshAll()
47
{  $this->promoteNums();
48
 $this->promoteCharts();
49
}
50
51
}
52
53
if ($_GET) {
54
$argument1 = $_GET['action'];
55
} else {
56
$argument1 = $argv[1];
57
}
58
$rc = new PromoteCache($argument1);
59
60
?>