Commit c2e09c64 authored by Luke081515's avatar Luke081515

Fix codestyling

parent 1b79ece1
Pipeline #225 failed with stages
in 1 minute and 12 seconds
#!/usr/bin/php
<?php
include '../Core/BotCore.php';
include '../Core/DBCore.php';
require '../Core/BotCore.php';
require '../Core/DBCore.php';
/** ManageCategoryTable.php
* Erfasst fuer die Seiten die Kategorien
* Erlaubt eine Abfrage aller Seiten der Kategorie die gleichzeitig von einer BKL verlinkt werden
......@@ -10,10 +10,10 @@ include '../Core/DBCore.php';
* @Version 0.1
* @Status Alpha
*/
class BKLLC extends Core {
class manageCategoryTable extends Core {
protected $DB;
public function BKLLC ($account, $job, $pUseHTTPS = true) {
global $argv;
public function __construct() {
$GLOBALS['argv'];
$pwd = $argv[1];
$this->setSite('de.wikipedia.org');
$this->setUsername('Luke081515Bot');
......@@ -30,5 +30,5 @@ class BKLLC extends Core {
$this->DB = new DBCore ('root@localhost', 'BKLLC');
}
}
$Bot = new BKLLC ('Luke081515Bot@dewiki', 'bkllc');
$Bot = new manageCategoryTable ();
?>
\ No newline at end of file
#!/usr/bin/php
<?php
include '../Core/BotCore.php';
include '../Core/DBCore.php';
require '../Core/BotCore.php';
require '../Core/DBCore.php';
/** ManageLinkTable.php
* Aktualisiert
** Erfasste Seiten
......@@ -11,10 +11,10 @@ include '../Core/DBCore.php';
* @Version 0.2
* @Status Alpha
*/
class BKLLC extends Core {
class ManageLinkTable extends Core {
protected $DB;
public function BKLLC ($account, $job, $pUseHTTPS = true) {
global $argv;
public function __construct() {
$GLOBALS['argv'];
$pwd = $argv[1];
$this->setSite('de.wikipedia.org');
$this->setUsername('Luke081515Bot');
......@@ -36,21 +36,21 @@ class BKLLC extends Core {
protected function manangeDatabases () {
$sql = 'SELECT DisID FROM Disambig;';
$result = $this->DB->query($sql);
$a=0;
$a = 0;
while ($row = $result->fetch_assoc()) {
$BKLs[$a] = $row['DisID'];
$a++;
}
$Total = $a;
$result->free();
$a=0;
$a = 0;
while (isset($BKLs[$a])) {
$Page [$a] = $this->getPageLinks($BKLs[$a]);
$a++;
}
$b=0;
$b = 0;
for ($a = 0; $a < $Total; $a++) {
$b=0;
$b = 0;
while (isset($Page[$a][$b])) {
if ($Page[$a][$b] !== false) {
$sql = 'SELECT PageID FROM Page WHERE PageID = ' . $Page[$a][$b] . ';';
......@@ -64,7 +64,7 @@ class BKLLC extends Core {
}
}
for ($a = 0; $a < $Total; $a++) {
$b=0;
$b = 0;
while (isset($Page[$a][$b])) {
if ($Page[$a][$b] !== false) {
$sql = 'SELECT Disambig_DisID, Page_PageID FROM PageLinkDisambig WHERE Page_PageID = ' . $Page [$a][$b] . ' AND Disambig_DisID = ' . $BKLs[$a] . ';';
......@@ -97,12 +97,12 @@ class BKLLC extends Core {
$sql = 'DELETE FROM PageLinkDisambig WHERE Inserted = false AND LinksToDisambig = true;';
$this->DB->modify($sql);
$sql = 'UPDATE PageLinkDisambig SET Inserted = false WHERE LinksToDisambig = true;';
$this->DB->modify($sql);
## Statistik ##
$this->DB->modify($sql);
// Statistik
echo '--- STATISTIK ---';
$sql = 'SELECT * FROM PageLinkDisambig WHERE LinksToDisambig = true;';
$result = $this->DB->query ($sql);
$a=0;
$a = 0;
while ($row = $result->fetch_assoc())
$a++;
echo 'PageLinkDisambig: Total ' . $a . ' rows. (Where LinksToDisambig is true)';
......@@ -119,8 +119,8 @@ class BKLLC extends Core {
} catch (Exception $e) {
throw $e;
}
$answer = unserialize($result);
$a=0;
$answer = unserialize($result);
$a = 0;
if (isset ($answer ['query-continue']['linkshere']['lhcontinue']) === true) {
$Continue = $answer ['query-continue']['linkshere']['lhcontinue'];
} else
......@@ -133,8 +133,8 @@ class BKLLC extends Core {
} else
return false;
}
$a=0;
$b=0;
$a = 0;
$b = 0;
while (isset($Site[$a])) {
if ($this->isBKL($Site[$a]) === false) {
if ($this->checkLink($Site [$a]) === true) {
......@@ -174,5 +174,5 @@ class BKLLC extends Core {
return true;
}
}
$Bot = new BKLLC ('Luke081515Bot@dewiki', 'bkllc');
$Bot = new ManageLinkTable();
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Cygnus">
<arg name="tab-width" value="4" />
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
......@@ -5,4 +7,5 @@
<properties>
<property name="tabIndent" value="true"/>
</properties>
</rule>
\ No newline at end of file
</rule>
</ruleset>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment