質問

PHPと公式のOAuthクラスを使用してOAuthプロバイダーを作成しようとしています。

プロバイダーにリクエストを処理させようとしていますが、実際には2つのSegFaultを提供します。

これが私のプロバイダーです

<?php

    class Provider{

        private $oauth;

        public function __construct(){

            try {

            /* create our instance */
            $this->oauth = new OAuthProvider();

            /* setup check functions */
            $this->oauth->consumerHandler(array($this,'checkConsumer'));
            $this->oauth->timestampNonceHandler(array($this,'checkNonce'));
            $this->oauth->tokenHandler(array($this,'checkToken'));

            /* If we are issuing a request token we need to disable checkToken */
            if(strstr($_SERVER['REQUEST_URI'],"oauth/request_token")){
                $this->oauth->isRequestTokenEndpoint(true); 
            }

            /* now that everything is setup we run the checks */
                $this->oauth->checkOAuthRequest(null,OAUTH_HTTP_METHOD_GET);
            } catch(OAuthException $E){
                echo OAuthProvider::reportProblem($E);
                $this->oauth_error = true;
            }


        }

        public function checkConsumer($provider){
            $provider->consumer_secret = "secret";
            return OAUTH_OK;
        }

        public function checkToken($provider){
            return OAUTH_OK;
        }

        public function checkNonce($provider){
            return OAUTH_OK;
        }

    }
?>

そして、これが私がテストに使用する私のクライアントです。

<?php
    $oauth_client = new Oauth("key","secret");
    try {
        $oauth_client->getRequestToken("http://localhost/OAuthProviderExample/oauth/request_token");
    } catch(OAuthException $E){
        echo $E;
    }
?>

クライアントはこれを出力します

exception 'OAuthException' with message 'making the request failed (dunno why)' in /var/www/OAuthProviderExample/client/index.php:4 Stack trace: #0 /var/www/OAuthProviderExample/client/index.php(4): OAuth->getRequestToken('http://localhos...') #1 {main}

エラーログにこれが表示されます

[Fri Jan 07 09:33:45 2011] [notice] child pid 3662 exit signal Segmentation fault (11)
[Fri Jan 07 09:33:45 2011] [notice] child pid 3663 exit signal Segmentation fault (11)

私は今何をすべきかについての手がかりがありません!

役に立ちましたか?

解決

どうやら、PECLのバージョン1.0.0にはバグがあります。

トランクからコンパイルして、私のためにそれを修正しました

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top