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