FtpSecurity uses ConstantsTrait
Enumerates the transport security modes supported by the FTP client.
The native ext-ftp extension exposes a single secured mode through
ftp_ssl_connect() (FTPS, TLS over the control channel). Be aware of its
limitations: certificate verification is not configurable and data-channel
protection is partial — FTPS here mainly shields credentials in transit. For
strong confidentiality, SFTP (a future driver) is the recommended path.
Tags
Table of Contents
Constants
- NONE : string = 'none'
- Plain FTP — no transport encryption. Credentials travel in clear text.
- SSL : string = 'ssl'
- FTPS over TLS, established with {@see \ftp_ssl_connect()}.
Methods
- getDefault() : string
- Returns the default security mode.
- isSecure() : bool
- Indicates whether the given mode requires a secured (TLS) connection.
Constants
NONE
Plain FTP — no transport encryption. Credentials travel in clear text.
public
string
NONE
= 'none'
SSL
FTPS over TLS, established with {@see \ftp_ssl_connect()}.
public
string
SSL
= 'ssl'
Methods
getDefault()
Returns the default security mode.
public
static getDefault() : string
Return values
string —The NONE mode.
isSecure()
Indicates whether the given mode requires a secured (TLS) connection.
public
static isSecure(string $security) : bool
Parameters
- $security : string
-
One of the security constants.
Return values
bool —True when the mode is SSL.