function ftp_size()

in ftp/ftp.php [404:570]


function ftp_size(#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp, string $filename): int {}

/**
 * Returns the last modified time of the given file
 * @link https://php.net/manual/en/function.ftp-mdtm.php
 * @param resource $ftp <p>
 * The link identifier of the FTP connection.
 * </p>
 * @param string $filename <p>
 * The file from which to extract the last modification time.
 * </p>
 * @return int the last modified time as a Unix timestamp on success, or -1 on
 * error.
 */
function ftp_mdtm(#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp, string $filename): int {}

/**
 * Renames a file or a directory on the FTP server
 * @link https://php.net/manual/en/function.ftp-rename.php
 * @param resource $ftp <p>
 * The link identifier of the FTP connection.
 * </p>
 * @param string $from <p>
 * The old file/directory name.
 * </p>
 * @param string $to <p>
 * The new name.
 * </p>
 * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
 */
function ftp_rename(#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp, string $from, string $to): bool {}

/**
 * Deletes a file on the FTP server
 * @link https://php.net/manual/en/function.ftp-delete.php
 * @param resource $ftp <p>
 * The link identifier of the FTP connection.
 * </p>
 * @param string $filename <p>
 * The file to delete.
 * </p>
 * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
 */
function ftp_delete(#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp, string $filename): bool {}

/**
 * Sends a SITE command to the server
 * @link https://php.net/manual/en/function.ftp-site.php
 * @param resource $ftp <p>
 * The link identifier of the FTP connection.
 * </p>
 * @param string $command <p>
 * The SITE command. Note that this parameter isn't escaped so there may
 * be some issues with filenames containing spaces and other characters.
 * </p>
 * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
 */
function ftp_site(#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp, string $command): bool {}

/**
 * Closes an FTP connection
 * @link https://php.net/manual/en/function.ftp-close.php
 * @param resource $ftp <p>
 * The link identifier of the FTP connection.
 * </p>
 * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
 */
function ftp_close(#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp): bool {}

/**
 * Set miscellaneous runtime FTP options
 * @link https://php.net/manual/en/function.ftp-set-option.php
 * @param resource $ftp <p>
 * The link identifier of the FTP connection.
 * </p>
 * @param int $option <p>
 * Currently, the following options are supported:
 * <table>
 * Supported runtime FTP options
 * <tr valign="top">
 * <td><b>FTP_TIMEOUT_SEC</b></td>
 * <td>
 * Changes the timeout in seconds used for all network related
 * functions. <i>value</i> must be an integer that
 * is greater than 0. The default timeout is 90 seconds.
 * </td>
 * </tr>
 * <tr valign="top">
 * <td><b>FTP_AUTOSEEK</b></td>
 * <td>
 * When enabled, GET or PUT requests with a
 * <i>resumepos</i> or <i>startpos</i>
 * parameter will first seek to the requested position within the file.
 * This is enabled by default.
 * </td>
 * </tr>
 * </table>
 * </p>
 * @param mixed $value <p>
 * This parameter depends on which <i>option</i> is chosen
 * to be altered.
 * </p>
 * @return bool <b>TRUE</b> if the option could be set; <b>FALSE</b> if not. A warning
 * message will be thrown if the <i>option</i> is not
 * supported or the passed <i>value</i> doesn't match the
 * expected value for the given <i>option</i>.
 */
function ftp_set_option(#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp, #[EV(flags: [FTP_TIMEOUT_SEC, FTP_AUTOSEEK, FTP_USEPASVADDRESS])] int $option, $value): bool {}

/**
 * Retrieves various runtime behaviours of the current FTP stream
 * @link https://php.net/manual/en/function.ftp-get-option.php
 * @param resource $ftp <p>
 * The link identifier of the FTP connection.
 * </p>
 * @param int $option <p>
 * Currently, the following options are supported:
 * <table>
 * Supported runtime FTP options
 * <tr valign="top">
 * <td><b>FTP_TIMEOUT_SEC</b></td>
 * <td>
 * Returns the current timeout used for network related operations.
 * </td>
 * </tr>
 * <tr valign="top">
 * <td><b>FTP_AUTOSEEK</b></td>
 * <td>
 * Returns <b>TRUE</b> if this option is on, <b>FALSE</b> otherwise.
 * </td>
 * </tr>
 * </table>
 * </p>
 * @return int|bool the value on success or <b>FALSE</b> if the given
 * <i>option</i> is not supported. In the latter case, a
 * warning message is also thrown.
 */
function ftp_get_option(#[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp, #[EV(flags: [FTP_TIMEOUT_SEC, FTP_AUTOSEEK])] int $option): int|bool {}

/**
 * Retrieves a file from the FTP server and writes it to an open file (non-blocking)
 * @link https://php.net/manual/en/function.ftp-nb-fget.php
 * @param resource $ftp <p>
 * The link identifier of the FTP connection.
 * </p>
 * @param resource $stream <p>
 * An open file pointer in which we store the data.
 * </p>
 * @param string $remote_filename <p>
 * The remote file path.
 * </p>
 * @param int $mode <p>
 * The transfer mode. Must be either <b>FTP_ASCII</b> or <b>FTP_BINARY</b>. Optional since PHP 7.3
 * </p>
 * @param int $offset [optional] <p>The position in the remote file to start downloading from.</p>
 * @return int <b>FTP_FAILED</b> or <b>FTP_FINISHED</b>
 * or <b>FTP_MOREDATA</b>.
 */
#[EV([FTP_FAILED, FTP_FINISHED, FTP_MOREDATA])]
function ftp_nb_fget(
    #[LanguageLevelTypeAware(['8.1' => 'FTP\Connection'], default: 'resource')] $ftp,
    $stream,
    string $remote_filename,
    #[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '5.3', to: '7.2')] int $mode,
    #[EV([FTP_ASCII, FTP_BINARY])] #[PhpStormStubsElementAvailable(from: '7.3')] int $mode = FTP_BINARY,
    int $offset = 0
): int {}