r73203 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73202‎ | r73203 | r73204 >
Date:10:11, 17 September 2010
Author:daniel
Status:deferred
Tags:
Comment:
update docu
Modified paths:
  • /trunk/extensions/DataTransclusion/DBDataTransclusionSource.php (modified) (history)
  • /trunk/extensions/DataTransclusion/FlattenRecord.php (modified) (history)
  • /trunk/extensions/DataTransclusion/WebDataTransclusionSource.php (modified) (history)
  • /trunk/extensions/DataTransclusion/XPathFlattenRecord.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DataTransclusion/FlattenRecord.php
@@ -34,7 +34,8 @@
3535 * extractError() method. The path is evaluated as deswcribed for $spec['dataPath']. If an
3636 * entry is found at the given position in the response structure, the request
3737 * is assumed to have failed. For more complex detection of errors, override
38 - * extractError(). REQUIRED.
 38+ * extractError(). If not given, the request is assumed to have been successful as long as
 39+ * dataPath can be resolved to a data item.
3940 */
4041 class FlattenRecord extends RecordTransformer {
4142
Index: trunk/extensions/DataTransclusion/WebDataTransclusionSource.php
@@ -33,20 +33,13 @@
3434 * 'xml' is supported, but requires a transformer that can handle an XML DOM
3535 * as input. To support more formats, override decodeData(). Default is 'php'.
3636 * * $spec['dataPath']: "path" to the actual data in the structure returned from the
37 - * HTTP request. The response data is assumed to consit of nested arrays. Each entry
38 - * In the path navigates one step in this structure. Each entry can be either a
39 - * string (for a lookup in an associative array), and int (an index in a list), or
40 - * a "meta-key" of the form @@N, where N is an integer. A meta-key refers to the
41 - * Nth entry in an associative array: @1 would be "bar" in array( 'x' => "foo", 'y' => "bar" ).
42 - * For more complex retrieval of the record, override extractRecord(). REQUIRED.
43 - * * $spec['fieldNames']: names of all fields present in each record.
44 - * Fields not listed here will not be available on the wiki,
45 - * even if they are returned by the data source. REQUIRED.
 37+ * HTTP request. This is only used if no transformer is set. The syntax of the
 38+ * path is the one defined for the dataPath parameter for the FlattenRecord
 39+ * transformer. REQUIRED if no transformer is defined.
4640 * * $spec['errorPath']: "path" to error messages in the structure returned from the
47 - * HTTP request. The path is evaluated as deswcribed for $spec['dataPath']. If an
48 - * entry is found at the given position in the response structure, the request
49 - * is assumed to have failed. For more complex detection of errors, override
50 - * extractError(). REQUIRED.
 41+ * HTTP request. This is only used if no transformer is set. The syntax of the
 42+ * path is the one defined for the dataPath parameter for the FlattenRecord
 43+ * transformer. REQUIRED if no transformer is defined.
5144 * * $spec['httpOptions']: array of options to pass to Http::get. For details, see Http::request.
5245 * * $spec['timeout']: seconds before the request times out. If not given,
5346 * $spec['httpOptions']['timeout'] is used. If both are not givern, 5 seconds are assumed.
Index: trunk/extensions/DataTransclusion/XPathFlattenRecord.php
@@ -20,7 +20,6 @@
2121 * In addition to the options supported by the FlattenRecord class,
2222 * XPathFlattenRecord accepts some additional options, and changes the convention for others.
2323 *
24 - * * $spec['dataFormat']: must be "xml" or end with "+xml" if given. Defaults to "xml".
2524 * * $spec['dataPath']: xpath to the actual data in the structure returned from the
2625 * HTTP request. This uses standard W3C XPath syntax. REQUIRED.
2726 * * $spec['fieldPathes']: an associative array giving a XPath for each fied which points
@@ -31,10 +30,11 @@
3231 * HTTP request. If an
3332 * entry is found at the given position in the response structure, the request
3433 * is assumed to have failed. For more complex detection of errors, override
35 - * extractError(). REQUIRED.
 34+ * extractError(). If not given, the request is assumed to have been
 35+ * successful as long as dataPath can be resolved to a data item.
3636 *
37 - * For more information on options supported by DataTransclusionSource and
38 - * WebDataTransclusionSource, see the class-level documentation there.
 37+ * For more information on options supported by FlattenRecord
 38+ * see the class-level documentation there.
3939 */
4040 class XPathFlattenRecord extends FlattenRecord {
4141
Index: trunk/extensions/DataTransclusion/DBDataTransclusionSource.php
@@ -28,9 +28,6 @@
2929 * not supported reliably. REQUIRED.
3030 * * $spec['querySuffix']: additional clauses to be added after the WHERE clause.
3131 * Useful mostly to specify GROUP BY (or ORDER BY or LIMIT).
32 - * * $spec['fieldNames']: like for DataTransclusionSource; However, it's not required
33 - * for DBDataTransclusionSource: if not provided, array_keys( $spec['fieldInfo'] )
34 - * will be used.
3532 * * $spec['fieldInfo']: like for DataTransclusionSource; Some additional hints are
3633 * supported for each field:
3734 * * $spec['fieldInfo'][...]['dbfield']: the field's name in the database table,

Status & tagging log