r111505 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111504‎ | r111505 | r111506 >
Date:23:06, 14 February 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
some fixes and killed compat code
Modified paths:
  • /trunk/extensions/EducationProgram/includes/EPOrg.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPRevision.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPRevisionPager.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/includes/EPRevisionPager.php
@@ -42,66 +42,6 @@
4343 }
4444
4545 /**
46 - * Get the OutputPage being used for this instance.
47 - * IndexPager extends ContextSource as of 1.19.
48 - *
49 - * @since 0.1
50 - *
51 - * @return OutputPage
52 - */
53 - public function getOutput() {
54 - return $this->context->getOutput();
55 - }
56 -
57 - /**
58 - * Get the Language being used for this instance.
59 - * IndexPager extends ContextSource as of 1.19.
60 - *
61 - * @since 0.1
62 - *
63 - * @return Language
64 - */
65 - public function getLanguage() {
66 - return $this->context->getLanguage();
67 - }
68 -
69 - /**
70 - * Get the User being used for this instance.
71 - * IndexPager extends ContextSource as of 1.19.
72 - *
73 - * @since 0.1
74 - *
75 - * @return User
76 - */
77 - public function getUser() {
78 - return $this->context->getUser();
79 - }
80 -
81 - /**
82 - * Get the WebRequest being used for this instance.
83 - * IndexPager extends ContextSource as of 1.19.
84 - *
85 - * @since 0.1
86 - *
87 - * @return WebRequest
88 - */
89 - public function getRequest() {
90 - return $this->context->getRequest();
91 - }
92 -
93 - /**
94 - * Get the Title being used for this instance.
95 - * IndexPager extends ContextSource as of 1.19.
96 - *
97 - * @since 0.1
98 - *
99 - * @return Title
100 - */
101 - public function getTitle() {
102 - return $this->context->getTitle();
103 - }
104 -
105 - /**
10646 * @see parent::getStartBody
10747 * @since 0.1
10848 */
@@ -119,7 +59,7 @@
12060 * @return String
12161 */
12262 function formatRow( $row ) {
123 - $revision = EPRevision::newFromDBResult( $row );
 63+ $revision = EPRevisions::singleton()->newFromDBResult( $row );
12464 $object = $revision->getObject();
12565
12666 $html = '';
@@ -179,9 +119,9 @@
180120 */
181121 function getQueryInfo() {
182122 return array(
183 - 'tables' => EPRevision::getDBTable(),
184 - 'fields' => EPRevision::getPrefixedFields( EPRevision::getFieldNames() ),
185 - 'conds' => EPRevision::getPrefixedValues( $this->conds )
 123+ 'tables' => EPRevisions::singleton()->getDBTable(),
 124+ 'fields' => EPRevisions::singleton()->getPrefixedFields( EPRevisions::singleton()->getFieldNames() ),
 125+ 'conds' => EPRevisions::singleton()->getPrefixedValues( $this->conds )
186126 );
187127 }
188128
@@ -198,8 +138,7 @@
199139 * @return string|Array
200140 */
201141 function getIndexField() {
202 - return EPRevision::getPrefixedField( 'id' );
 142+ return EPRevisions::singleton()->getPrefixedField( 'id' );
203143 }
204144
205 -
206145 }
Index: trunk/extensions/EducationProgram/includes/EPOrg.php
@@ -129,7 +129,7 @@
130130 'form',
131131 array(
132132 'method' => 'post',
133 - 'action' => self::getTitleFor( 'NAME_PLACEHOLDER' )->getLocalURL( array( 'action' => 'edit' ) ),
 133+ 'action' => EPOrgs::singleton()->getTitleFor( 'NAME_PLACEHOLDER' )->getLocalURL( array( 'action' => 'edit' ) ),
134134 )
135135 ) );
136136
Index: trunk/extensions/EducationProgram/includes/EPRevision.php
@@ -21,7 +21,6 @@
2222 */
2323 protected $user = false;
2424
25 -
2625 /**
2726 * @see parent::__construct
2827 *
@@ -75,8 +74,8 @@
7675 * @return EPRevisionedObject
7776 */
7877 public function getObject() {
79 - $class = $this->getField( 'type' );
80 - return $class::newFromArray( $this->getField( 'data' ), true );
 78+ $class = $this->getField( 'type' ) . 's'; // TODO: refactor made this suck a lot
 79+ return $class::singleton()->newFromArray( $this->getField( 'data' ), true );
8180 }
8281
8382 /**

Status & tagging log