Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit cf8659a

Browse files
committed
Updated to match new DB structure
1 parent 569bc42 commit cf8659a

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

includes/data/Structure.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ class Structure {
2525
public const WIKI_DEFUNCT = 'w8y_wi_is_defunct';
2626
public const WIKI_LAST_SR_RCRD = 'w8y_wi_last_sr_id';
2727
public const SR_ID = 'w8y_sr_sr_id';
28-
public const EXTENSION_SCRAPE_ID = 'w8y_ex_sr_id';
29-
public const SKIN_SCRAPE_ID = 'w8y_sk_sr_id';
28+
public const SCRAPE_VR_ID = 'w8y_sr_vr_id';
29+
public const EXTENSION_VERSION_ID = 'w8y_ex_vr_id';
30+
public const SKIN_VERSION_ID = 'w8y_sk_vr_id';
3031
public const SCRAPE_MEDIAWIKI_VERSION = 'w8y_sr_mw_version';
3132

3233
/**

includes/data/query/Wiki.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public function __construct() {
3434
*
3535
* @return array
3636
*/
37-
private function getExtensions( int $scrapeId, DBConnRef $dbr ): array {
37+
private function getExtensions( int $versionId, DBConnRef $dbr ): array {
3838
$select = [ '*' ];
3939
$from = Structure::DBTABLE_EXTENSIONS;
40-
$where = [ Structure::EXTENSION_SCRAPE_ID => $scrapeId ];
40+
$where = [ Structure::EXTENSION_VERSION_ID => $versionId ];
4141
$res = $dbr->newSelectQueryBuilder()->select( $select )->from( $from )->
4242
where( $where )->caller( __METHOD__ )->fetchResultSet();
4343

@@ -60,10 +60,10 @@ private function getExtensions( int $scrapeId, DBConnRef $dbr ): array {
6060
*
6161
* @return array
6262
*/
63-
private function getSkins( int $scrapeId, DBConnRef $dbr ): array {
63+
private function getSkins( int $versionId, DBConnRef $dbr ): array {
6464
$select = [ '*' ];
6565
$from = Structure::DBTABLE_SKINS;
66-
$where = [ Structure::SKIN_SCRAPE_ID => $scrapeId ];
66+
$where = [ Structure::SKIN_VERSION_ID => $versionId ];
6767
$res = $dbr->newSelectQueryBuilder()->select( $select )->from( $from )->
6868
where( $where )->caller( __METHOD__ )->fetchResultSet();
6969

@@ -135,8 +135,8 @@ public function doQuery( int $pageID, string $export = "table" ): mixed {
135135
return $result;
136136
}
137137
$result['wiki']['pageTitle'] = Utils::getPageTitleFromID( $pageID );
138-
$result['extensions'] = $this->getExtensions( $result['scrape'][Structure::SR_ID], $dbr );
139-
$result['skins'] = $this->getSkins( $result['scrape'][Structure::SR_ID], $dbr );
138+
$result['extensions'] = $this->getExtensions( $result['scrape'][Structure::SCRAPE_VR_ID], $dbr );
139+
$result['skins'] = $this->getSkins( $result['scrape'][Structure::SCRAPE_VR_ID], $dbr );
140140

141141
return match ( $export ) {
142142
"table" => Utils::renderTable( $result,

0 commit comments

Comments
 (0)