Skip to content

Commit ec0c382

Browse files
committed
Fixed Cache File Class
1 parent eaa92d5 commit ec0c382

File tree

4 files changed

+42
-43
lines changed

4 files changed

+42
-43
lines changed

src/inc/File.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -386,33 +386,32 @@ public function removeDir($dir)
386386
* Remove directory content
387387
*
388388
* @access public
389-
* @param string $dir
389+
* @param string $path
390390
* @return boolean
391391
*/
392-
public function emptyDir($dir)
392+
public function emptyDir($path)
393393
{
394394
$handler = false;
395-
if ( is_dir($dir) ) {
396-
$handler = opendir($dir);
395+
if ( is_dir($path) ) {
396+
$handler = opendir($path);
397397
}
398398
if ( !$handler ) {
399399
return false;
400400
}
401401
while( $file = readdir($handler) ) {
402402
if ($file !== '.' && $file !== '..') {
403-
if ( !is_dir($dir.'/'.$file) ) {
404-
@unlink($dir.'/'.$file);
403+
if ( !is_dir("{$path}/{$file}") ) {
404+
@unlink("{$path}/{$file}");
405405
} else {
406-
$dir = $dir.'/'.$file;
406+
$dir = "{$path}/{$file}";
407407
foreach( scandir($dir) as $file ) {
408408
if ( '.' === $file || '..' === $file ) {
409409
continue;
410410
}
411411
if ( is_dir("{$dir}/{$file}") ) {
412412
$this->recursiveRemove("{$dir}/{$file}");
413-
} else {
414-
unlink("{$dir}/{$file}");
415413
}
414+
else unlink("{$dir}/{$file}");
416415
}
417416
@rmdir($dir);
418417
}

src/inc/Stringify.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static function capitalize($string)
7171
}
7272
/**
7373
* @since 4.0.0
74-
* @version 5.4
74+
* @version 5.5.1
7575
* @access public
7676
* @param array $array
7777
* @return object
@@ -178,7 +178,7 @@ public static function formatKey($key)
178178
*
179179
* @see /Function_Reference/stripslashes_deep/
180180
* @since 4.0.0
181-
* @version 5.4
181+
* @version 5.5.1
182182
* @access public
183183
* @param mixed $data
184184
* @return mixed
@@ -224,7 +224,7 @@ public static function spaceStrip($string)
224224
*
225225
* @see /Function_Reference/maybe_serialize/
226226
* @since 4.0.0
227-
* @version 5.4
227+
* @version 5.5.1
228228
* @access public
229229
* @param string $string
230230
* @return mixed
@@ -239,7 +239,7 @@ public static function unserialize($string)
239239
*
240240
* @see /Function_Reference/maybe_serialize/
241241
* @since 4.0.0
242-
* @version 5.4
242+
* @version 5.5.1
243243
* @access public
244244
* @param mixed $data
245245
* @return mixed
@@ -275,7 +275,7 @@ public static function excerpt($content, $length = 40, $more = '[...]')
275275
* @param mixed $sep
276276
* @return string
277277
*/
278-
public static function money($number, $decimals = 2, $point = '.', $sep = '')
278+
public static function toMoney($number, $decimals = 2, $point = '.', $sep = '')
279279
{
280280
return number_format($number,$decimals,$point,$sep);
281281
}

src/lib/VanilleCache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ public static function setPath($path)
170170
*/
171171
public function remove()
172172
{
173-
$cacheDir = new File();
174-
$cacheDir->emptyDir(self::$path);
173+
$dir = new File();
174+
$dir->emptyDir(self::$path);
175175
}
176176

177177
/**

src/lib/WordPress.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class WordPress
2828
*
2929
* @see /reference/functions/register_activation_hook/
3030
* @since 4.0.0
31-
* @version 5.4
31+
* @version 5.5.1
3232
* @access protected
3333
* @param string $file
3434
* @param callable $method
@@ -44,7 +44,7 @@ protected function registerActivation($file, $method)
4444
*
4545
* @see /reference/functions/register_deactivation_hook/
4646
* @since 4.0.0
47-
* @version 5.4
47+
* @version 5.5.1
4848
* @access protected
4949
* @param string $file
5050
* @param callable $method
@@ -61,7 +61,7 @@ protected function registerDeactivation($file, $method)
6161
*
6262
* @see /reference/functions/register_uninstall_hook/
6363
* @since 4.0.0
64-
* @version 5.4
64+
* @version 5.5.1
6565
* @access protected
6666
* @param string $file
6767
* @param callable $method
@@ -77,7 +77,7 @@ protected function registerUninstall($file, $method)
7777
*
7878
* @see /reference/functions/add_shortcode/
7979
* @since 4.0.0
80-
* @version 5.4
80+
* @version 5.5.1
8181
* @access protected
8282
* @param string $tag, Tag name
8383
* @param callable $callback
@@ -93,7 +93,7 @@ protected function addShortcode($tag, $callback )
9393
* and filter shortcodes through their hooks
9494
*
9595
* @since 4.0.0
96-
* @version 5.4
96+
* @version 5.5.1
9797
* @access protected
9898
* @param inherit
9999
* @param inherit
@@ -110,7 +110,7 @@ protected function renderShortcode($content, $ignore = false)
110110
*
111111
* @see /reference/functions/do_shortcode/
112112
* @since 4.0.0
113-
* @version 5.4
113+
* @version 5.5.1
114114
* @access protected
115115
* @param string $content
116116
* @param boolean $ignore, Ignore HTML
@@ -126,7 +126,7 @@ protected function doShortcode($content, $ignore = false)
126126
*
127127
* @see /reference/functions/remove_shortcode/
128128
* @since 4.0.0
129-
* @version 5.4
129+
* @version 5.5.1
130130
* @access protected
131131
* @param string $tag, Tag name
132132
* @return void
@@ -141,12 +141,12 @@ protected function removeShortcode($tag)
141141
*
142142
* @see /reference/functions/shortcode_exists/
143143
* @since 4.0.0
144-
* @version 5.4
144+
* @version 5.5.1
145145
* @access protected
146146
* @param string $tag, Tag name
147147
* @return boolean
148148
*/
149-
protected function shortcodeExist($tag)
149+
protected function shortcodeExists($tag)
150150
{
151151
return shortcode_exists($tag);
152152
}
@@ -156,13 +156,13 @@ protected function shortcodeExist($tag)
156156
*
157157
* @see /reference/functions/has_shortcode/
158158
* @since 4.0.0
159-
* @version 5.4
159+
* @version 5.5.1
160160
* @access protected
161161
* @param string $content
162162
* @param string $tag
163163
* @return boolean
164164
*/
165-
protected function shortcodeIn($content,$tag)
165+
protected function shortcodeIn($content, $tag)
166166
{
167167
return has_shortcode($content,$tag);
168168
}
@@ -172,7 +172,7 @@ protected function shortcodeIn($content,$tag)
172172
*
173173
* @see /reference/functions/add_action/
174174
* @since 4.0.0
175-
* @version 5.4
175+
* @version 5.5.1
176176
* @access protected
177177
* @param string $hook
178178
* @param callable $method
@@ -201,7 +201,7 @@ protected function addAction($hook, $method, $priority = 10, $args = 1)
201201
*
202202
* @see /reference/functions/remove_action/
203203
* @since 4.0.0
204-
* @version 5.4
204+
* @version 5.5.1
205205
* @access protected
206206
* @param string $target
207207
* @param callable $method
@@ -229,7 +229,7 @@ protected function removeAction($target, $method, $priority = 10)
229229
*
230230
* @see /reference/functions/do_action/
231231
* @since 4.0.0
232-
* @version 5.4
232+
* @version 5.5.1
233233
* @access protected
234234
* @param string $tag
235235
* @param mixed $args
@@ -245,7 +245,7 @@ protected function doAction($tag, $args = null)
245245
*
246246
* @see /reference/functions/add_filter/
247247
* @since 4.0.0
248-
* @version 5.4
248+
* @version 5.5.1
249249
* @access protected
250250
* @param string $hook
251251
* @param callable $method
@@ -263,7 +263,7 @@ protected function addFilter($hook, $method, $priority = 10, $args = 1)
263263
*
264264
* @see /reference/functions/remove_filter/
265265
* @since 4.0.0
266-
* @version 5.4
266+
* @version 5.5.1
267267
* @access protected
268268
* @param string $hook
269269
* @param callable $method
@@ -281,7 +281,7 @@ protected function removeFilter($hook, $method, $priority = 10)
281281
*
282282
* @see /reference/functions/apply_filters/
283283
* @since 4.0.0
284-
* @version 5.4
284+
* @version 5.5.1
285285
* @access protected
286286
* @param string $hook
287287
* @param mixed $value
@@ -298,7 +298,7 @@ protected function applyFilter($hook, $value, $args = null)
298298
*
299299
* @see /reference/functions/has_filter/
300300
* @since 4.0.0
301-
* @version 5.4
301+
* @version 5.5.1
302302
* @access protected
303303
* @param string $tag
304304
* @param callable $method
@@ -315,7 +315,7 @@ protected function hasFilter($tag, $method = false)
315315
* @see /reference/functions/wp_register_style/
316316
* @see /reference/functions/wp_enqueue_style/
317317
* @since 4.0.0
318-
* @version 5.4
318+
* @version 5.5.1
319319
* @access protected
320320
* @param string $id
321321
* @param string $path
@@ -339,7 +339,7 @@ protected function addCSS($id, $path, $deps = [], $version = false, $media = 'al
339339
* @see /reference/functions/wp_register_script/
340340
* @see /reference/functions/wp_enqueue_script/
341341
* @since 4.0.0
342-
* @version 5.4
342+
* @version 5.5.1
343343
* @access protected
344344
* @param string $id
345345
* @param string $path
@@ -363,7 +363,7 @@ protected function addJS($id, $path, $deps = [], $version = false, $footer = fal
363363
* @see /reference/functions/wp_register_script/
364364
* @see /reference/functions/wp_enqueue_script/
365365
* @since 4.0.0
366-
* @version 5.4
366+
* @version 5.5.1
367367
* @access protected
368368
* @param string $id
369369
* @param string $list
@@ -383,7 +383,7 @@ protected function isJS($id, $list = 'enqueued')
383383
* @see /reference/functions/wp_dequeue_style/
384384
* @see /reference/functions/wp_deregister_style/
385385
* @since 4.0.0
386-
* @version 5.4
386+
* @version 5.5.1
387387
* @access protected
388388
* @param string $id
389389
* @return void
@@ -400,7 +400,7 @@ protected function removeCSS($id)
400400
* @see /reference/functions/wp_dequeue_script/
401401
* @see /reference/functions/wp_deregister_script/
402402
* @since 4.0.0
403-
* @version 5.4
403+
* @version 5.5.1
404404
* @access protected
405405
* @param string $id
406406
* @return void
@@ -417,7 +417,7 @@ protected function removeJS($id)
417417
*
418418
* @see /reference/functions/wp_deregister_script/
419419
* @since 4.0.0
420-
* @version 5.4
420+
* @version 5.5.1
421421
* @access protected
422422
* @param string $id
423423
* @param object $object
@@ -434,7 +434,7 @@ protected function localizeJS($id, $object, $content = [])
434434
*
435435
* @see /reference/functions/register_setting/
436436
* @since 4.0.0
437-
* @version 5.4
437+
* @version 5.5.1
438438
* @access protected
439439
* @param string $group
440440
* @param string $option
@@ -451,7 +451,7 @@ protected function registerOption($group, $option, $args = [])
451451
*
452452
* @see /reference/functions/register_setting/
453453
* @since 4.0.0
454-
* @version 5.4
454+
* @version 5.5.1
455455
* @access protected
456456
* @param string $option
457457
* @param mixed $value
@@ -467,7 +467,7 @@ protected function addOption($option, $value)
467467
*
468468
* @see /reference/functions/get_option/
469469
* @since 4.0.0
470-
* @version 5.4
470+
* @version 5.5.1
471471
* @access protected
472472
* @param string $option
473473
* @param string $default

0 commit comments

Comments
 (0)