Auth_OpenID_MemcachedStore::removeAssociation PHP Метод

removeAssociation() публичный Метод

Immediately delete association from memcache.
public removeAssociation ( $server_url, $handle )
    function removeAssociation($server_url, $handle)
    {
        // create memcached keys for association itself
        // and list of associations for this server
        $serverKey = $this->associationServerKey($server_url);
        $associationKey = $this->associationKey($server_url, $handle);
        // get list of associations
        $serverAssociations = $this->connection->get($serverKey);
        // return null if failed or got empty list
        if (!$serverAssociations) {
            return false;
        }
        // ensure that given association key exists in list
        $serverAssociations = array_flip($serverAssociations);
        if (!array_key_exists($associationKey, $serverAssociations)) {
            return false;
        }
        // remove given association key from list
        unset($serverAssociations[$associationKey]);
        $serverAssociations = array_flip($serverAssociations);
        // save updated list
        $this->connection->set($serverKey, $serverAssociations, $this->compress);
        // delete association
        return $this->connection->delete($associationKey);
    }