@@ -37,24 +37,24 @@ extension=timecop.so
37
37
- Freeze time to a specific point.
38
38
- Travel back to a specific point in time, but allow time to continue moving forward from there.
39
39
- Override the following PHP stock functions and class, which supports freezing or traveling time.
40
- - time()
41
- - mktime()
42
- - gmmktime()
43
- - date()
44
- - gmdate()
45
- - idate()
46
- - getdate()
47
- - localtime()
48
- - strtotime()
49
- - strftime()
50
- - gmstrftime()
51
- - unixtojd()
52
- - DateTime::_ construct()
53
- - DateTime::createFromFormat() (PHP >= 5.3.4)
54
- - date_create()
55
- - date_create_from_format() (PHP >= 5.3.4)
40
+ - ` time() `
41
+ - ` mktime() `
42
+ - ` gmmktime() `
43
+ - ` date() `
44
+ - ` gmdate() `
45
+ - ` idate() `
46
+ - ` getdate() `
47
+ - ` localtime() `
48
+ - ` strtotime() `
49
+ - ` strftime() `
50
+ - ` gmstrftime() `
51
+ - ` unixtojd() `
52
+ - ` DateTime::_construct() `
53
+ - ` DateTime::createFromFormat() ` (PHP >= 5.3.4)
54
+ - ` date_create() `
55
+ - ` date_create_from_format() ` (PHP >= 5.3.4)
56
56
- Rewrite value of the following global variables when the time has been moved.
57
- - $_ SERVER[ 'REQUEST_TIME']
57
+ - ` $_SERVER['REQUEST_TIME'] `
58
58
59
59
## USAGE
60
60
@@ -66,7 +66,7 @@ var_dump(gmdate("Y-m-d H:i:s")); // string(19) "1970-01-01 00:00:00"
66
66
var_dump(strtotime("+100000 sec")); // int(100000)
67
67
```
68
68
69
- ## The difference between ` timecop_freeze() ` and ` timecop_travel() `
69
+ ### The difference between ` timecop_freeze() ` and ` timecop_travel() `
70
70
71
71
` timecop_freeze() ` is used to statically mock the concept of now. As your program executes, ` time() ` will not change unless you make subsequent calls into the Timecop API. ` timecop_travel() ` , on the other hand, computes an offset between what we currently think time() is and the time passed in. It uses this offset to simulate the passage of time. To demonstrate, consider the following code snippets:
72
72
@@ -77,7 +77,7 @@ timecop_freeze($new_time);
77
77
sleep(10);
78
78
var_dump($new_time == time()); // bool(true)
79
79
80
- timecop_return(); // "turn off" Timecop
80
+ timecop_return(); // "turn off" php-timecop
81
81
82
82
timecop_travel($new_time);
83
83
sleep(10);
@@ -87,29 +87,29 @@ var_dump($new_time == time()); // bool(false)
87
87
## CHANGELOG
88
88
89
89
###version 1.0.5, 2013/11/26
90
- - Fix ` TimecopDateTime::createFromFormat() ` to reutrn TimecopDateTime instance on PHP >= 5.3.4
91
- - The previous version returns DateTime instance
90
+ - Fix ` TimecopDateTime::createFromFormat() ` to reutrn ` TimecopDateTime ` instance on PHP >= 5.3.4
91
+ - The previous version returns ` DateTime ` instance
92
92
- Implement identical function ` timecop_date_create_from_format() `
93
- - BUG: not supporting "relative formats" currently.
94
- - Support 2nd argument of TimecopDateTime::_ construct()
93
+ - BUG: not supporting "relative formats" for this method currently.
94
+ - Fix behavior of ` TimecopDateTime::_construct() ` when its 2nd argument is specified.
95
95
96
96
###version 1.0.4, 2013/03/11
97
- - Fix SIGSEGV in TimecopDateTime::__ construct() called with NULL as 1st argument
97
+ - Fix SIGSEGV in ` TimecopDateTime::__construct() ` called with NULL as 1st argument
98
98
99
99
###version 1.0.3, 2013/03/09
100
100
101
- - Fix the time traveling implementation for TimecopDateTime::__ construct()
102
- - Fix timecop_date_create() to return TimecopDateTime instance
103
- - The previous version returns DateTime instance
104
- - Add TimecopDateTime::getTimestamp(), TimecopDateTime::setTimestamp() only for PHP 5.2.x
101
+ - Fix the time traveling implementation for ` TimecopDateTime::__construct() `
102
+ - Fix ` timecop_date_create() ` to return ` TimecopDateTime ` instance
103
+ - The previous version returns ` DateTime ` instance
104
+ - Add ` TimecopDateTime::getTimestamp() ` , ` TimecopDateTime::setTimestamp() ` only for PHP 5.2.x
105
105
106
106
###version 1.0.2, 2013/03/06
107
107
108
- - Implement timecop_date_create()
108
+ - Implement ` timecop_date_create() `
109
109
110
110
###version 1.0.1, 2013/03/04
111
111
112
- - Implement time traveling feature for TimecopDateTime::__ construct() with 1 or 2 arguments
112
+ - Implement time traveling feature for ` TimecopDateTime::__construct() ` with 1 or 2 arguments
113
113
- The previous version works correctly only for no arguments calling: "new TimecopDateTime()"
114
114
115
115
###version 1.0.0, 2012/11/21
0 commit comments