PHP 클래스 f, kirby

파일 보기 프로젝트 열기: bastianallgeier/kirby 1 사용 예제들

공개 메소드들

메소드 설명
append ( string $file, mixed $content ) : boolean Appends new content to an existing file
convert ( string $name, string $type = 'jpg' ) : string Convert the filename to a new extension
dirname ( string $file = __FILE__ ) : string Just an alternative for dirname() to stay consistent
extension ( $filename ) : string Gets the extension of a file
filename ( $name ) : string Extracts the filename from a file path
move ( string $old, string $new ) : boolean Moves a file to a new location
name ( $name, boolean $remove_path = false ) : string Extracts the name from a file path or filename without extension
nice_size ( integer $size ) : string Converts an integer size into a human readable format
read ( string $file, mixed $parse = false ) : mixed Reads the content of a file
remove ( string $file ) : boolean Deletes a file
safe_name ( string $string ) : string Sanitize a filename to strip unwanted special characters
size ( string $file, boolean $nice = false ) : mixed Returns the size of a file.
write ( string $file, mixed $content, boolean $append = false ) : boolean Creates a new file

메소드 상세

append() 정적인 공개 메소드

Appends new content to an existing file
static public append ( string $file, mixed $content ) : boolean
$file string The path for the file
$content mixed Either a string or an array. Arrays will be converted to JSON.
리턴 boolean

convert() 정적인 공개 메소드

Convert the filename to a new extension
static public convert ( string $name, string $type = 'jpg' ) : string
$name string The file name
$type string The new extension
리턴 string

dirname() 정적인 공개 메소드

Just an alternative for dirname() to stay consistent
static public dirname ( string $file = __FILE__ ) : string
$file string The path
리턴 string

extension() 정적인 공개 메소드

Gets the extension of a file
static public extension ( $filename ) : string
리턴 string

filename() 정적인 공개 메소드

Extracts the filename from a file path
static public filename ( $name ) : string
리턴 string

move() 정적인 공개 메소드

Moves a file to a new location
static public move ( string $old, string $new ) : boolean
$old string The current path for the file
$new string The path to the new location
리턴 boolean

name() 정적인 공개 메소드

Extracts the name from a file path or filename without extension
static public name ( $name, boolean $remove_path = false ) : string
$remove_path boolean remove the path from the name
리턴 string

nice_size() 정적인 공개 메소드

Converts an integer size into a human readable format
static public nice_size ( integer $size ) : string
$size integer The file size
리턴 string

read() 정적인 공개 메소드

Reads the content of a file
static public read ( string $file, mixed $parse = false ) : mixed
$file string The path for the file
$parse mixed if set to true, parse the result with the passed method. See: "str::parse()" for more info about available methods.
리턴 mixed

remove() 정적인 공개 메소드

Deletes a file
static public remove ( string $file ) : boolean
$file string The path for the file
리턴 boolean

safe_name() 정적인 공개 메소드

Sanitize a filename to strip unwanted special characters
static public safe_name ( string $string ) : string
$string string The file name
리턴 string

size() 정적인 공개 메소드

Returns the size of a file.
static public size ( string $file, boolean $nice = false ) : mixed
$file string The path
$nice boolean True: return the size in a human readable format
리턴 mixed

write() 정적인 공개 메소드

Creates a new file
static public write ( string $file, mixed $content, boolean $append = false ) : boolean
$file string The path for the new file
$content mixed Either a string or an array. Arrays will be converted to JSON.
$append boolean true: append the content to an exisiting file if available. false: overwrite.
리턴 boolean