]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/atomlib.php
WordPress 4.3
[autoinstalls/wordpress.git] / wp-includes / atomlib.php
index a5189084f450bccb557f833a71870918bb69c29f..271635fe45a8b13f7e4e67a93f8ee0bddd3d69dc 100644 (file)
@@ -1,26 +1,67 @@
 <?php
-/*
- * atomlib.php - Atom Syndication Format PHP Library
+/**
+ * Atom Syndication Format PHP Library
  *
- * Project: http://code.google.com/p/phpatomlib/
- *
- * Author: Elias Torres <elias@torrez.us>
- * Version: 0.4
+ * @package AtomLib
+ * @link http://code.google.com/p/phpatomlib/
  *
+ * @author Elias Torres <elias@torrez.us>
+ * @version 0.4
+ * @since 2.3.0
  */
 
+/**
+ * Structure that store common Atom Feed Properties
+ *
+ * @package AtomLib
+ */
 class AtomFeed {
+       /**
+        * Stores Links
+        * @var array
+        * @access public
+        */
     var $links = array();
+    /**
+     * Stores Categories
+     * @var array
+     * @access public
+     */
     var $categories = array();
-
+       /**
+        * Stores Entries
+        *
+        * @var array
+        * @access public
+        */
     var $entries = array();
 }
 
+/**
+ * Structure that store Atom Entry Properties
+ *
+ * @package AtomLib
+ */
 class AtomEntry {
+       /**
+        * Stores Links
+        * @var array
+        * @access public
+        */
     var $links = array();
+    /**
+     * Stores Categories
+     * @var array
+        * @access public
+     */
     var $categories = array();
 }
 
+/**
+ * AtomLib Atom Parser API
+ *
+ * @package AtomLib
+ */
 class AtomParser {
 
     var $NS = 'http://www.w3.org/2005/Atom';
@@ -46,7 +87,10 @@ class AtomParser {
     var $feed;
     var $current;
 
-    function AtomParser() {
+       /**
+        * PHP5 constructor.
+        */
+    function __construct() {
 
         $this->feed = new AtomFeed();
         $this->current = null;
@@ -54,6 +98,13 @@ class AtomParser {
         $this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";');
     }
 
+       /**
+        * PHP4 constructor.
+        */
+       public function AtomParser() {
+               self::__construct();
+       }
+
     function _p($msg) {
         if($this->debug) {
             print str_repeat(" ", $this->depth * $this->indent) . $msg ."\n";
@@ -89,9 +140,10 @@ class AtomParser {
             if($this->debug) $this->content .= $data;
 
             if(!xml_parse($parser, $data, feof($fp))) {
-                trigger_error(sprintf(__('XML error: %s at line %d')."\n",
-                    xml_error_string(xml_get_error_code($xml_parser)),
-                    xml_get_current_line_number($xml_parser)));
+                /* translators: 1: error message, 2: line number */
+                trigger_error(sprintf(__('XML Error: %1$s at line %2$s')."\n",
+                    xml_error_string(xml_get_error_code($parser)),
+                    xml_get_current_line_number($parser)));
                 $ret = false;
                 break;
             }
@@ -309,5 +361,3 @@ class AtomParser {
                 $string );
     }
 }
-
-?>