converted most TODOa to issues
This commit is contained in:
parent
1424ec981c
commit
769b9b4ccd
@ -5,7 +5,6 @@ session_start();
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
if (empty($_GET['code'])) { //Auth token received by pnut
|
||||
// TODO: Handle auth errors
|
||||
die("Error authenticating, did not receive a code");
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@ function formatDates() {
|
||||
|
||||
function getPostTexts() {
|
||||
let boxes = document.querySelectorAll('.post-box');
|
||||
// TODO: Implement multiple fetches with one call
|
||||
boxes.forEach(function(el) {
|
||||
let id = el.querySelector('.post-meta-box').querySelector('span').innerText.replace('#','');
|
||||
get('get_posttext.php?id='+id).then(function(response) {
|
||||
@ -50,7 +49,6 @@ function getPostTexts() {
|
||||
|
||||
function getUserDetails() {
|
||||
let boxes = document.querySelectorAll('.user-box');
|
||||
// TODO: Implement multiple fetches with one call
|
||||
boxes.forEach(function(el) {
|
||||
let userBox = el.querySelector('.username');
|
||||
if (userBox == null) {
|
||||
|
@ -13,7 +13,6 @@ class BaseDB
|
||||
protected static int $ERR_CONNECTION_LIMIT = 1062;
|
||||
protected static int $ERR_TIMEOUT = 2002;
|
||||
|
||||
//TODO: Implement a better system
|
||||
public static int $SUCCESS = 0;
|
||||
public static int $SKIPPED_DUPLICATE = 1;
|
||||
public static int $TRIED_INSERT_DUPLICATE = 2;
|
||||
|
@ -30,9 +30,6 @@ class Roastmonday extends APnutI
|
||||
if (!is_dir($this->pics_root . $this->temp_pics_root)) {
|
||||
mkdir($this->pics_root . $this->temp_pics_root);
|
||||
}
|
||||
// TODO: Clean up logger everywhere to use context
|
||||
// TODO: move to logrotate
|
||||
// TODO: Convert TODOs to issues
|
||||
$this->logger->info('Pics root ', ['path' => $this->pics_root]);
|
||||
$this->logger->info('Pics root realpath', ['path' => realpath($this->pics_root)]);
|
||||
$this->logger->info('Temp pics root', ['path' => $this->pics_root . $this->temp_pics_root]);
|
||||
@ -40,7 +37,7 @@ class Roastmonday extends APnutI
|
||||
|
||||
$db_logger = null;
|
||||
if ($this->logger instanceof \Monolog\Logger) {
|
||||
$db_logger = ($this->logger)->withName('database');
|
||||
$db_logger = ($this->logger)->withName('RM_Database');
|
||||
$this->logger->info("Setting up DB Logger");
|
||||
} else {
|
||||
$this->logger->info("Logger is not a Monolog logger, can not clone for DB Logger");
|
||||
@ -54,7 +51,6 @@ class Roastmonday extends APnutI
|
||||
);
|
||||
}
|
||||
|
||||
// TODO: Support more extensions
|
||||
protected function getExtension($ct)
|
||||
{
|
||||
$ext = 'jpg';
|
||||
@ -124,7 +120,6 @@ class Roastmonday extends APnutI
|
||||
$this->logger->error('Error connecting to pnut wiki');
|
||||
return [];
|
||||
}
|
||||
// TODO: Use \Dom\HTMLDocument
|
||||
$doc = new \DOMDocument();
|
||||
$doc->loadHTML($html);
|
||||
if ($doc === false) {
|
||||
@ -513,7 +508,6 @@ class Roastmonday extends APnutI
|
||||
$this->logger->info('Posting about theme avatar');
|
||||
$post = null;
|
||||
try {
|
||||
// TODO: Add photo as attachment to post as well
|
||||
$post = $this->createPost($posttext, is_nsfw: false, auto_crop: true);
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->error($e->getMessage());
|
||||
@ -585,7 +579,6 @@ class Roastmonday extends APnutI
|
||||
$target_file_name = $theme . '/' . $target_file_name_without_theme;
|
||||
$target_file = $this->pics_root . $target_file_name;
|
||||
if (move_uploaded_file($avatar["tmp_name"], $target_file)) {
|
||||
// TODO: Remove hardcoded path
|
||||
$resp['img'] = 'pics/' . $target_file_name;
|
||||
} else {
|
||||
$this->logger->error("Error saving uploaded avatar from post #{$post_id}. Post has no creator.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user