[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/xml/rssparser/ -> rssenclosure.class.php (source)

   1  <?php
   2  
   3      
   4      
   5      /**
   6       * \ingroup XML
   7       *
   8       * represents an enclosure from an rss 2.0 feed. This object needs
   9       * our patched version of MagpieRSS which has support for enclosures.
  10       *
  11       * Objects of this class are returned via the RssItem::getEnclosures() method, as an
  12       * array of enclosures in case the RSS item has any.
  13       */
  14      class RssEnclosure 
  15      {
  16          var $_url;
  17          var $_mimeType;
  18          var $_length;
  19      
  20          /**
  21           * builds the object based on the results gotten from MagpieRSS
  22           *
  23           * @param enclosure an array as generated by MagpieRSS containing all the necessary
  24           * information from the enclosure
  25           */
  26  		function RssEnclosure( $enclosure )
  27          {
  28              $this->_url = $enclosure["url"];
  29              $this->_length = $enclosure["length"];
  30              $this->_mimeType = $enclosure["type"];
  31              
  32              // keep also the array, just in case...
  33              $this->_enclosure = $enclosure;
  34          }
  35          
  36          /**
  37           * returns the length in bytes of the enclosure
  38           *
  39           * @return the length in bytes
  40           */
  41  		function getLength()
  42          {
  43              return( $this->_length );
  44          }
  45          
  46          /**
  47           * alias of the above
  48           * @see getLength()
  49           */
  50  		function getSize()
  51          {
  52              return( $this->getLength());
  53          }
  54          
  55          /**
  56           * returns the mime type as specified by the enclosure
  57           *
  58           * @return mime type
  59           */
  60  		function getMimeType()
  61          {
  62              return( $this->_mimeType );
  63          }
  64          
  65          /**
  66           * returns the enclosure where the url is located
  67           *
  68           * @return a url
  69           */
  70  		function getUrl()
  71          {
  72              return( $this->_url );
  73          }
  74      }
  75  ?>


Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics