public static function ensureCurlErrorConstants () {
    $defs = array(
      'CURLE_COULDNT_CONNECT' => 7,
      'CURLE_COULDNT_RESOLVE_HOST' => 6,
      'CURLE_HTTP_RETURNED_ERROR' => 22,
      'CURLE_OPERATION_TIMEDOUT' => 28,
      'CURLE_PEER_FAILED_VERIFICATION' => 51,
      'CURLE_SSL_CACERT' => 60,
      'CURLE_SSL_CACERT_BADFILE' => 77,
      'CURLE_SSL_CERTPROBLEM' => 58,
      'CURLE_SSL_CIPHER' => 59,
      'CURLE_SSL_CONNECT_ERROR' => 35,
      'CURLE_SSL_CRL_BADFILE' => 82,
      'CURLE_SSL_ENGINE_INITFAILED' => 66,
      'CURLE_SSL_ENGINE_NOTFOUND' => 53,
      'CURLE_SSL_ENGINE_SETFAILED' => 54,
      'CURLE_SSL_ISSUER_ERROR' => 83,
      'CURLE_SSL_SHUTDOWN_FAILED' => 80,
      'CURLE_UNSUPPORTED_PROTOCOL' => 1,
      'CURLE_URL_MALFORMAT' => 3,
      'CURLE_USE_SSL_FAILED' => 64,
    );

    foreach ($defs as $constName => $errCode) {
      if (!defined($constName)) {
        define($constName, $errCode);
      }
    }
  }