File
abstract class File extends FileSystem
Class File
Traits
Constants
FORMAT_JSON |
|
FORMAT_PHP |
|
FORMAT_INI |
|
FORMAT_YML |
|
FORMAT_YAML |
|
Methods
Returns whether the file path is an absolute path.
Renames a file or a directory.
Tells whether a file exists and is readable.
Change mode for an array of files or directories.
Change the owner of an array of files or directories.
No description
No description
load array data form file.
getLines 获取文件一定范围内的内容
symmetry 得到当前行对称上下几($lineNum)行的内容
No description
得到基准行数上5行下3行的内容, lines up and down
获得文件名称
获得文件扩展名、后缀名
获得文件扩展名、后缀名
No description
No description
No description
save description
No description
No description
Attempts to write $content to the file specified by $handler. $path is used for printing exceptions.
********************** 创建多级目录和多个文件 ********************** 结合上两个函数
No description
No description
No description
No description
No description
Removes whitespace from a PHP source string while preserving line numbers.
If you want to download files from a linux server with a filesize bigger than 2GB you can use the following
Details
in FileSystem at line 27
static bool
isAbsPath(string $path)
in FileSystem at line 49
static bool
isAbsolutePath(string $file)
Returns whether the file path is an absolute path.
in FileSystem at line 64
static string
pathFormat(string $dirName)
转换为标准的路径结构
in FileSystem at line 75
string
clearPharPath(string $path)
in FileSystem at line 94
static array|string
exists(string $file, null|string $type = null)
检查文件/夹/链接是否存在
in FileSystem at line 119
static
check(string $file, null|string|array $ext = null)
in FileSystem at line 145
static
rename(string $origin, string $target, bool $overwrite = false)
Renames a file or a directory.
in FileSystem at line 164
static bool
isReadable(string $filename)
Tells whether a file exists and is readable.
in FileSystem at line 179
static
mkdir(string|array|Traversable $dirs, int $mode = 0777)
Creates a directory recursively.
in FileSystem at line 210
static
chmod(string|array|Traversable $files, int $mode, int $umask = 00, bool $recursive = false)
Change mode for an array of files or directories.
in FileSystem at line 231
static
chown(string|array|Traversable $files, string $user, bool $recursive = false)
Change the owner of an array of files or directories.
in FileSystem at line 255
static RecursiveIteratorIterator
getIterator(string $srcDir, callable $filter)
in FileSystem at line 272
static bool
chmodDir(string $path, int $mode = 0664)
in FileSystem at line 305
static string
availableSpace(string $dir = '.')
in FileSystem at line 322
static string
countSpace(string $dir = '.')
in FileSystem at line 342
static int
pathModeInfo(string $file_path)
文件或目录权限检查函数
in ReadTrait at line 31
static array|bool
load(string $src, string $format = self::FORMAT_PHP)
in ReadTrait at line 64
static array
loadPhp(string $file, bool $throwError = true)
load array data form file.
in ReadTrait at line 85
static array
loadJson(string $file)
in ReadTrait at line 94
static array|bool
loadIni(string $ini)
in ReadTrait at line 103
static array|bool
loadYml(string $yml)
in ReadTrait at line 115
static array|string
readAllLine($file, bool|true $filter = true)
in ReadTrait at line 137
static array
readLines(string $fileName, int $startLine = 1, int $endLine = 10, string $mode = 'rb')
getLines 获取文件一定范围内的内容
in ReadTrait at line 191
static array
readSymmetry(string $fileName, integer $current = 1, integer $lineNum = 3)
symmetry 得到当前行对称上下几($lineNum)行的内容
in ReadTrait at line 212
static array
readRangeLines(string $file, int $baseLine, int $prevLines = 3, int $nextLines = 3)
in ReadTrait at line 227
static array
getLines5u3d(string $file, int $baseLine = 1)
得到基准行数上5行下3行的内容, lines up and down
in ReadTrait at line 240
static array
tail(resource $fp, int $n, int $base = 5)
读取文件的最后几行(支持大文件读取)
at line 38
static string
getName(string $file, bool $clearExt = false)
获得文件名称
at line 51
static string
getSuffix($filename, bool $clearPoint = false)
获得文件扩展名、后缀名
at line 64
static string
getExtension($path, bool $clearPoint = false)
获得文件扩展名、后缀名
at line 75
static string
mimeType(string $file)
at line 87
static array
info(string $filename, bool $check = true)
at line 106
static array
getStat($filename)
at line 117
static bool
save(string $filename, string $data)
save description
at line 127
static
write($content, $path)
at line 141
static resource
openHandler(string $path)
at line 157
static
writeToFile(resource $handler, string $content, string $path = '')
Attempts to write $content to the file specified by $handler. $path is used for printing exceptions.
at line 175
static
createAndWrite(array $fileData = [], $append = false, $mode = 0664)
********************** 创建多级目录和多个文件 ********************** 结合上两个函数
at line 203
static bool|mixed|string
getContents(string $file, bool|false $useIncludePath = false, null|resource $streamContext = null, int $curlTimeout = 5)
at line 261
static
move(string $file, string $target)
at line 276
static bool
delete($filename)
at line 289
static bool|int
copy($source, $destination, null $streamContext = null)
at line 309
static mixed
combine($inFile, $outFile)
at line 353
static string
stripPhpCode(string $source)
Removes whitespace from a PHP source string while preserving line numbers.
at line 387
static
downBigFile(string $file, string $as)
If you want to download files from a linux server with a filesize bigger than 2GB you can use the following