<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.oauth.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'oauth.constants.php',
    1 => '预定义常量',
    2 => '预定义常量',
  ),
  'up' => 
  array (
    0 => 'book.oauth.php',
    1 => 'OAuth',
  ),
  'prev' => 
  array (
    0 => 'oauth.installation.php',
    1 => '安装',
  ),
  'next' => 
  array (
    0 => 'oauth.examples.php',
    1 => '示例',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/oauth/constants.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="oauth.constants" class="appendix">
 <h1 class="title">预定义常量</h1>

 <p class="simpara">下列常量由此扩展定义，且仅在此扩展编译入 PHP 或在运行时动态载入时可用。</p>
 <p class="simpara">
这些常量牵涉到的大部分问题也都在官方的 OAuth <a href="http://wiki.oauth.net/ProblemReporting" class="link external">&raquo;&nbsp;问题报告</a> 文档里有描述。但是要注意，这些常量名是特定于 PHP 的，尽管这些命名规则看上去相似。
 </p>
 <dl>
  
  
   <dt id="constant.oauth-sig-method-rsasha1">
    <strong><code><a href="oauth.constants.php#constant.oauth-sig-method-rsasha1">OAUTH_SIG_METHOD_RSASHA1</a></code></strong>
    (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     OAuth <em>RSA-SHA1</em> 签名方法。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-sig-method-hmacsha1">
    <strong><code><a href="oauth.constants.php#constant.oauth-sig-method-hmacsha1">OAUTH_SIG_METHOD_HMACSHA1</a></code></strong>
    (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     OAuth <em>HMAC-SHA1</em> 签名方法。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-sig-method-hmacsha256">
    <strong><code><a href="oauth.constants.php#constant.oauth-sig-method-hmacsha256">OAUTH_SIG_METHOD_HMACSHA256</a></code></strong>
    (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     OAuth <em>HMAC-SHA256</em> 签名方法。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-auth-type-authorization">
    <strong><code><a href="oauth.constants.php#constant.oauth-auth-type-authorization">OAUTH_AUTH_TYPE_AUTHORIZATION</a></code></strong>
    (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     此常量代表把 OAuth 参数放在 <code class="literal">Authorization</code> 头部。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-auth-type-none">
    <strong><code><a href="oauth.constants.php#constant.oauth-auth-type-none">OAUTH_AUTH_TYPE_NONE</a></code></strong>
    (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     此常量标志着一个 NoAuth OAuth 请求。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-auth-type-uri">
    <strong><code><a href="oauth.constants.php#constant.oauth-auth-type-uri">OAUTH_AUTH_TYPE_URI</a></code></strong>
    (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     此常量表示将 OAuth 参数放在请求中。
     <abbr title="Uniform Resource Identifier">URI</abbr>.
    </span>
   </dd>
  
  
   <dt id="constant.oauth-auth-type-form">
    <strong><code><a href="oauth.constants.php#constant.oauth-auth-type-form">OAUTH_AUTH_TYPE_FORM</a></code></strong>
    (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)
   </dt>
   <dd>
    <span class="simpara">
   此常量表示将 OAuth 参数作为 HTTP POST 主体的一部分。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-http-method-get">
    <strong><code><a href="oauth.constants.php#constant.oauth-http-method-get">OAUTH_HTTP_METHOD_GET</a></code></strong>
    (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     为 OAuth 请求使用 <em>GET</em> 方法。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-http-method-post">
    <strong><code><a href="oauth.constants.php#constant.oauth-http-method-post">OAUTH_HTTP_METHOD_POST</a></code></strong>
    (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     为 OAuth 请求使用 <em>POST</em> 方法。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-http-method-put">
    <strong><code><a href="oauth.constants.php#constant.oauth-http-method-put">OAUTH_HTTP_METHOD_PUT</a></code></strong>
    (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     为 OAuth 请求使用 <em>PUT</em> 方法。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-http-method-head">
    <strong><code><a href="oauth.constants.php#constant.oauth-http-method-head">OAUTH_HTTP_METHOD_HEAD</a></code></strong>
    (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     为 OAuth 请求使用 <em>HEAD</em> 方法。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-http-method-delete">
    <strong><code><a href="oauth.constants.php#constant.oauth-http-method-delete">OAUTH_HTTP_METHOD_DELETE</a></code></strong>
    (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     为 OAuth 请求使用 <em>DELETE</em> 方法。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-reqengine-streams">
    <strong><code><a href="oauth.constants.php#constant.oauth-reqengine-streams">OAUTH_REQENGINE_STREAMS</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     使用 <span class="methodname"><a href="oauth.setrequestengine.php" class="methodname">OAuth::setRequestEngine()</a></span> 来设置引擎为 <a href="book.stream.php" class="link">PHP 流</a>，与用 <strong><code><a href="oauth.constants.php#constant.oauth-reqengine-curl">OAUTH_REQENGINE_CURL</a></code></strong> 的 <a href="book.curl.php" class="link">Curl</a> 截然相反。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-reqengine-curl">
    <strong><code><a href="oauth.constants.php#constant.oauth-reqengine-curl">OAUTH_REQENGINE_CURL</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     使用 <span class="methodname"><a href="oauth.setrequestengine.php" class="methodname">OAuth::setRequestEngine()</a></span> 来设置引擎为 <a href="book.curl.php" class="link">Curl</a>，与用 <strong><code><a href="oauth.constants.php#constant.oauth-reqengine-streams">OAUTH_REQENGINE_STREAMS</a></code></strong> 的 <a href="book.stream.php" class="link">PHP 流</a> 截然相反。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-ok">
    <strong><code><a href="oauth.constants.php#constant.oauth-ok">OAUTH_OK</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
    一切良好。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-bad-nonce">
    <strong><code><a href="oauth.constants.php#constant.oauth-bad-nonce">OAUTH_BAD_NONCE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <em>oauth_nonce</em> 值已经用于上一个上一个请求，因此现在不能使用了。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-bad-timestamp">
    <strong><code><a href="oauth.constants.php#constant.oauth-bad-timestamp">OAUTH_BAD_TIMESTAMP</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
      <em>oauth_timestamp</em> 值不能被服务提供者接受。这种情况下，响应应该也包含 <em>oauth_acceptable_timestamps</em> 参数。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-consumer-key-unknown">
    <strong><code><a href="oauth.constants.php#constant.oauth-consumer-key-unknown">OAUTH_CONSUMER_KEY_UNKNOWN</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
    <em>oauth_consumer_key</em> 暂时不能被服务提供者接受。比如，服务提供者限流了使用者。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-consumer-key-refused">
    <strong><code><a href="oauth.constants.php#constant.oauth-consumer-key-refused">OAUTH_CONSUMER_KEY_REFUSED</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     使用者密钥遭拒绝。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-invalid-signature">
    <strong><code><a href="oauth.constants.php#constant.oauth-invalid-signature">OAUTH_INVALID_SIGNATURE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
      <em>oauth_signature</em> 无效，因为和服务提供者的签名计算不匹配。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-token-used">
    <strong><code><a href="oauth.constants.php#constant.oauth-token-used">OAUTH_TOKEN_USED</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <em>oauth_token</em> 已经被消费。此令牌不能再被使用，因为在上一次请求中已经使用过。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-token-expired">
    <strong><code><a href="oauth.constants.php#constant.oauth-token-expired">OAUTH_TOKEN_EXPIRED</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <em>oauth_token</em> 已经过期。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-token-revoked">
    <strong><code><a href="oauth.constants.php#constant.oauth-token-revoked">OAUTH_TOKEN_REVOKED</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <em>oauth_token</em> 已经被撤销，且将决不再接受。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-token-rejected">
    <strong><code><a href="oauth.constants.php#constant.oauth-token-rejected">OAUTH_TOKEN_REJECTED</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <em>oauth_token</em> 被服务提供者拒绝。原因未知，也许是因为令牌从未发布、已经消费、过期、或服务提供者忘记了。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-verifier-invalid">
    <strong><code><a href="oauth.constants.php#constant.oauth-verifier-invalid">OAUTH_VERIFIER_INVALID</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <em>oauth_verifier</em> 不正确。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-parameter-absent">
    <strong><code><a href="oauth.constants.php#constant.oauth-parameter-absent">OAUTH_PARAMETER_ABSENT</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     一个必需的参数没有接收到。这种情况下，响应也应该包含 <em>oauth_parameters_absent</em> 参数。
    </span>
   </dd>
  
  
   <dt id="constant.oauth-signature-method-rejected">
    <strong><code><a href="oauth.constants.php#constant.oauth-signature-method-rejected">OAUTH_SIGNATURE_METHOD_REJECTED</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     <em>oauth_signature_method</em> 不能被服务提供者接受。
    </span>
   </dd>
  
 </dl>
</div>
<?php manual_footer($setup); ?>