-
Notifications
You must be signed in to change notification settings - Fork 0
/
Files.php
92 lines (75 loc) · 1.71 KB
/
Files.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
use php\io\File;
use php\io\Stream;
use php\lib\Str;
/**
* @deprecated
* Class Files
*/
abstract class Files
{
static function exists($path)
{
return File::of($path)->exists();
}
static function isFile($path)
{
return File::of($path)->isFile();
}
static function isDir($path)
{
return File::of($path)->isDirectory();
}
static function isDirectory($path)
{
return self::isDir($path);
}
static function isHidden($path)
{
return File::of($path)->isHidden();
}
static function delete($path)
{
return File::of($path)->delete();
}
static function unlink($path)
{
return self::delete($path);
}
static function remove($path)
{
return self::delete($path);
}
static function find($path)
{
return File::of($path)->find();
}
static function search($path)
{
return self::find($path);
}
static function makeDirs($path)
{
return File::of($path)->mkdirs();
}
static function length($path)
{
return File::of($path)->length();
}
static function size($path)
{
return self::length($path);
}
static function lastModified($path)
{
return File::of($path)->lastModified();
}
public static function put($filename, $content, $encoding = 'UTF-8')
{
Stream::putContents($filename, Str::encode($content, $encoding));
}
public static function get($filename, $encoding = 'UTF-8')
{
return Str::decode(Stream::getContents($filename), $encoding);
}
}