Index: branches/RL2/extensions/Gadgets/backend/LocalGadgetRepo.php |
— | — | @@ -150,17 +150,7 @@ |
151 | 151 | return Status::newGood(); |
152 | 152 | } |
153 | 153 | |
154 | | - /*** Protected methods ***/ |
155 | | - |
156 | 154 | /** |
157 | | - * Get the master DB connection. Subclasses can override this to use a different DB |
158 | | - * @return Database |
159 | | - */ |
160 | | - protected function getMasterDB() { |
161 | | - return wfGetDB( DB_MASTER ); |
162 | | - } |
163 | | - |
164 | | - /** |
165 | 155 | * Get the slave DB connection. Subclasses can override this to use a different DB |
166 | 156 | * @return Database |
167 | 157 | */ |
— | — | @@ -172,6 +162,14 @@ |
173 | 163 | /*** Protected methods ***/ |
174 | 164 | |
175 | 165 | /** |
| 166 | + * Get the master DB connection. Subclasses can override this to use a different DB |
| 167 | + * @return Database |
| 168 | + */ |
| 169 | + protected function getMasterDB() { |
| 170 | + return wfGetDB( DB_MASTER ); |
| 171 | + } |
| 172 | + |
| 173 | + /** |
176 | 174 | * Get a memcached key. Subclasses can override this to use a foreign memc |
177 | 175 | * @return string|bool Cache key, or false if this repo has no shared memc |
178 | 176 | */ |
Index: branches/RL2/extensions/Gadgets/backend/ForeignDBGadgetRepo.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | return $this->getMasterDB(); |
48 | 48 | } |
49 | 49 | |
50 | | - /*** Overridden protected functions from LocalGadgetRepo ***/ |
| 50 | + /*** Overridden protected methods from LocalGadgetRepo ***/ |
51 | 51 | protected function getMasterDB() { |
52 | 52 | if ( $this->db === null ) { |
53 | 53 | $this->db = DatabaseBase::factory( $this->dbType, |
Index: branches/RL2/extensions/Gadgets/backend/GadgetRepo.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | public function __construct( array $info = array() ) { |
13 | 13 | } |
14 | 14 | |
15 | | - /**** Abstract functions ****/ |
| 15 | + /**** Abstract methods ****/ |
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Get the name of the ResourceLoader source of the modules |
— | — | @@ -75,8 +75,20 @@ |
76 | 76 | */ |
77 | 77 | abstract public function deleteGadget( $id ); |
78 | 78 | |
79 | | - /**** Public functions ****/ |
| 79 | + /**** Public methods ****/ |
80 | 80 | |
| 81 | + public function getGadgetsByCategory() { |
| 82 | + $retval = array(); |
| 83 | + $gadgetIDs = $this->getGadgetIds(); |
| 84 | + foreach ( $gadgetIDs as $id ) { |
| 85 | + $gadget = $this->getGadget( $id ); |
| 86 | + $retval[$gadget->getCategory()][] = $gadget; |
| 87 | + } |
| 88 | + return $retval; |
| 89 | + } |
| 90 | + |
| 91 | + /*** Public static methods ***/ |
| 92 | + |
81 | 93 | /** |
82 | 94 | * Get the localized title for a given category in a given language. |
83 | 95 | * |
— | — | @@ -99,15 +111,4 @@ |
100 | 112 | } |
101 | 113 | return $msg->plain(); |
102 | 114 | } |
103 | | - |
104 | | - public function getGadgetsByCategory() { |
105 | | - $retval = array(); |
106 | | - $gadgetIDs = $this->getGadgetIds(); |
107 | | - foreach ( $gadgetIDs as $id ) { |
108 | | - $gadget = $this->getGadget( $id ); |
109 | | - $retval[$gadget->getCategory()][] = $gadget; |
110 | | - } |
111 | | - return $retval; |
112 | | - } |
113 | | - |
114 | 115 | } |