Browse Source

Zend_Feed_Pubsubhubbub: Applied expiration date to model using typical datetime format; added last_modified change for each save.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20195 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic 16 years ago
parent
commit
0fb2fb3681

+ 2 - 0
library/Zend/Feed/Pubsubhubbub/Model/Subscription.php

@@ -54,6 +54,8 @@ class Zend_Feed_Pubsubhubbub_Model_Subscription
         $result = $this->_db->find($data['id']);
         if ($result) {
             $data['created_time'] = $result->current()->created_time;
+            $now = new Zend_Date;
+            $data['last_modified'] = $now->get('yyyy-MM-dd HH:mm:ss');
             $this->_db->update(
                 $data,
                 $this->_db->getAdapter()->quoteInto('id = ?', $data['id'])

+ 1 - 1
library/Zend/Feed/Pubsubhubbub/Subscriber.php

@@ -759,7 +759,7 @@ class Zend_Feed_Pubsubhubbub_Subscriber
             'lease_seconds'      => $expires,
             'verify_token'       => hash('sha256', $params['hub.verify_token']),
             'secret'             => null,
-            'expiration_time'    => isset($params['hub.lease_seconds']) ? time() + $params['hub.lease_seconds'] : null,
+            'expiration_time'    => $expires,
             'subscription_state' => Zend_Feed_Pubsubhubbub::SUBSCRIPTION_NOTVERIFIED,
         );
         $this->getStorage()->setSubscription($data);