PageRenderTime 53ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/gapi/Zend/Feed/Writer/Feed/FeedAbstract.php

http://stuffpack.googlecode.com/
PHP | 805 lines | 462 code | 53 blank | 290 comment | 109 complexity | e4adeac40fda889c1722cc0dc631399d MD5 | raw file
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Feed_Writer
  17. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. * @version $Id: Feed.php 20096 2010-01-06 02:05:09Z bkarwin $
  20. */
  21. /**
  22. * @see Zend_Date
  23. */
  24. require_once 'Zend/Date.php';
  25. /**
  26. * @see Zend_Date
  27. */
  28. require_once 'Zend/Uri.php';
  29. /**
  30. * @see Zend_Feed_Writer
  31. */
  32. require_once 'Zend/Feed/Writer.php';
  33. /**
  34. * @see Zend_Feed_Writer_Entry
  35. */
  36. require_once 'Zend/Feed/Writer/Entry.php';
  37. /**
  38. * @see Zend_Feed_Writer_Renderer_Feed_Atom
  39. */
  40. require_once 'Zend/Feed/Writer/Renderer/Feed/Atom.php';
  41. /**
  42. * @see Zend_Feed_Writer_Renderer_Feed_Rss
  43. */
  44. require_once 'Zend/Feed/Writer/Renderer/Feed/Rss.php';
  45. /**
  46. * @category Zend
  47. * @package Zend_Feed_Writer
  48. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  49. * @license http://framework.zend.com/license/new-bsd New BSD License
  50. */
  51. class Zend_Feed_Writer_Feed_FeedAbstract
  52. {
  53. /**
  54. * Contains all Feed level date to append in feed output
  55. *
  56. * @var array
  57. */
  58. protected $_data = array();
  59. /**
  60. * Holds the value "atom" or "rss" depending on the feed type set when
  61. * when last exported.
  62. *
  63. * @var string
  64. */
  65. protected $_type = null;
  66. /**
  67. * Constructor: Primarily triggers the registration of core extensions and
  68. * loads those appropriate to this data container.
  69. *
  70. * @return void
  71. */
  72. public function __construct()
  73. {
  74. Zend_Feed_Writer::registerCoreExtensions();
  75. $this->_loadExtensions();
  76. }
  77. /**
  78. * Set a single author
  79. *
  80. * @param int $index
  81. * @return string|null
  82. */
  83. public function addAuthor($name, $email = null, $uri = null)
  84. {
  85. $author = array();
  86. if (is_array($name)) {
  87. if (!array_key_exists('name', $name) || empty($name['name']) || !is_string($name['name'])) {
  88. require_once 'Zend/Feed/Exception.php';
  89. throw new Zend_Feed_Exception('Invalid parameter: author array must include a "name" key with a non-empty string value');
  90. }
  91. $author['name'] = $name['name'];
  92. if (isset($name['email'])) {
  93. if (empty($name['email']) || !is_string($name['email'])) {
  94. require_once 'Zend/Feed/Exception.php';
  95. throw new Zend_Feed_Exception('Invalid parameter: "email" array value must be a non-empty string');
  96. }
  97. $author['email'] = $name['email'];
  98. }
  99. if (isset($name['uri'])) {
  100. if (empty($name['uri']) || !is_string($name['uri']) || !Zend_Uri::check($name['uri'])) {
  101. require_once 'Zend/Feed/Exception.php';
  102. throw new Zend_Feed_Exception('Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI');
  103. }
  104. $author['uri'] = $name['uri'];
  105. }
  106. } else {
  107. if (empty($name['name']) || !is_string($name['name'])) {
  108. require_once 'Zend/Feed/Exception.php';
  109. throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string value');
  110. }
  111. $author['name'] = $name;
  112. if (isset($email)) {
  113. if (empty($email) || !is_string($email)) {
  114. require_once 'Zend/Feed/Exception.php';
  115. throw new Zend_Feed_Exception('Invalid parameter: "email" value must be a non-empty string');
  116. }
  117. $author['email'] = $email;
  118. }
  119. if (isset($uri)) {
  120. if (empty($uri) || !is_string($uri) || !Zend_Uri::check($uri)) {
  121. require_once 'Zend/Feed/Exception.php';
  122. throw new Zend_Feed_Exception('Invalid parameter: "uri" value must be a non-empty string and valid URI/IRI');
  123. }
  124. $author['uri'] = $uri;
  125. }
  126. }
  127. $this->_data['authors'][] = $author;
  128. }
  129. /**
  130. * Set an array with feed authors
  131. *
  132. * @return array
  133. */
  134. public function addAuthors(array $authors)
  135. {
  136. foreach($authors as $author) {
  137. $this->addAuthor($author);
  138. }
  139. }
  140. /**
  141. * Set the copyright entry
  142. *
  143. * @return string|null
  144. */
  145. public function setCopyright($copyright)
  146. {
  147. if (empty($copyright) || !is_string($copyright)) {
  148. require_once 'Zend/Feed/Exception.php';
  149. throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
  150. }
  151. $this->_data['copyright'] = $copyright;
  152. }
  153. /**
  154. * Set the feed creation date
  155. *
  156. * @param null|integer|Zend_Date
  157. */
  158. public function setDateCreated($date = null)
  159. {
  160. $zdate = null;
  161. if (is_null($date)) {
  162. $zdate = new Zend_Date;
  163. } elseif (ctype_digit($date) && strlen($date) == 10) {
  164. $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP);
  165. } elseif ($date instanceof Zend_Date) {
  166. $zdate = $date;
  167. } else {
  168. require_once 'Zend/Feed/Exception.php';
  169. throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter');
  170. }
  171. $this->_data['dateCreated'] = $zdate;
  172. }
  173. /**
  174. * Set the feed modification date
  175. *
  176. * @param null|integer|Zend_Date
  177. */
  178. public function setDateModified($date = null)
  179. {
  180. $zdate = null;
  181. if (is_null($date)) {
  182. $zdate = new Zend_Date;
  183. } elseif (ctype_digit($date) && strlen($date) == 10) {
  184. $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP);
  185. } elseif ($date instanceof Zend_Date) {
  186. $zdate = $date;
  187. } else {
  188. require_once 'Zend/Feed/Exception.php';
  189. throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter');
  190. }
  191. $this->_data['dateModified'] = $zdate;
  192. }
  193. /**
  194. * Set the feed last-build date. Ignored for Atom 1.0.
  195. *
  196. * @param null|integer|Zend_Date
  197. */
  198. public function setLastBuildDate($date = null)
  199. {
  200. $zdate = null;
  201. if (is_null($date)) {
  202. $zdate = new Zend_Date;
  203. } elseif (ctype_digit($date) && strlen($date) == 10) {
  204. $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP);
  205. } elseif ($date instanceof Zend_Date) {
  206. $zdate = $date;
  207. } else {
  208. require_once 'Zend/Feed/Exception.php';
  209. throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter');
  210. }
  211. $this->_data['lastBuildDate'] = $zdate;
  212. }
  213. /**
  214. * Set the feed description
  215. *
  216. * @return string|null
  217. */
  218. public function setDescription($description)
  219. {
  220. if (empty($description) || !is_string($description)) {
  221. require_once 'Zend/Feed/Exception.php';
  222. throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
  223. }
  224. $this->_data['description'] = $description;
  225. }
  226. /**
  227. * Set the feed generator entry
  228. *
  229. * @return string|null
  230. */
  231. public function setGenerator($name, $version = null, $uri = null)
  232. {
  233. if (is_array($name)) {
  234. $data = $name;
  235. if (empty($data['name']) || !is_string($data['name'])) {
  236. require_once 'Zend/Feed/Exception.php';
  237. throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string');
  238. }
  239. $generator = array('name' => $data['name']);
  240. if (isset($data['version'])) {
  241. if (empty($data['version']) || !is_string($data['version'])) {
  242. require_once 'Zend/Feed/Exception.php';
  243. throw new Zend_Feed_Exception('Invalid parameter: "version" must be a non-empty string');
  244. }
  245. $generator['version'] = $data['version'];
  246. }
  247. if (isset($data['uri'])) {
  248. if (empty($data['uri']) || !is_string($data['uri']) || !Zend_Uri::check($data['uri'])) {
  249. require_once 'Zend/Feed/Exception.php';
  250. throw new Zend_Feed_Exception('Invalid parameter: "uri" must be a non-empty string and a valid URI/IRI');
  251. }
  252. $generator['uri'] = $data['uri'];
  253. }
  254. } else {
  255. if (empty($name) || !is_string($name)) {
  256. require_once 'Zend/Feed/Exception.php';
  257. throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string');
  258. }
  259. $generator = array('name' => $name);
  260. if (isset($version)) {
  261. if (empty($version) || !is_string($version)) {
  262. require_once 'Zend/Feed/Exception.php';
  263. throw new Zend_Feed_Exception('Invalid parameter: "version" must be a non-empty string');
  264. }
  265. $generator['version'] = $version;
  266. }
  267. if (isset($uri)) {
  268. if (empty($uri) || !is_string($uri) || !Zend_Uri::check($uri)) {
  269. require_once 'Zend/Feed/Exception.php';
  270. throw new Zend_Feed_Exception('Invalid parameter: "uri" must be a non-empty string and a valid URI/IRI');
  271. }
  272. $generator['uri'] = $uri;
  273. }
  274. }
  275. $this->_data['generator'] = $generator;
  276. }
  277. /**
  278. * Set the feed ID - URI or URN (via PCRE pattern) supported
  279. *
  280. * @param string $id
  281. */
  282. public function setId($id)
  283. {
  284. if ((empty($id) || !is_string($id) || !Zend_Uri::check($id)) &&
  285. !preg_match("#^urn:[a-zA-Z0-9][a-zA-Z0-9\-]{1,31}:([a-zA-Z0-9\(\)\+\,\.\:\=\@\;\$\_\!\*\-]|%[0-9a-fA-F]{2})*#", $id)) {
  286. require_once 'Zend/Feed/Exception.php';
  287. throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string and valid URI/IRI');
  288. }
  289. $this->_data['id'] = $id;
  290. }
  291. /**
  292. * Set a feed image (URI at minimum). Parameter is a single array with the
  293. * required key 'uri'. When rendering as RSS, the required keys are 'uri',
  294. * 'title' and 'link'. RSS also specifies three optional parameters 'width',
  295. * 'height' and 'description'. Only 'uri' is required and used for Atom rendering.
  296. *
  297. * @param array $data
  298. */
  299. public function setImage(array $data)
  300. {
  301. if (empty($data['uri']) || !is_string($data['uri'])
  302. || !Zend_Uri::check($data['uri'])) {
  303. require_once 'Zend/Feed/Exception.php';
  304. throw new Zend_Feed_Exception('Invalid parameter: parameter \'uri\''
  305. . ' must be a non-empty string and valid URI/IRI');
  306. }
  307. $this->_data['image'] = $data;
  308. }
  309. /**
  310. * Set the feed language
  311. *
  312. * @return string|null
  313. */
  314. public function setLanguage($language)
  315. {
  316. if (empty($language) || !is_string($language)) {
  317. require_once 'Zend/Feed/Exception.php';
  318. throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
  319. }
  320. $this->_data['language'] = $language;
  321. }
  322. /**
  323. * Set a link to the HTML source
  324. *
  325. * @param string $link
  326. */
  327. public function setLink($link)
  328. {
  329. if (empty($link) || !is_string($link) || !Zend_Uri::check($link)) {
  330. require_once 'Zend/Feed/Exception.php';
  331. throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string and valid URI/IRI');
  332. }
  333. $this->_data['link'] = $link;
  334. }
  335. /**
  336. * Set a link to an XML feed for any feed type/version
  337. *
  338. * @return string|null
  339. */
  340. public function setFeedLink($link, $type)
  341. {
  342. if (empty($link) || !is_string($link) || !Zend_Uri::check($link)) {
  343. require_once 'Zend/Feed/Exception.php';
  344. throw new Zend_Feed_Exception('Invalid parameter: "link"" must be a non-empty string and valid URI/IRI');
  345. }
  346. if (!in_array(strtolower($type), array('rss', 'rdf', 'atom'))) {
  347. require_once 'Zend/Feed/Exception.php';
  348. throw new Zend_Feed_Exception('Invalid parameter: "type"; You must declare the type of feed the link points to, i.e. RSS, RDF or Atom');
  349. }
  350. $this->_data['feedLinks'][strtolower($type)] = $link;
  351. }
  352. /**
  353. * Set the feed title
  354. *
  355. * @return string|null
  356. */
  357. public function setTitle($title)
  358. {
  359. if (empty($title) || !is_string($title)) {
  360. require_once 'Zend/Feed/Exception.php';
  361. throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
  362. }
  363. $this->_data['title'] = $title;
  364. }
  365. /**
  366. * Set the feed character encoding
  367. *
  368. * @param string $encoding
  369. */
  370. public function setEncoding($encoding)
  371. {
  372. if (empty($encoding) || !is_string($encoding)) {
  373. require_once 'Zend/Feed/Exception.php';
  374. throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string');
  375. }
  376. $this->_data['encoding'] = $encoding;
  377. }
  378. /**
  379. * Set the feed's base URL
  380. *
  381. * @param string $url
  382. */
  383. public function setBaseUrl($url)
  384. {
  385. if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) {
  386. require_once 'Zend/Feed/Exception.php';
  387. throw new Zend_Feed_Exception('Invalid parameter: "url" array value'
  388. . ' must be a non-empty string and valid URI/IRI');
  389. }
  390. $this->_data['baseUrl'] = $url;
  391. }
  392. /**
  393. * Add a Pubsubhubbub hub endpoint URL
  394. *
  395. * @param string $url
  396. */
  397. public function addHub($url)
  398. {
  399. if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) {
  400. require_once 'Zend/Feed/Exception.php';
  401. throw new Zend_Feed_Exception('Invalid parameter: "url" array value'
  402. . ' must be a non-empty string and valid URI/IRI');
  403. }
  404. if (!isset($this->_data['hubs'])) {
  405. $this->_data['hubs'] = array();
  406. }
  407. $this->_data['hubs'][] = $url;
  408. }
  409. /**
  410. * Add Pubsubhubbub hub endpoint URLs
  411. *
  412. * @param array $urls
  413. */
  414. public function addHubs(array $urls)
  415. {
  416. foreach ($urls as $url) {
  417. $this->addHub($url);
  418. }
  419. }
  420. /**
  421. * Add a feed category
  422. *
  423. * @param string $category
  424. */
  425. public function addCategory(array $category)
  426. {
  427. if (!isset($category['term'])) {
  428. require_once 'Zend/Feed/Exception.php';
  429. throw new Zend_Feed_Exception('Each category must be an array and '
  430. . 'contain at least a "term" element containing the machine '
  431. . ' readable category name');
  432. }
  433. if (isset($category['scheme'])) {
  434. if (empty($category['scheme'])
  435. || !is_string($category['scheme'])
  436. || !Zend_Uri::check($category['scheme'])
  437. ) {
  438. require_once 'Zend/Feed/Exception.php';
  439. throw new Zend_Feed_Exception('The Atom scheme or RSS domain of'
  440. . ' a category must be a valid URI');
  441. }
  442. }
  443. if (!isset($this->_data['categories'])) {
  444. $this->_data['categories'] = array();
  445. }
  446. $this->_data['categories'][] = $category;
  447. }
  448. /**
  449. * Set an array of feed categories
  450. *
  451. * @param array $categories
  452. */
  453. public function addCategories(array $categories)
  454. {
  455. foreach ($categories as $category) {
  456. $this->addCategory($category);
  457. }
  458. }
  459. /**
  460. * Get a single author
  461. *
  462. * @param int $index
  463. * @return string|null
  464. */
  465. public function getAuthor($index = 0)
  466. {
  467. if (isset($this->_data['authors'][$index])) {
  468. return $this->_data['authors'][$index];
  469. } else {
  470. return null;
  471. }
  472. }
  473. /**
  474. * Get an array with feed authors
  475. *
  476. * @return array
  477. */
  478. public function getAuthors()
  479. {
  480. if (!array_key_exists('authors', $this->_data)) {
  481. return null;
  482. }
  483. return $this->_data['authors'];
  484. }
  485. /**
  486. * Get the copyright entry
  487. *
  488. * @return string|null
  489. */
  490. public function getCopyright()
  491. {
  492. if (!array_key_exists('copyright', $this->_data)) {
  493. return null;
  494. }
  495. return $this->_data['copyright'];
  496. }
  497. /**
  498. * Get the feed creation date
  499. *
  500. * @return string|null
  501. */
  502. public function getDateCreated()
  503. {
  504. if (!array_key_exists('dateCreated', $this->_data)) {
  505. return null;
  506. }
  507. return $this->_data['dateCreated'];
  508. }
  509. /**
  510. * Get the feed modification date
  511. *
  512. * @return string|null
  513. */
  514. public function getDateModified()
  515. {
  516. if (!array_key_exists('dateModified', $this->_data)) {
  517. return null;
  518. }
  519. return $this->_data['dateModified'];
  520. }
  521. /**
  522. * Get the feed last-build date
  523. *
  524. * @return string|null
  525. */
  526. public function getLastBuildDate()
  527. {
  528. if (!array_key_exists('lastBuildDate', $this->_data)) {
  529. return null;
  530. }
  531. return $this->_data['lastBuildDate'];
  532. }
  533. /**
  534. * Get the feed description
  535. *
  536. * @return string|null
  537. */
  538. public function getDescription()
  539. {
  540. if (!array_key_exists('description', $this->_data)) {
  541. return null;
  542. }
  543. return $this->_data['description'];
  544. }
  545. /**
  546. * Get the feed generator entry
  547. *
  548. * @return string|null
  549. */
  550. public function getGenerator()
  551. {
  552. if (!array_key_exists('generator', $this->_data)) {
  553. return null;
  554. }
  555. return $this->_data['generator'];
  556. }
  557. /**
  558. * Get the feed ID
  559. *
  560. * @return string|null
  561. */
  562. public function getId()
  563. {
  564. if (!array_key_exists('id', $this->_data)) {
  565. return null;
  566. }
  567. return $this->_data['id'];
  568. }
  569. /**
  570. * Get the feed image URI
  571. *
  572. * @return array
  573. */
  574. public function getImage()
  575. {
  576. if (!array_key_exists('image', $this->_data)) {
  577. return null;
  578. }
  579. return $this->_data['image'];
  580. }
  581. /**
  582. * Get the feed language
  583. *
  584. * @return string|null
  585. */
  586. public function getLanguage()
  587. {
  588. if (!array_key_exists('language', $this->_data)) {
  589. return null;
  590. }
  591. return $this->_data['language'];
  592. }
  593. /**
  594. * Get a link to the HTML source
  595. *
  596. * @return string|null
  597. */
  598. public function getLink()
  599. {
  600. if (!array_key_exists('link', $this->_data)) {
  601. return null;
  602. }
  603. return $this->_data['link'];
  604. }
  605. /**
  606. * Get a link to the XML feed
  607. *
  608. * @return string|null
  609. */
  610. public function getFeedLinks()
  611. {
  612. if (!array_key_exists('feedLinks', $this->_data)) {
  613. return null;
  614. }
  615. return $this->_data['feedLinks'];
  616. }
  617. /**
  618. * Get the feed title
  619. *
  620. * @return string|null
  621. */
  622. public function getTitle()
  623. {
  624. if (!array_key_exists('title', $this->_data)) {
  625. return null;
  626. }
  627. return $this->_data['title'];
  628. }
  629. /**
  630. * Get the feed character encoding
  631. *
  632. * @return string|null
  633. */
  634. public function getEncoding()
  635. {
  636. if (!array_key_exists('encoding', $this->_data)) {
  637. return 'UTF-8';
  638. }
  639. return $this->_data['encoding'];
  640. }
  641. /**
  642. * Get the feed's base url
  643. *
  644. * @return string|null
  645. */
  646. public function getBaseUrl()
  647. {
  648. if (!array_key_exists('baseUrl', $this->_data)) {
  649. return null;
  650. }
  651. return $this->_data['baseUrl'];
  652. }
  653. /**
  654. * Get the URLs used as Pubsubhubbub hubs endpoints
  655. *
  656. * @return string|null
  657. */
  658. public function getHubs()
  659. {
  660. if (!array_key_exists('hubs', $this->_data)) {
  661. return null;
  662. }
  663. return $this->_data['hubs'];
  664. }
  665. /**
  666. * Get the feed categories
  667. *
  668. * @return string|null
  669. */
  670. public function getCategories()
  671. {
  672. if (!array_key_exists('categories', $this->_data)) {
  673. return null;
  674. }
  675. return $this->_data['categories'];
  676. }
  677. /**
  678. * Resets the instance and deletes all data
  679. *
  680. * @return void
  681. */
  682. public function reset()
  683. {
  684. $this->_data = array();
  685. }
  686. /**
  687. * Set the current feed type being exported to "rss" or "atom". This allows
  688. * other objects to gracefully choose whether to execute or not, depending
  689. * on their appropriateness for the current type, e.g. renderers.
  690. *
  691. * @param string $type
  692. */
  693. public function setType($type)
  694. {
  695. $this->_type = $type;
  696. }
  697. /**
  698. * Retrieve the current or last feed type exported.
  699. *
  700. * @return string Value will be "rss" or "atom"
  701. */
  702. public function getType()
  703. {
  704. return $this->_type;
  705. }
  706. /**
  707. * Unset a specific data point
  708. *
  709. * @param string $name
  710. */
  711. public function remove($name)
  712. {
  713. if (isset($this->_data[$name])) {
  714. unset($this->_data[$name]);
  715. }
  716. }
  717. /**
  718. * Method overloading: call given method on first extension implementing it
  719. *
  720. * @param string $method
  721. * @param array $args
  722. * @return mixed
  723. * @throws Zend_Feed_Exception if no extensions implements the method
  724. */
  725. public function __call($method, $args)
  726. {
  727. foreach ($this->_extensions as $extension) {
  728. try {
  729. return call_user_func_array(array($extension, $method), $args);
  730. } catch (Zend_Feed_Writer_Exception_InvalidMethodException $e) {
  731. }
  732. }
  733. require_once 'Zend/Feed/Exception.php';
  734. throw new Zend_Feed_Exception('Method: ' . $method
  735. . ' does not exist and could not be located on a registered Extension');
  736. }
  737. /**
  738. * Load extensions from Zend_Feed_Writer
  739. *
  740. * @return void
  741. */
  742. protected function _loadExtensions()
  743. {
  744. $all = Zend_Feed_Writer::getExtensions();
  745. $exts = $all['feed'];
  746. foreach ($exts as $ext) {
  747. $className = Zend_Feed_Writer::getPluginLoader()->getClassName($ext);
  748. $this->_extensions[$ext] = new $className();
  749. $this->_extensions[$ext]->setEncoding($this->getEncoding());
  750. }
  751. }
  752. }