Changeset 9821
- Timestamp:
- 06/24/08 00:02:49 (5 years ago)
- Files:
-
- plugins/sfPropelPlanetPlugin/trunk/README (modified) (1 diff)
- plugins/sfPropelPlanetPlugin/trunk/config/schema.yml (modified) (1 diff)
- plugins/sfPropelPlanetPlugin/trunk/lib/model/sfPlanetFeedEntryPeer.php (modified) (1 diff)
- plugins/sfPropelPlanetPlugin/trunk/lib/task/base/sfPlanetBaseTask.class.php (modified) (1 diff)
- plugins/sfPropelPlanetPlugin/trunk/lib/task/sfPlanetFeedGrabTask.class.php (modified) (1 diff)
- plugins/sfPropelPlanetPlugin/trunk/lib/task/sfPlanetFeedPurgeTask.class.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfPropelPlanetPlugin/trunk/README
r9748 r9821 46 46 47 47 == After plugin(s) has been installed == 48 Run these commands within your project: 49 48 First, you must enable the Propel behaviors, tuning your `config/propel.ini` 49 file by changing the value of the `propel.builder.addBehaviors` property value: 50 {{{ 51 propel.builder.addBehaviors = true 52 }}} 53 54 Then run the following commands within your project: 50 55 {{{ 51 56 $ php symfony cache:clear plugins/sfPropelPlanetPlugin/trunk/config/schema.yml
r9819 r9821 12 12 is_active: { type: boolean, default: 0 } 13 13 periodicity: { type: integer, required: true, default: 3600 } 14 #auto_purge: { type: integer, required: true, default: 0 } 14 15 last_grabbed_at: { type: timestamp, index: true } 15 16 _indexes: plugins/sfPropelPlanetPlugin/trunk/lib/model/sfPlanetFeedEntryPeer.php
r9819 r9821 7 7 class sfPlanetFeedEntryPeer extends BasesfPlanetFeedEntryPeer 8 8 { 9 10 /** 11 * Deletes entries older than provided timestamp 12 * 13 * @param int $timestamp The UNIX timestamp 14 * @param sfPlanetFeed $feed The feed (optional) 15 * @return int The number of deleted entries 16 */ 17 public static function doDeleteOlderThan($timestamp, sfPlanetFeed $feed = null) 18 { 19 $c = new Criteria(); 20 21 if (!is_null($feed)) 22 { 23 $c->add(self::FEED_ID, $feed->getId()); 24 } 25 26 $c->add(self::PUBLISHED_AT, date('Y-m-d H:i:s'), Criteria::LESS_THAN); 27 28 return self::doDelete($c); 29 } 9 30 10 31 /** plugins/sfPropelPlanetPlugin/trunk/lib/task/base/sfPlanetBaseTask.class.php
r9727 r9821 97 97 98 98 /** 99 * Purges entries of a particular feed older than provided timestamp 100 * 101 * @param sfPlanetFeed $feed The feed 102 * @param int $timestamp The UNIX timestamp 103 * @return int The number of deleted entries 104 */ 105 public function purgeFeedEntries(sfPlanetFeed $feed, $timestamp) 106 { 107 try 108 { 109 return sfPlanetFeedEntryPeer::doDeleteOlderThan($timestamp, $feed); 110 } 111 catch (PropelException $e) 112 { 113 $this->logError(sprintf('Error while purging entries for feed "%s": %s', 114 $feed->getTitle(), $e->getMessage())); 115 } 116 } 117 118 /** 119 * Purges entries older than provided timestamp 120 * 121 * @param int $timestamp 122 */ 123 public function purgeEntries($timestamp) 124 { 125 try 126 { 127 return sfPlanetFeedEntryPeer::doDeleteOlderThan($timestamp); 128 } 129 catch (PropelException $e) 130 { 131 $this->logError(sprintf('Error while purging entries: %s', $e->getMessage())); 132 } 133 } 134 135 /** 99 136 * Implemented here because declared abstract in parent class 100 137 * plugins/sfPropelPlanetPlugin/trunk/lib/task/sfPlanetFeedGrabTask.class.php
r9735 r9821 18 18 $this->briefDescription = 'Grabs last planet feeds entries and store them in the database'; 19 19 $this->detailedDescription = <<<EOF 20 The [planet: grab-entries|INFO] updates outdated feed entries, oneswhich the21 [periodicity|COMMENT] value has been exceeded.20 The [planet:feed-grab|INFO] updates outdated feeds, ones from which the 21 [periodicity|COMMENT] time has been exceeded. 22 22 23 If you want to force grabbing for all feeds, even outdatedones:23 If you want to force grabbing for all feeds, even up-to-date ones: 24 24 25 25 $ php symfony planet:feed-grab [-f|COMMENT]