5656/* DEFAULTS *********************************************/
5757
5858// error handler needs these, so let's set them now.
59- define ('VERSION ' , '1.35 ' );
59+ define ('VERSION ' , '1.36 ' );
6060define ('DIR2CAST_HOMEPAGE ' , 'https://github.com/ben-xo/dir2cast/ ' );
6161define ('GENERATOR ' , 'dir2cast ' . VERSION . ' by Ben XO ( ' . DIR2CAST_HOMEPAGE . ') ' );
6262
@@ -125,6 +125,7 @@ public function __call($method, $params)
125125}
126126
127127interface Podcast_Helper {
128+ public function id ();
128129 public function appendToChannel (DOMElement $ d , DOMDocument $ doc );
129130 public function appendToItem (DOMElement $ d , DOMDocument $ doc , RSS_Item $ item );
130131 public function addNamespaceTo (DOMElement $ d , DOMDocument $ doc );
@@ -135,7 +136,10 @@ public function addNamespaceTo(DOMElement $d, DOMDocument $doc);
135136 *
136137 */
137138class getID3_Podcast_Helper implements Podcast_Helper {
138-
139+ public function id ()
140+ {
141+ return get_class ($ this );
142+ }
139143 static $ AUTO_SAVE_COVER_ART = false ;
140144
141145 public function appendToChannel (DOMElement $ d , DOMDocument $ doc ) { /* nothing */ }
@@ -206,6 +210,10 @@ public function appendToItem(DOMElement $d, DOMDocument $doc, RSS_Item $item)
206210 *
207211 */
208212class Caching_getID3_Podcast_Helper implements Podcast_Helper {
213+ public function id ()
214+ {
215+ return get_class ($ this );
216+ }
209217
210218 protected $ wrapped_helper ;
211219 protected $ cache_dir ;
@@ -267,6 +275,10 @@ protected function saveToCache($filename, Serializable $item) {
267275}
268276
269277class Atom_Podcast_Helper extends GetterSetter implements Podcast_Helper {
278+ public function id ()
279+ {
280+ return get_class ($ this );
281+ }
270282
271283 protected $ self_link ;
272284
@@ -312,7 +324,13 @@ public function setSelfLink($link)
312324}
313325
314326class iTunes_Podcast_Helper extends GetterSetter implements Podcast_Helper {
327+ public function id ()
328+ {
329+ return get_class ($ this );
330+ }
315331
332+ static $ ITUNES_SUBTITLE_SUFFIX = '' ;
333+
316334 protected $ owner_name , $ owner_email , $ image_href , $ explicit ;
317335 protected $ categories = array ();
318336
@@ -404,7 +422,7 @@ public function appendToItem(DOMElement $item_element, DOMDocument $doc, RSS_Ite
404422 $ itunes_subtitle = $ item ->getSubtitle ();
405423 if ($ itunes_subtitle !== '' )
406424 {
407- $ elements ['subtitle ' ] = $ itunes_subtitle . ITUNES_SUBTITLE_SUFFIX ;
425+ $ elements ['subtitle ' ] = $ itunes_subtitle . iTunes_Podcast_Helper:: $ ITUNES_SUBTITLE_SUFFIX ;
408426 }
409427
410428 foreach ($ elements as $ key => $ val )
@@ -552,7 +570,7 @@ public function appendToChannel(DOMElement $channel, DOMDocument $doc)
552570
553571 public function addHelper (Podcast_Helper $ helper )
554572 {
555- $ this ->helpers [] = $ helper ;
573+ $ this ->helpers [$ helper -> id () ] = $ helper ;
556574 return $ helper ;
557575 }
558576}
@@ -976,7 +994,7 @@ abstract class Podcast extends GetterSetter
976994
977995 public function addHelper (Podcast_Helper $ helper )
978996 {
979- $ this ->helpers [] = $ helper ;
997+ $ this ->helpers [$ helper -> id () ] = $ helper ;
980998
981999 // attach helper to items already added.
9821000 // new items will have the helper attached when they are added.
@@ -1413,7 +1431,7 @@ protected function cache_is_stale($cache_date, $most_recent_modification)
14131431 */
14141432 public function renew ()
14151433 {
1416- touch ($ this ->temp_file ); // renew cache file life expectancy
1434+ touch ($ this ->temp_file ); // renew cache file life expectancy
14171435 }
14181436
14191437 public function uncache ()
@@ -1915,6 +1933,7 @@ public static function defaults(array $SERVER)
19151933 Dir_Podcast::$ DEBUG = DEBUG ;
19161934 Cached_Dir_Podcast::$ MIN_CACHE_TIME = MIN_CACHE_TIME ;
19171935 getID3_Podcast_Helper::$ AUTO_SAVE_COVER_ART = AUTO_SAVE_COVER_ART ;
1936+ iTunes_Podcast_Helper::$ ITUNES_SUBTITLE_SUFFIX = ITUNES_SUBTITLE_SUFFIX ;
19181937
19191938 // Set up up factory settings for RSS Items
19201939 RSS_File_Item::$ FILES_URL = MP3_URL ; // TODO: rename this to MEDIA_URL
0 commit comments