<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[2138] 2013/frederickding/importer/trunk: Inline documentation improvements for components in #327.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://gsoc.trac.wordpress.org/changeset/2138">2138</a></dd>
<dt>Author</dt> <dd>frederick.ding</dd>
<dt>Date</dt> <dd>2013-07-23 00:17:04 +0000 (Tue, 23 Jul 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Inline documentation improvements for components in <a href="http://gsoc.trac.wordpress.org/ticket/327">#327</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#2013frederickdingimportertrunkclasswordpressimporterphp">2013/frederickding/importer/trunk/class-wordpress-importer.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#2013frederickdingimportertrunkphpdocdistxml">2013/frederickding/importer/trunk/phpdoc.dist.xml</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="2013frederickdingimportertrunkclasswordpressimporterphp"></a>
<div class="modfile"><h4>Modified: 2013/frederickding/importer/trunk/class-wordpress-importer.php (2137 => 2138)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/frederickding/importer/trunk/class-wordpress-importer.php   2013-07-23 00:16:52 UTC (rev 2137)
+++ 2013/frederickding/importer/trunk/class-wordpress-importer.php      2013-07-23 00:17:04 UTC (rev 2138)
</span><span class="lines">@@ -1,4 +1,15 @@
</span><span class="cx"> <?php
</span><ins>+/**
+ * WXR importer class
+ *
+ * Cron-based importer specifically for WordPress-generated WXR imports.
+ *
+ * Based on the WordPress Importer 
+ * (http://wordpress.org/extend/plugins/wordpress-importer/).
+ *
+ * @package WordPress
+ * @subpackage Importer
+ */
</ins><span class="cx"> 
</span><span class="cx"> class WordPress_Importer extends WP_Importer_Cron {
</span><span class="cx"> 
</span><span class="lines">@@ -23,12 +34,28 @@
</span><span class="cx">   */
</span><span class="cx">  protected $version;
</span><span class="cx"> 
</span><ins>+       /**
+        * A single error object representing the fatal problem that halted things.
+        * 
+        * @var WP_Error
+        */
</ins><span class="cx">   protected $error = null;
</span><span class="cx">  
</span><ins>+       /**
+        * An array of objects representing non-fatal problems that occurred 
+        * during import.
+        * 
+        * @var WP_Error[]
+        */
</ins><span class="cx">   protected $warnings = array();
</span><span class="cx"> 
</span><span class="cx">  protected $progress = array();
</span><span class="cx"> 
</span><ins>+       /**
+        * The name of the WXR file being processed by this instance of the importer.
+        * 
+        * @var string
+        */
</ins><span class="cx">   protected $wxr_file;
</span><span class="cx">  
</span><span class="cx">  protected $authors = array();
</span><span class="lines">@@ -42,9 +69,11 @@
</span><span class="cx">  /**
</span><span class="cx">   * Stores user-submitted choices on how to proceed with the process.
</span><span class="cx">   * 
</span><ins>+        * The first dimension of this array is 
+        * 
</ins><span class="cx">    * @var array
</span><span class="cx">   */
</span><del>-       public $params = array();
</del><ins>+        protected $params = array();
</ins><span class="cx"> 
</span><span class="cx">  /**
</span><span class="cx">   * Parses the WXR file and prepares us to process parsed data.
</span><span class="lines">@@ -361,20 +390,20 @@
</span><span class="cx">                                          'admin_user_id', 0 );
</span><span class="cx">                  }
</span><span class="cx">          }
</span><del>-
</del><ins>+                        
</ins><span class="cx">           /*
</span><del>-                * At this point, theoretically all authors should be mapped. However,
-                * emit a warning if the number of mapped authors is fewer than the
</del><ins>+                 * At this point, theoretically all authors should be mapped. However, 
+                * emit a warning if the number of mapped authors is fewer than the 
</ins><span class="cx">            * number of authors identified from the import data.
</span><span class="cx">           */
</span><span class="cx">          if ( count( $this->processed_authors ) < count( $this->authors ) ) {
</span><del>-                       $this->warnings[] = new WP_Error(
-                                       'import_process_author_mappings_warning',
-                                       __(
-                                                       'Some authors may not have been attributed correctly.',
</del><ins>+                        $this->warnings[] = new WP_Error( 
+                                       'import_process_author_mappings_warning', 
+                                       __( 
+                                                       'Some authors may not have been attributed correctly.', 
</ins><span class="cx">                                                   'wordpress-importer' ) );
</span><span class="cx">          }
</span><del>-
</del><ins>+                
</ins><span class="cx">           $this->advance();
</span><span class="cx">          return true;
</span><span class="cx">  }
</span><span class="lines">@@ -452,10 +481,12 @@
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  /**
</span><del>-        * Decide whether or not the importer should attempt to download attachment
-        * files. Default is true, can be filtered via
</del><ins>+         * Retrieves whether the importer should attempt to download attachment
+        * files.
+        * 
+        * Default is true, can be filtered via
</ins><span class="cx">    * import_allow_fetch_attachments. The choice made at the import options
</span><del>-        * screen must also be true, false here hides that checkbox.
</del><ins>+         * screen must also be true; false here hides that checkbox.
</ins><span class="cx">    * 
</span><span class="cx">   * @return bool True if downloading attachments is allowed
</span><span class="cx">   */
</span><span class="lines">@@ -464,19 +495,31 @@
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  /**
</span><del>-        * Decide what the maximum file size for downloaded attachments is. Default
-        * is 0 (unlimited), can be filtered via import_attachment_size_limit.
</del><ins>+         * Retrieves the maximum file size for downloaded attachments.
</ins><span class="cx">    * 
</span><ins>+        * Default is 0 (unlimited), can be filtered via 
+        * import_attachment_size_limit.
+        * 
</ins><span class="cx">    * @return int Maximum attachment file size to import
</span><span class="cx">   */
</span><span class="cx">  public function get_max_attachment_size() {
</span><span class="cx">          return apply_filters( 'import_attachment_size_limit', 0 );
</span><span class="cx">  }
</span><span class="cx">  
</span><ins>+       /**
+        * Retrieves the fatal error.
+        * 
+        * @return WP_Error|null
+        */
</ins><span class="cx">   public function get_error() {
</span><span class="cx">          return $this->error;
</span><span class="cx">  }
</span><span class="cx">  
</span><ins>+       /**
+        * Retrieves all non-fatal warnings.
+        * 
+        * @return WP_Error[]
+        */
</ins><span class="cx">   public function get_warnings() {
</span><span class="cx">          return $this->warnings;
</span><span class="cx">  }
</span><span class="lines">@@ -526,4 +569,16 @@
</span><span class="cx">          
</span><span class="cx">          return $default;
</span><span class="cx">  }
</span><ins>+       
+       /**
+        * Returns all params.
+        * 
+        * The first dimension of this array is the WXR filename (for example, 
+        * <code>$params['/path/to/wxr.xml']</code>).
+        * 
+        * @return array
+        */
+       public function get_all_params () {
+               return $this->params;
+       }
</ins><span class="cx"> }
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="2013frederickdingimportertrunkphpdocdistxml"></a>
<div class="addfile"><h4>Added: 2013/frederickding/importer/trunk/phpdoc.dist.xml (0 => 2138)</h4>
<pre class="diff"><span>
<span class="info">--- 2013/frederickding/importer/trunk/phpdoc.dist.xml                                (rev 0)
+++ 2013/frederickding/importer/trunk/phpdoc.dist.xml   2013-07-23 00:17:04 UTC (rev 2138)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+<?xml version="1.0" encoding="UTF-8"?>
+<phpdoc>
+       <title>WordPress Importer</title>
+       <parser>
+               <target>dist/phpdoc</target>
+               <visibility>protected</visibility>
+       </parser>
+       <transformer>
+               <target>dist/phpdoc</target>
+       </transformer>
+       <transformations>
+               <template name="new-black" />
+       </transformations>
+       <files>
+               <file>class-*.php</file>
+               <ignore>tests/*</ignore>
+       </files>
+</phpdoc>
</ins><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>

</body>
</html>