-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathngx_core.php
57 lines (42 loc) · 1.02 KB
/
ngx_core.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
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* Created by PhpStorm.
* User: [email protected]
* Date: 2015/11/4
* Time: 12:22
*/
define('NGX_OK', 0);
define('NGX_ERROR',-1);
define('NGX_AGAIN',-2);
define('NGX_BUSY ',-3);
define('NGX_DONE ',-4);
define('NGX_DECLINED',-5);
define('NGX_ABORT',-6);
define('LF',"\n");
define('CR',"\r");
define('CRLF',"\r\n");
class ngx_open_file_s {
private $fd = null;
private $name = '';
private $flush_handler;
private $data;
public function flush(ngx_open_file_s $file, ngx_log_s $log){
return call_user_func($this->flush_handler,$file,$log);
}
public function __set($property_name, $value){
if($property_name == 'flush_handler' && $value instanceof closure){
$this->flush_handler = $value;
}else{
$this->$property_name = $value;
}
}
public function __get($property_name){
return $this->$property_name;
}
}
function ngx_abs($number){
return abs($number);
}
function ngx_min($val1, $val2){
return min($val1,$val2);
}