-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.php~
44 lines (43 loc) · 1.22 KB
/
controller.php~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
require("./head.php");
class controller{
public $bootDate,$bootTime;
public $poolUnit,$databaseUnit,$inputUnit;
public $globalStatus = false;
public function controller(){
$this->poolUnit = new pool();
$this->databaseUnit = new database();
$this->bootDate = time()/$daySegment*$daySegment;
}
public function clear(){
$this->poolUnit->clear();
}
public function setStatus(){
$timeNow = time() % $daySegment;
$timeSegment = $timeNow-$bootDate;
if ($timeSegment > 9*$hourSegment+30 && $timeSegment < 11*$hourSegment+30){
$this->globalStatus = true;
return;
}
if ($timeSegment > 13*$hourSegment && $timeSegment < 15*$hourSegment){
$this->globalStatus = true;
return;
}
$this->globalStatus = false;
if ($timeSegment > 16*$hourSegment) $this->clear();
}
public function process(){
// $inputUnit->run();
do{
$this->setStatus();
if ($this->globalStatus){
$result = $this->poolUnit->addIns(getTimeStamp(),0 ,100 ,100 ,0 ,0 );
$result = $this->poolUnit->addIns(getTimeStamp(), 0 ,100 ,101 ,0 ,1 );
$result = $this->poolUnit->addIns(getTimeStamp(),0 ,100 ,100 ,0 ,1 );
echo $result->num."\n";
}
}while (true);
}
}
$globalController=new controller();
$globalController->process();