r101270 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101269‎ | r101270 | r101271 >
Date:15:30, 29 October 2011
Author:mkroetzsch
Status:deferred
Tags:
Comment:
removed obsolete SMW_DV_Container file and all mentionings of it
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_SetupLight.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Container.php (deleted) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Container.php
@@ -1,78 +0,0 @@
2 -<?php
3 -/**
4 - * @deprecated This file is obsolete and will soon vanish.
5 - * @file
6 - * @ingroup SMWDataValues
7 - */
8 -
9 -/**
10 - * Abstract datavalue class to implement a generic container for
11 - * complex values (internal objects) that do not have a single
12 - * value but a set of nested property-value pairs.
13 - *
14 - * @author Markus Krötzsch
15 - * @ingroup SMWDataValues
16 - */
17 -abstract class SMWContainerValue extends SMWDataValue {
18 -
19 - /**
20 - * Containers have one DB key, so the value of this function should be an array with one
21 - * element. This one DB key should consist of an array of arbitrary length where each
22 - * entry encodes one property-value pair. The pairs are encoded as arrays of size two
23 - * that correspond to the input arguments of SMWSemanticData::addPropertyStubValue():
24 - * a property DB key (string), and a value DB key array (array).
25 - */
26 - protected function parseDBkeys( $args ) {
27 - $this->m_data->clear();
28 - if ( count( $args ) > 0 ) {
29 - foreach ( reset( $args ) as $value ) {
30 - if ( is_array( $value ) && ( count( $value ) == 2 ) ) {
31 - $this->m_data->addPropertyStubValue( reset( $value ), end( $value ) );
32 - }
33 - }
34 - }
35 - }
36 -
37 - /**
38 - * Serialize data in the format described for parseDBkeys(). However, it is usually
39 - * expected that callers are aware of containers (this is the main purpose of this
40 - * abstract class) so they can use specific methods for accessing the data in a more
41 - * convenient form that contains the (probably available) information about property
42 - * and data *objects* (not just their plain strings).
43 - */
44 - public function getDBkeys() {
45 - $data = array();
46 - foreach ( $this->m_data->getProperties() as $property ) {
47 - foreach ( $this->m_data->getPropertyValues( $property ) as $dv ) {
48 - $data[] = array( $property->getDBkey(), $dv->getDBkeys() );
49 - }
50 - }
51 - return array( $data );
52 - }
53 -
54 - public function getHash() {
55 - if ( $this->isValid() ) {
56 - return $this->m_data->getHash();
57 - } else {
58 - return implode( "\t", $this->getErrors() );
59 - }
60 - }
61 -
62 - // Methods for parsing, serialisation, and display are not defined in this abstract class:
63 - // public function getShortWikiText($linked = null);
64 - // public function getShortHTMLText($linker = null);
65 - // public function getLongWikiText($linked = null);
66 - // public function getLongHTMLText($linker = null);
67 - // protected function parseUserValue($value);
68 - // public function getWikiValue();
69 -
70 - /**
71 - * Return the stored data as a SMWSemanticData object. This is more conveniently to access than
72 - * what getDBkeys() gives, but intended only for reading. It may not be safe to write to the returned
73 - * object.
74 - */
75 - public function getData() {
76 - return $this->m_data;
77 - }
78 -
79 -}
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_SetupLight.php
@@ -112,7 +112,6 @@
113113 // Datavalues
114114 $dvDir = $smwgIP . 'includes/datavalues/';
115115 $wgAutoloadClasses['SMWDataValue'] = $dvDir . 'SMW_DataValue.php';
116 - $wgAutoloadClasses['SMWContainerValue'] = $dvDir . 'SMW_DV_Container.php';
117116 // $wgAutoloadClasses['SMWRecordValue'] = $dvDir . 'SMW_DV_Record.php';
118117 $wgAutoloadClasses['SMWErrorValue'] = $dvDir . 'SMW_DV_Error.php';
119118 $wgAutoloadClasses['SMWStringValue'] = $dvDir . 'SMW_DV_String.php';
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php
@@ -2429,9 +2429,7 @@
24302430 * be limited for performance reasons,
24312431 * - w for strings as used in MediaWiki for encoding interwiki prefixes
24322432 * - n for namespace numbers (or other similar integers)
2433 - * - f for floating point numbers of double precision
2434 - * - c for the special container format used by SMWContainerValue; if used
2435 - * then the signature must be 'c' without any other fields.
 2433+ * - f for floating point numbers of double precision
24362434 * - p for a reference to an SMW ID as stored in the smw_ids table; this
24372435 * corresponds to a data entry of ID "tnwt".
24382436 *
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php
@@ -227,7 +227,6 @@
228228 // Datavalues
229229 $dvDir = $smwgIP . 'includes/datavalues/';
230230 $wgAutoloadClasses['SMWDataValue'] = $dvDir . 'SMW_DataValue.php';
231 - $wgAutoloadClasses['SMWContainerValue'] = $dvDir . 'SMW_DV_Container.php';
232231 $wgAutoloadClasses['SMWRecordValue'] = $dvDir . 'SMW_DV_Record.php';
233232 $wgAutoloadClasses['SMWErrorValue'] = $dvDir . 'SMW_DV_Error.php';
234233 $wgAutoloadClasses['SMWStringValue'] = $dvDir . 'SMW_DV_String.php';