Oihana Php Ftp

FtpFileType uses ConstantsTrait

Enumerates the kinds of entry returned by a remote directory listing, and maps the various server representations (MLSD facts, `ls -l` type characters) onto them.

Tags
author

Marc Alcaraz (ekameleon)

since
1.0.0

Table of Contents

Constants

DIRECTORY  : string = 'dir'
A directory.
FILE  : string = 'file'
A regular file.
LINK  : string = 'link'
A symbolic link.
UNKNOWN  : string = 'unknown'
An entry whose kind could not be determined.

Methods

fromMlsd()  : string
Maps an MLSD `type` fact to a file-type constant.
fromUnixChar()  : string
Maps the leading character of a Unix `ls -l` line to a file-type constant.

Constants

DIRECTORY

A directory.

public string DIRECTORY = 'dir'

UNKNOWN

An entry whose kind could not be determined.

public string UNKNOWN = 'unknown'

Methods

fromMlsd()

Maps an MLSD `type` fact to a file-type constant.

public static fromMlsd(string $type) : string

The cdir (current) and pdir (parent) MLSD types are reported as directories.

Parameters
$type : string

The MLSD type fact.

Return values
string

One of the file-type constants.

fromUnixChar()

Maps the leading character of a Unix `ls -l` line to a file-type constant.

public static fromUnixChar(string $char) : string
Parameters
$char : string

The first character of the permissions field.

Return values
string

One of the file-type constants.

On this page

Search results