jinnguyen/puja-stdlib

Puja-Stdlib 提供文件、文件夹等基本函数

v1.2.0 2017-02-21 08:58 UTC

This package is not auto-updated.

Last update: 2024-09-23 14:16:06 UTC


README

Puja-Stdlib 提供文件、文件夹等基本函数

Puja\Stdlib\File\File

文档请参考 https://php.ac.cn/manual/en/class.splfileobject.php
附加函数
bool Puja\Stdlib\File\File::isUploadedFile() // Tells whether the file was uploaded via HTTP POST
Returns TRUE if the file named by filename was uploaded via HTTP POST. This is useful to help ensure that a malicious user hasn't tried to trick the script into working on files upon which it should not be working--for instance, /etc/passwd.
bool Puja\Stdlib\File\File::moveUploadedFile() // Moves an uploaded file to a new location
This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP's HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination.

Puja\Stdlib\File\Info

文档请参考 https://php.ac.cn/manual/en/class.splfileinfo.php
附加函数
array Puja\Stdlib\File\Info::getBasenameWithoutExt($subfix = null)  // Return the file name without ext
string Puja\Stdlib\File\Info::getContent()  // Return the file content

Puja\Stdlib\File\Temp

文档请参考 https://php.ac.cn/manual/en/class.spltempfileobject.php

Puja\Stdlib\Folder\Folder

文档请参考 https://php.ac.cn/manual/en/class.directoryiterator.php

附加函数

array Puja\Stdlib\Folder\Folder::getChildFiles()  // Return a list of child files in folder
array Puja\Stdlib\Folder\Folder::getChildFoldes()  // Return a list of sub folders in folder
array Puja\Stdlib\Folder\Folder::getChild()  // Return a list of both child files and sub folders in folder
array Puja\Stdlib\Folder\Folder::getDirectChildFiles()  // Return a list of direct child files in folder
array Puja\Stdlib\Folder\Folder::getDirectChildFoldes()  // Return a list of direct sub folders in folder
array Puja\Stdlib\Folder\Folder::getDirectChild()  // Return a list of both direct child files and direct sub folders in folder