当前位置: 首页>>代码示例>>PHP>>正文


PHP Auth_OpenID_Association::deserialize方法代码示例

本文整理汇总了PHP中Auth_OpenID_Association::deserialize方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth_OpenID_Association::deserialize方法的具体用法?PHP Auth_OpenID_Association::deserialize怎么用?PHP Auth_OpenID_Association::deserialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Auth_OpenID_Association的用法示例。


在下文中一共展示了Auth_OpenID_Association::deserialize方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test_me

 function test_me()
 {
     $issued = time();
     $lifetime = 600;
     $assoc = new Auth_OpenID_Association('handle', 'secret', $issued, $lifetime, 'HMAC-SHA1');
     $s = $assoc->serialize();
     $assoc2 = Auth_OpenID_Association::deserialize('Auth_OpenID_Association', $s);
     if ($assoc2 === null) {
         $this->fail('deserialize returned null');
     } else {
         $this->assertTrue($assoc2->equal($assoc));
     }
 }
开发者ID:AlexChien,项目名称:EY_BBS,代码行数:13,代码来源:Association.php

示例2: getServerAssociations

 /**
  * Retrieve all associations for a given server.
  *
  * The associations are returned as an associative array with the
  * association handle as the index and the association object as
  * the value.
  *
  * @param string $server_url  The server.
  * @return array  Associative array with associations.
  */
 private function getServerAssociations($server_url)
 {
     assert('is_string($server_url)');
     if (!array_key_exists($server_url, $this->associations)) {
         return array();
     }
     $ret = array();
     foreach ($this->associations[$server_url] as $handle => $association) {
         $association = Auth_OpenID_Association::deserialize('Auth_OpenID_Association', $association);
         if ($association === NULL) {
             continue;
         }
         if ($association->getExpiresIn() == 0) {
             continue;
         }
         $ret[$handle] = $association;
     }
     return $ret;
 }
开发者ID:Stony-Brook-University,项目名称:doitsbu,代码行数:29,代码来源:StateStore.php

示例3: cleanupAssociations

	function cleanupAssociations() { 
		$associations = get_option('openid_associations');

		foreach ($associations as $key => $assoc_s) {
			$assoc = Auth_OpenID_Association::deserialize('Auth_OpenID_Association', $assoc_s);

			if ( $assoc->getExpiresIn() == 0) {
				unset($associations[$key]);
			}
		}

		update_option('openid_associations', $associations);
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:13,代码来源:store.php

示例4: _allAssocs

 /**
  * Remove expired entries from the database. This is potentially
  * expensive, so only run when it is acceptable to take time.
  *
  * @access private
  */
 function _allAssocs()
 {
     $all_associations = array();
     $association_filenames = Auth_OpenID_FileStore::_listdir($this->association_dir);
     foreach ($association_filenames as $association_filename) {
         $association_file = fopen($association_filename, 'rb');
         if ($association_file !== false) {
             $assoc_s = fread($association_file, filesize($association_filename));
             fclose($association_file);
             // Remove expired or corrupted associations
             $association = Auth_OpenID_Association::deserialize('Auth_OpenID_Association', $assoc_s);
             if ($association === null) {
                 Auth_OpenID_FileStore::_removeIfPresent($association_filename);
             } else {
                 if ($association->getExpiresIn() == 0) {
                     $all_associations[] = array($association_filename, $association);
                 }
             }
         }
     }
     return $all_associations;
 }
开发者ID:danielkjfrog,项目名称:docker,代码行数:28,代码来源:FileStore.php

示例5: clean

 /**
  * Remove expired entries from the database. This is potentially
  * expensive, so only run when it is acceptable to take time.
  */
 function clean()
 {
     if (!$this->active) {
         trigger_error("FileStore no longer active", E_USER_ERROR);
         return null;
     }
     $nonces = Auth_OpenID_FileStore::_listdir($this->nonce_dir);
     $now = time();
     // Check all nonces for expiry
     foreach ($nonces as $nonce) {
         $filename = $this->nonce_dir . DIRECTORY_SEPARATOR . $nonce;
         $st = @stat($filename);
         if ($st !== false) {
             // Remove the nonce if it has expired
             $nonce_age = $now - $st[9];
             if ($nonce_age > $this->max_nonce_age) {
                 Auth_OpenID_FileStore::_removeIfPresent($filename);
             }
         }
     }
     $association_filenames = Auth_OpenID_FileStore::_listdir($this->association_dir);
     foreach ($association_filenames as $association_filename) {
         $association_file = fopen($association_filename, 'rb');
         if ($association_file !== false) {
             $assoc_s = fread($association_file, filesize($association_filename));
             fclose($association_file);
             // Remove expired or corrupted associations
             $association = Auth_OpenID_Association::deserialize('Auth_OpenID_Association', $assoc_s);
             if ($association === null) {
                 Auth_OpenID_FileStore::_removeIfPresent($association_filename);
             } else {
                 if ($association->getExpiresIn() == 0) {
                     Auth_OpenID_FileStore::_removeIfPresent($association_filename);
                 }
             }
         }
     }
 }
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:42,代码来源:FileStore.php

示例6: _getKnownAssociation

 function _getKnownAssociation($server_url, $handle)
 {
     global $wgMemc;
     $k = $this->_associationKey($server_url, $handle);
     $v = $wgMemc->get($k);
     if ($v !== false && strlen($v) > 0) {
         # FIXME: why is this nl getting lost?
         $v .= "\n";
         $assoc = Auth_OpenID_Association::deserialize('Auth_OpenID_Association', $v);
         if ($assoc->getExpiresIn() > 0) {
             return $assoc;
         } else {
             return null;
         }
     }
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:16,代码来源:MemcStore.php


注:本文中的Auth_OpenID_Association::deserialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。