1 | <?php |
||
15 | class Utils { |
||
16 | |||
17 | const DEFAULT_JETPACK_API_VERSION = 1; |
||
18 | |||
19 | /** |
||
20 | * Some hosts disable the OpenSSL extension and so cannot make outgoing HTTPS requests. |
||
21 | * This method sets the URL scheme to HTTP when HTTPS requests can't be made. |
||
22 | * |
||
23 | * @param string $url The url. |
||
24 | * @return string The url with the required URL scheme. |
||
25 | */ |
||
26 | public static function fix_url_for_bad_hosts( $url ) { |
||
40 | |||
41 | /** |
||
42 | * Enters a user token into the user_tokens option |
||
43 | * |
||
44 | * @param int $user_id The user id. |
||
45 | * @param string $token The user token. |
||
46 | * @param bool $is_master_user Whether the user is the master user. |
||
47 | * @return bool |
||
48 | */ |
||
49 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
||
64 | |||
65 | /** |
||
66 | * Returns the Jetpack__API_VERSION constant if it exists, else returns a |
||
67 | * default value of 1. |
||
68 | * |
||
69 | * @return integer |
||
70 | */ |
||
71 | public static function get_jetpack_api_version() { |
||
76 | } |
||
77 |