HTTP_OAuthProviderのトークン保持は今までCache_Liteしか使えなかった。
流石にそれだけじゃあ寂しかったので追加。
Pecl::MemcachedとPecl::Memcacheを追加。
世の中の流れとしては、Pecl::Memcached推奨らしい…。
トークンの保持するクラスは、ストアドライバと呼ぶ事にする。
Pear::OpenIDのStoreを参考にした。
HTTP_OAuthProvider - Openpear
http://openpear.org/package/HTTP_OAuthProvider
Memcachedをストアドライバに使う
<?php $mem_options = array( 'host' => '127.0.0.1', 'port' => 11211 ); $store = HTTP_OAuthProvider_Store::factory('Memcached', $mem_options); $oauth = new HTTP_OAuthProvider(); $oauth->setStore($store);
Memcacheをストアドライバに使う
<?php $mem_options = array( 'host' => '127.0.0.1', 'port' => 11211 ); $store = HTTP_OAuthProvider_Store::factory('Memcache', $mem_options); $oauth = new HTTP_OAuthProvider(); $oauth->setStore($store);
Pecl::Memcachedインストール
今までlibmemcachedを入れるのが面倒でPecl::Memcachedを入れてなかった。
RPMをYumで入れたいのに、どこのリポジトリでも公開されてない。
だから自分で作った。
#!/bin/bash # install dependency yum -y install --enablerepo=rpmforge re2c # make libmemcached rpm cd /usr/local/src wget http://download.tangent.org/libmemcached-0.43.tar.gz tar -C /tmp -xvf libmemcached-0.43.tar.gz cd /tmp/libmemcached-0.43 ./configure make checkinstall -R -y # update repo createrepo /usr/src/redhat/RPMS/i386/ # install libmemcached yum -y install --enablerepo=local libmemcached # install memcached pecl install memcached # php ini echo "extension=memcached.so" > /etc/php.d/memcached.ini # restart httpd #service httpd restart
とりあえずRPM公開。
CentOS用。
/repo/centos/5/i386
http://eth0jp-repo.appspot.com/repo/centos/5/i386