wp/wp-includes/class-wp-http-proxy.php
changeset 19 3d72ae0968f4
parent 16 a86126ab1dd4
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
    23  * <li>WP_PROXY_PORT - Proxy port for connection. No default, must be defined.</li>
    23  * <li>WP_PROXY_PORT - Proxy port for connection. No default, must be defined.</li>
    24  * <li>WP_PROXY_USERNAME - Proxy username, if it requires authentication.</li>
    24  * <li>WP_PROXY_USERNAME - Proxy username, if it requires authentication.</li>
    25  * <li>WP_PROXY_PASSWORD - Proxy password, if it requires authentication.</li>
    25  * <li>WP_PROXY_PASSWORD - Proxy password, if it requires authentication.</li>
    26  * <li>WP_PROXY_BYPASS_HOSTS - Will prevent the hosts in this list from going through the proxy.
    26  * <li>WP_PROXY_BYPASS_HOSTS - Will prevent the hosts in this list from going through the proxy.
    27  * You do not need to have localhost and the site host in this list, because they will not be passed
    27  * You do not need to have localhost and the site host in this list, because they will not be passed
    28  * through the proxy. The list should be presented in a comma separated list, wildcards using * are supported, eg. *.wordpress.org</li>
    28  * through the proxy. The list should be presented in a comma separated list, wildcards using * are supported. Example: *.wordpress.org</li>
    29  * </ol>
    29  * </ol>
    30  *
    30  *
    31  * An example can be as seen below.
    31  * An example can be as seen below.
    32  *
    32  *
    33  *     define('WP_PROXY_HOST', '192.168.84.101');
    33  *     define('WP_PROXY_HOST', '192.168.84.101');
    42 class WP_HTTP_Proxy {
    42 class WP_HTTP_Proxy {
    43 
    43 
    44 	/**
    44 	/**
    45 	 * Whether proxy connection should be used.
    45 	 * Whether proxy connection should be used.
    46 	 *
    46 	 *
    47 	 * @since 2.8.0
    47 	 * Constants which control this behaviour:
    48 	 *
    48 	 *
    49 	 * @use WP_PROXY_HOST
    49 	 * - `WP_PROXY_HOST`
    50 	 * @use WP_PROXY_PORT
    50 	 * - `WP_PROXY_PORT`
       
    51 	 *
       
    52 	 * @since 2.8.0
    51 	 *
    53 	 *
    52 	 * @return bool
    54 	 * @return bool
    53 	 */
    55 	 */
    54 	public function is_enabled() {
    56 	public function is_enabled() {
    55 		return defined( 'WP_PROXY_HOST' ) && defined( 'WP_PROXY_PORT' );
    57 		return defined( 'WP_PROXY_HOST' ) && defined( 'WP_PROXY_PORT' );
    56 	}
    58 	}
    57 
    59 
    58 	/**
    60 	/**
    59 	 * Whether authentication should be used.
    61 	 * Whether authentication should be used.
    60 	 *
    62 	 *
    61 	 * @since 2.8.0
    63 	 * Constants which control this behaviour:
    62 	 *
    64 	 *
    63 	 * @use WP_PROXY_USERNAME
    65 	 * - `WP_PROXY_USERNAME`
    64 	 * @use WP_PROXY_PASSWORD
    66 	 * - `WP_PROXY_PASSWORD`
       
    67 	 *
       
    68 	 * @since 2.8.0
    65 	 *
    69 	 *
    66 	 * @return bool
    70 	 * @return bool
    67 	 */
    71 	 */
    68 	public function use_authentication() {
    72 	public function use_authentication() {
    69 		return defined( 'WP_PROXY_USERNAME' ) && defined( 'WP_PROXY_PASSWORD' );
    73 		return defined( 'WP_PROXY_USERNAME' ) && defined( 'WP_PROXY_PASSWORD' );