Make WordPress Core


Ignore:
Timestamp:
04/15/2020 11:52:38 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Remove conditional use of stream_get_contents() PHP function.

The function was introduced in PHP 5.0.0. Now that the minimum version of PHP required by WordPress is 5.6.20, these conditions are no longer needed.

Props jrf.
Fixes #48091.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php

    r47219 r47584  
    77 * @contrib http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/ - Installation Notes
    88 *
    9  * Complie libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now, But many users have found the latest versions work)
     9 * Compile libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now, But many users have found the latest versions work)
    1010 *
    1111 * cd /usr/src
     
    2727 * Check phpinfo() streams to confirm that: ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp  exist.
    2828 *
    29  * Note: as of WordPress 2.8, This utilises the PHP5+ function 'stream_get_contents'
     29 * Note: As of WordPress 2.8, this utilises the PHP5+ function `stream_get_contents()`.
    3030 *
    3131 * @since 2.7.0
     
    6868        if ( ! extension_loaded( 'ssh2' ) ) {
    6969            $this->errors->add( 'no_ssh2_ext', __( 'The ssh2 PHP extension is not available' ) );
    70             return;
    71         }
    72         if ( ! function_exists( 'stream_get_contents' ) ) {
    73             $this->errors->add(
    74                 'ssh2_php_requirement',
    75                 sprintf(
    76                     /* translators: %s: stream_get_contents() */
    77                     __( 'The ssh2 PHP extension is available, however, we require the PHP5 function %s' ),
    78                     '<code>stream_get_contents()</code>'
    79                 )
    80             );
    8170            return;
    8271        }
Note: See TracChangeset for help on using the changeset viewer.