Changeset 262 for trunk/docs

Show
Ignore:
Timestamp:
10/23/07 02:47:18 (1 year ago)
Author:
hans
Message:

Merging in changes from 2.3 branch: [256], [257], [258], [259], [260], [261]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docs/phing_guide/book/chapters/appendixes/AppendixC-OptionalTasks.html

    r239 r262  
    518518  <fileset dir="sqlfiles"> 
    519519          <include name="*.sql"/> 
    520   </fileset> 
    521 </pdo> 
     520  &lt;/fileset&gt;<br />&lt;/pdo&gt; 
    522521</pre> 
    523522 
    524523<pre>&lt;pdo url="mysql:host=localhost;dbname=test" userid="username" password="password"> 
    525524  &lt;transaction src=&quot;path/to/sqlfile.sql&quot;/&gt; 
     525  &lt;formatter type=&quot;plain&quot; outfile=&quot;path/to/output.txt&quot;/&gt; 
    526526&lt;/pdo&gt; 
    527527</pre> 
     
    579579      <td>The action to perform on error (continue, stop, or abort)</td> 
    580580      <td>abort</td> 
    581       <td>No</td> 
    582     </tr> 
    583         <tr> 
    584       <td>output</td> 
    585       <td>File</td> 
    586       <td>The file to which output should be logged.</td> 
    587       <td>none</td> 
    588       <td>No</td> 
    589     </tr> 
    590         <tr> 
    591       <td>print</td> 
    592       <td>Boolean</td> 
    593       <td>Whether to print results of query.</td> 
    594       <td>false</td> 
    595       <td>No</td> 
    596     </tr> 
    597         <tr> 
    598       <td>showheaders</td> 
    599       <td>Boolean</td> 
    600       <td>Whether to show column headers.</td> 
    601       <td>false</td> 
    602581      <td>No</td> 
    603582    </tr> 
     
    628607  <li>fileset 
    629608    <p>Files containing SQL statements.</p> 
     609  </li> 
     610  <li>formatter 
     611         <p>The results of any queries that are executed can be printed in different formats. 
     612    Output will always be sent to a file, unless you set the <em>usefile</em> attribute to <em>false</em>. 
     613    The path to the output file file can be specified by the <em>outfile</em> attribute; there is a default filename that 
     614        will be returned by the formatter if no output file is specified.</p> 
     615    <p>There are three predefined formatters - one prints the query results in XML format, 
     616    the other emits plain text. Custom formatters that 
     617    extend phing.tasks.pdo.PDOResultFormatter can be specified.</p> 
     618        <h3>Attributes</h3> 
     619        <table> 
     620          <thead> 
     621                <tr> 
     622                  <th>Name</th> 
     623                  <th>Type</th> 
     624                  <th>Description</th> 
     625                  <th>Default</th> 
     626                  <th>Required</th> 
     627                </tr> 
     628          </thead> 
     629          <tbody> 
     630                <tr> 
     631                  <td>type</td> 
     632                  <td>String</td> 
     633                  <td> Use a predefined formatter (either <em>xml</em> or <em>plain</em>). </td> 
     634                  <td>n/a</td> 
     635                  <td rowspan="2">One of these attributes is required. </td> 
     636                </tr> 
     637                <tr> 
     638                  <td>classname</td> 
     639                  <td>String</td> 
     640                  <td> Name of a custom formatter class (must extend phing.tasks.ext.pdo.PDOResultFormatter). </td> 
     641                  <td>n/a</td> 
     642                </tr> 
     643                <tr> 
     644                  <td>usefile</td> 
     645                  <td>Boolean</td> 
     646                  <td> Boolean that determines whether output should be sent to a file. </td> 
     647                  <td>true</td> 
     648                  <td>No</td> 
     649                </tr> 
     650                <tr> 
     651                  <td>outfile</td> 
     652                  <td>File</td> 
     653                  <td>Path to file in which to store result. </td> 
     654                  <td>Depends on formatter</td> 
     655                  <td>No</td> 
     656                </tr> 
     657                <tr> 
     658      <td>showheaders</td> 
     659      <td>Boolean</td> 
     660      <td>(only applies to plain formatter) Whether to show column headers.</td> 
     661      <td>false</td> 
     662      <td>No</td> 
     663    </tr> 
     664        <tr> 
     665      <td>coldelim</td> 
     666      <td>String</td> 
     667      <td>(only applies to plain formatter) The column delimiter.</td> 
     668      <td>,</td> 
     669      <td>No</td> 
     670    </tr> 
     671        <tr> 
     672      <td>rowdelim</td> 
     673      <td>String</td> 
     674      <td>(only applies to plain formatter) The row delimiter.</td> 
     675      <td>\n</td> 
     676      <td>No</td> 
     677    </tr> 
     678        <tr> 
     679      <td>encoding</td> 
     680      <td>String</td> 
     681      <td>(only applies to XML formatter) The xml document encoding.</td> 
     682      <td>(PHP default)</td> 
     683      <td>No</td> 
     684    </tr> 
     685        <tr> 
     686      <td>formatoutput</td> 
     687      <td>Boolean</td> 
     688      <td>(only applies to XML formatter) Whether to format XML output.</td> 
     689      <td>true</td> 
     690      <td>No</td> 
     691    </tr> 
     692          </tbody> 
     693        </table> 
     694        <h3>Examples</h3> 
     695        <pre>&lt;pdo url="pgsql:host=localhost dbname=test"> 
     696  &lt;fileset dir=&quot;sqlfiles&quot;&gt; 
     697          &lt;include name=&quot;*.sql&quot;/&gt; 
     698  &lt;/fileset&gt; 
     699 
     700  &lt;!-- xml formatter --&gt; 
     701  &lt;formatter type=&quot;xml&quot; output=&quot;output.xml&quot;/&gt; 
     702   
     703  &lt;!-- custom formatter --&gt; 
     704  &lt;formatter classname=&quot;path.to.CustomFormatterClass&quot;&gt; 
     705    &lt;param name=&quot;someClassAttrib&quot; value=&quot;some-value&quot;/&gt; 
     706  &lt;/formatter&gt; 
     707 
     708  &lt;!-- No output file + usefile=false means it goes to phing log --&gt; 
     709  &lt;formatter type=&quot;plain&quot; usefile=&quot;false&quot; /&gt;<br />&lt;/pdo&gt; 
     710</pre> 
     711         
    630712  </li> 
    631713</ul>