5
5
use Safe \Exceptions \ApcException ;
6
6
7
7
/**
8
- * apc_cas updates an already existing integer value if the
9
- * old parameter matches the currently stored value
8
+ * apc_cas updates an already existing integer value if the
9
+ * old parameter matches the currently stored value
10
10
* with the value of the new parameter.
11
- *
11
+ *
12
12
* @param string $key The key of the value being updated.
13
13
* @param int $old The old value (the value currently stored).
14
14
* @param int $new The new value to update to.
15
15
* @throws ApcException
16
- *
16
+ *
17
17
*/
18
18
function apc_cas (string $ key , int $ old , int $ new ): void
19
19
{
20
20
error_clear_last ();
21
21
$ result = \apc_cas ($ key , $ old , $ new );
22
- if ($ result === FALSE ) {
22
+ if ($ result === false ) {
23
23
throw ApcException::createFromPhpError ();
24
24
}
25
25
}
26
26
27
27
28
28
/**
29
29
* Stores a file in the bytecode cache, bypassing all filters.
30
- *
30
+ *
31
31
* @param string $filename Full or relative path to a PHP file that will be compiled and stored in
32
32
* the bytecode cache.
33
- * @param bool $atomic
33
+ * @param bool $atomic
34
34
* @return mixed Returns TRUE on success .
35
35
* @throws ApcException
36
- *
36
+ *
37
37
*/
38
38
function apc_compile_file (string $ filename , bool $ atomic = true )
39
39
{
40
40
error_clear_last ();
41
41
$ result = \apc_compile_file ($ filename , $ atomic );
42
- if ($ result === FALSE ) {
42
+ if ($ result === false ) {
43
43
throw ApcException::createFromPhpError ();
44
44
}
45
45
return $ result ;
@@ -48,25 +48,25 @@ function apc_compile_file(string $filename, bool $atomic = true)
48
48
49
49
/**
50
50
* Decreases a stored integer value.
51
- *
51
+ *
52
52
* @param string $key The key of the value being decreased.
53
53
* @param int $step The step, or value to decrease.
54
54
* @param bool $success Optionally pass the success or fail boolean value to
55
55
* this referenced variable.
56
56
* @return int Returns the current value of key's value on success,
57
- *
57
+ *
58
58
* @throws ApcException
59
- *
59
+ *
60
60
*/
61
61
function apc_dec (string $ key , int $ step = 1 , bool &$ success = null ): int
62
62
{
63
63
error_clear_last ();
64
64
if ($ success !== null ) {
65
65
$ result = \apc_dec ($ key , $ step , $ success );
66
- }else {
66
+ } else {
67
67
$ result = \apc_dec ($ key , $ step );
68
68
}
69
- if ($ result === FALSE ) {
69
+ if ($ result === false ) {
70
70
throw ApcException::createFromPhpError ();
71
71
}
72
72
return $ result ;
@@ -78,10 +78,10 @@ function apc_dec(string $key, int $step = 1, bool &$success = null): int
78
78
* APC is to increase the performance of scripts/applications, this mechanism
79
79
* is provided to streamline the process of mass constant definition. However,
80
80
* this function does not perform as well as anticipated.
81
- *
81
+ *
82
82
* For a better-performing solution, try the
83
83
* hidef extension from PECL.
84
- *
84
+ *
85
85
* @param string $key The key serves as the name of the constant set
86
86
* being stored. This key is used to retrieve the
87
87
* stored constants in apc_load_constants.
@@ -94,21 +94,21 @@ function apc_dec(string $key, int $step = 1, bool &$success = null): int
94
94
* represent different values. If this parameter evaluates to FALSE the
95
95
* constants will be declared as case-insensitive symbols.
96
96
* @throws ApcException
97
- *
97
+ *
98
98
*/
99
99
function apc_define_constants (string $ key , array $ constants , bool $ case_sensitive = true ): void
100
100
{
101
101
error_clear_last ();
102
102
$ result = \apc_define_constants ($ key , $ constants , $ case_sensitive );
103
- if ($ result === FALSE ) {
103
+ if ($ result === false ) {
104
104
throw ApcException::createFromPhpError ();
105
105
}
106
106
}
107
107
108
108
109
109
/**
110
110
* Deletes the given files from the opcode cache.
111
- *
111
+ *
112
112
* @param mixed $keys The files to be deleted. Accepts a string,
113
113
* array of strings, or an APCIterator
114
114
* object.
@@ -117,13 +117,13 @@ function apc_define_constants(string $key, array $constants, bool $case_sensitiv
117
117
* an empty array is returned on success, or an array of failed files
118
118
* is returned.
119
119
* @throws ApcException
120
- *
120
+ *
121
121
*/
122
122
function apc_delete_file ($ keys )
123
123
{
124
124
error_clear_last ();
125
125
$ result = \apc_delete_file ($ keys );
126
- if ($ result === FALSE ) {
126
+ if ($ result === false ) {
127
127
throw ApcException::createFromPhpError ();
128
128
}
129
129
return $ result ;
@@ -132,17 +132,17 @@ function apc_delete_file($keys)
132
132
133
133
/**
134
134
* Removes a stored variable from the cache.
135
- *
135
+ *
136
136
* @param string|string[]|APCIterator $key The key used to store the value (with
137
137
* apc_store).
138
138
* @throws ApcException
139
- *
139
+ *
140
140
*/
141
141
function apc_delete (string $ key )
142
142
{
143
143
error_clear_last ();
144
144
$ result = \apc_delete ($ key );
145
- if ($ result === FALSE ) {
145
+ if ($ result === false ) {
146
146
throw ApcException::createFromPhpError ();
147
147
}
148
148
return $ result ;
@@ -151,25 +151,25 @@ function apc_delete(string $key)
151
151
152
152
/**
153
153
* Increases a stored number.
154
- *
154
+ *
155
155
* @param string $key The key of the value being increased.
156
156
* @param int $step The step, or value to increase.
157
157
* @param bool $success Optionally pass the success or fail boolean value to
158
158
* this referenced variable.
159
159
* @return int Returns the current value of key's value on success,
160
- *
160
+ *
161
161
* @throws ApcException
162
- *
162
+ *
163
163
*/
164
164
function apc_inc (string $ key , int $ step = 1 , bool &$ success = null ): int
165
165
{
166
166
error_clear_last ();
167
167
if ($ success !== null ) {
168
168
$ result = \apc_inc ($ key , $ step , $ success );
169
- }else {
169
+ } else {
170
170
$ result = \apc_inc ($ key , $ step );
171
171
}
172
- if ($ result === FALSE ) {
172
+ if ($ result === false ) {
173
173
throw ApcException::createFromPhpError ();
174
174
}
175
175
return $ result ;
@@ -178,23 +178,21 @@ function apc_inc(string $key, int $step = 1, bool &$success = null): int
178
178
179
179
/**
180
180
* Loads a set of constants from the cache.
181
- *
181
+ *
182
182
* @param string $key The name of the constant set (that was stored with
183
183
* apc_define_constants) to be retrieved.
184
184
* @param bool $case_sensitive The default behaviour for constants is to be declared case-sensitive;
185
185
* i.e. CONSTANT and Constant
186
186
* represent different values. If this parameter evaluates to FALSE the
187
187
* constants will be declared as case-insensitive symbols.
188
188
* @throws ApcException
189
- *
189
+ *
190
190
*/
191
191
function apc_load_constants (string $ key , bool $ case_sensitive = true ): void
192
192
{
193
193
error_clear_last ();
194
194
$ result = \apc_load_constants ($ key , $ case_sensitive );
195
- if ($ result === FALSE ) {
195
+ if ($ result === false ) {
196
196
throw ApcException::createFromPhpError ();
197
197
}
198
198
}
199
-
200
-
0 commit comments