version 2.x.x - Griffin Chapel ()
+ Added TIMEZONE as a new config setting. Please update your config.
See update.txt for more details.
+ + Added new config settings for whole page screenshot creation. Please update your config.
+ See update.txt for more details.
+ See whole-page-snapshot.txt for more details.
+ Fixed: Snapshot json result from Google.
+ New home screen layout
+ Better logging
+
version 2.8.2 - Dragon Chapel (2023-09-14)
+ Added LOGFILE and QUERY_DEBUG const to config.php. See update.txt for more details
+++ /dev/null
-Whole page screenshot of a website
-
-TBD
the version your are updating from is done.
## version 2.x.x - Griffin Chapel
-+ Add new config setting TIMEZONE to your config. See config.default.php for more details
++ Add new config setting TIMEZONE to your config. See config.default.php for more details.
++ Add new config settings for using page screenshot with browserless.io. See config.default.php for more details.
+ const COMPLETE_PAGE_SCREENSHOT_BROWSERLESS_API = "https://chrome.browserless.io/screenshot?token=";
+ const COMPLETE_PAGE_SCREENSHOT_API_KEY = 'YOUR-API-KEY';
+ const COMPLETE_PAGE_SCREEENSHOT_BROWSERLESS_TIMEOUT = 10000; # milliseconds
+ const COMPLETE_PAGE_SCREEENSHOT_BROWSERLESS_IMAGE_QUALITY = 75; # quality for jpeg
## version 2.8.2 - Dragon Chapel
+ Add query debug setting to config file.
--- /dev/null
+Whole page screenshot of a website.
+
+It uses browserless.io to generate a whole page screenshot of a link.
+There is a free account which allows ap to 1000 requests per month.
+
+# Usage
+To use this feature edit the config and set COMPLETE_PAGE_SCREENSHOT to true
+and provide your browserles.io API key to COMPLETE_PAGE_SCREENSHOT_API_KEY.
+
+# Limitations and expectations
+Every link and its target is different. The settings to generate the screenshot should work for the most of
+them. But there are a lot of things which influence the result and can return in a not-so-good screenshot.
const EMAIL_REPLY_BACK_ADDRESS = '';
const EMAIL_REPLY_BACK_SUBJECT = 'Insipid email import response';
-# Use ... to create a whole page screenshot of a given link
+# Set this to true to enable the option in the link form
+# You need the API Key from your browserless.io account
+# See whole-page-snapshot.txt for more details
const COMPLETE_PAGE_SCREENSHOT = false;
-const COMPLETE_PAGE_SCREENSHOT_COMMAND = '/absolute/path/to/command';
+const COMPLETE_PAGE_SCREENSHOT_BROWSERLESS_API = "https://chrome.browserless.io/screenshot?token=";
+const COMPLETE_PAGE_SCREENSHOT_API_KEY = 'YOUR-API-KEY';
+const COMPLETE_PAGE_SCREEENSHOT_BROWSERLESS_TIMEOUT = 10000; # milliseconds
+const COMPLETE_PAGE_SCREEENSHOT_BROWSERLESS_IMAGE_QUALITY = 75; # quality for jpeg
# Timezone setting
const TIMEZONE = 'Europe/Berlin';
if(DEBUG === true) $EmailReader->mailboxStatus();
}
catch (Exception $e) {
- Summoner::sysLog('[ERROR] Email server connection failed: '.$e->getMessage());
+ Summoner::sysLog('ERROR Email server connection failed: '.$e->getMessage());
exit();
}
$emails = $EmailReader->messageWithValidSubject(EMAIL_MARKER);
}
catch (Exception $e) {
- Summoner::sysLog('[ERROR] Can not process email messages: '.$e->getMessage());
+ Summoner::sysLog('ERROR Can not process email messages: '.$e->getMessage());
exit();
}
}
else {
$DB->rollback();
- Summoner::sysLog("[ERROR] Link could not be added. SQL problem? ".$newdata['link']);
+ Summoner::sysLog("ERROR Link could not be added. SQL problem? ".$newdata['link']);
$emailData['importmessage'] = "Link could not be added";
array_push($invalidProcessedEmails,$emailData);
}
$queryStr = "SELECT `id`,`name` FROM `".DB_PREFIX."_category`
WHERE `name` = '".$this->DB->real_escape_string($string)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$queryStr = "INSERT INTO `" . DB_PREFIX . "_category`
SET `name` = '" . $this->DB->real_escape_string($string) . "'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
$this->DB->query($queryStr);
if (!empty($this->DB->insert_id)) {
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
return $ret;
FROM `".DB_PREFIX."_category`
WHERE `id` = '".$this->DB->real_escape_string($id)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$this->_data = $result;
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
SET `linkid` = '".$this->DB->real_escape_string($linkid)."',
`categoryid` = '".$this->DB->real_escape_string($this->_id)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$this->DB->query($queryStr);
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
}
FROM `".DB_PREFIX."_categoryrelation`
WHERE `categoryid` = '".$this->DB->real_escape_string($this->_id)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
FROM `".DB_PREFIX."_category`
WHERE `id` = '".$this->DB->real_escape_string($this->_id)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$this->DB->query($queryStr);
SET `name` = '".$this->DB->real_escape_string($newValue)."'
WHERE `id` = '".$this->DB->real_escape_string($this->_id)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$this->DB->query($queryStr);
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
$this->_data['name'] = $newValue;
FROM `".DB_PREFIX."_link`
WHERE `hash` = '" . $this->DB->real_escape_string($hash) . "'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$this->_pageScreenshot();
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
FROM `".DB_PREFIX."_link`
WHERE `hash` = '" . $this->DB->real_escape_string($hash) . "'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$this->_categories();
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
`hash` = '" . $this->DB->real_escape_string($data['hash']) . "',
`search` = '" . $this->DB->real_escape_string($data['search']) . "'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$this->DB->query($queryStr);
Summoner::sysLog('ERROR Failed to create link: '.Summoner::cleanForLog($data));
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
`search` = '" . $this->DB->real_escape_string($search) . "'
WHERE `hash` = '" . $this->DB->real_escape_string($this->_data['hash']) . "'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
$this->DB->begin_transaction(MYSQLI_TRANS_START_READ_WRITE);
try {
$query = $this->DB->query($queryStr);
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
# decide to store or remove the image
if (isset($data['localImage'])) {
$image = ABSOLUTE_PATH . '/' . LOCAL_STORAGE . '/thumbnail-' . $this->_data['hash'].'.jpg';
-
- if(DEBUG) Summoner::sysLog("DEBUG Try to save local image to: $image");
-
if ($data['localImage'] === true) {
if(DEBUG) Summoner::sysLog("DEBUG want to save local image to: $image");
Summoner::downloadFile($data['image'], $image);
}
} elseif ($data['localImage'] === false) {
- if(DEBUG) Summoner::sysLog("DEBUG Image to be removed: $image");
-
+ if(DEBUG) Summoner::sysLog("DEBUG want to remove local image: $image");
if (file_exists($image)) {
+ if(DEBUG) Summoner::sysLog("DEBUG Image to be removed: $image");
unlink($image);
}
}
# decide if we want to make a local snapshot
if(isset($data['snapshot'])) {
- $snapshot = ABSOLUTE_PATH . '/' . LOCAL_STORAGE . '/snapshot-' . $this->_data['hash'].'.jpg';
+ $snapshot = ABSOLUTE_PATH . '/' . LOCAL_STORAGE . '/snapshot-' . $this->_data['hash'].'.webp';
if ($data['snapshot'] === true) {
if (!file_exists($snapshot) || $_imageUrlChanged === true) {
require_once 'lib/snapshot.class.php';
}
}
} elseif ($data['snapshot'] === false) {
+ if(DEBUG) Summoner::sysLog("DEBUG want to remove local snapshot: $snapshot");
if (file_exists($snapshot)) {
+ if(DEBUG) Summoner::sysLog("DEBUG remove local snapshot: $snapshot");
unlink($snapshot);
}
}
# decide if we want to make a local full page screenshot
if(isset($data['pagescreenshot'])) {
- $pagescreenshot = ABSOLUTE_PATH . '/' . LOCAL_STORAGE . '/pagescreenshot-' . $this->_data['hash'].'.jpg';
+ $pagescreenshot = ABSOLUTE_PATH . '/' . LOCAL_STORAGE . '/pagescreenshot-' . $this->_data['hash'].'.jpeg';
if ($data['pagescreenshot'] === true) {
if (!file_exists($pagescreenshot) || $_imageUrlChanged === true) {
require_once 'lib/snapshot.class.php';
$snap = new Snapshot();
$do = $snap->wholePageSnapshot($this->_data['link'], $pagescreenshot);
- if(!empty($do)) {
- Summoner::sysLog('ERROR Failed to create snapshot: '.Summoner::cleanForLog($data));
+ if(!$do) {
+ Summoner::sysLog('ERROR Failed to create pagescreenshot: '.Summoner::cleanForLog($data));
}
}
} elseif ($data['pagescreenshot'] === false) {
+ if(DEBUG) Summoner::sysLog("DEBUG want to remove local pagescreenshot: $pagescreenshot");
if (file_exists($pagescreenshot)) {
+ if(DEBUG) Summoner::sysLog("DEBUG remove local pagescreenshot: $pagescreenshot");
unlink($pagescreenshot);
}
}
FROM `" . DB_PREFIX . "_combined`
WHERE `hash` = '" . $this->DB->real_escape_string($this->_data['hash']) . "'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
FROM `" . DB_PREFIX . "_combined`
WHERE `hash` = '" . $this->DB->real_escape_string($this->_data['hash']) . "'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
WHERE `linkid` = '" . $this->DB->real_escape_string($this->_data['id']) . "'";
}
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
if (!empty($queryStr)) {
try {
$this->DB->query($queryStr);
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
}
WHERE `linkid` = '" . $this->DB->real_escape_string($this->_data['id']) . "'";
}
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
if (!empty($queryStr)) {
try {
$this->DB->query($queryStr);
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
}
*/
private function _snapshot(): void {
if (!empty($this->_data['hash'])) {
- $snapshot = ABSOLUTE_PATH.'/'.LOCAL_STORAGE.'/snapshot-'.$this->_data['hash'].'.jpg';
+ $snapshot = ABSOLUTE_PATH.'/'.LOCAL_STORAGE.'/snapshot-'.$this->_data['hash'].'.webp';
if (file_exists($snapshot)) {
- $this->_data['snapshotLink'] = LOCAL_STORAGE.'/snapshot-'.$this->_data['hash'].'.jpg';
+ $this->_data['snapshotLink'] = LOCAL_STORAGE.'/snapshot-'.$this->_data['hash'].'.webp';
$this->_data['snapshot'] = true;
}
}
*/
private function _pageScreenshot(): void {
if (!empty($this->_data['hash'])) {
- $pagescreenshot = ABSOLUTE_PATH.'/'.LOCAL_STORAGE.'/pagescreenshot-'.$this->_data['hash'].'.jpg';
+ $pagescreenshot = ABSOLUTE_PATH.'/'.LOCAL_STORAGE.'/pagescreenshot-'.$this->_data['hash'].'.jpeg';
if (file_exists($pagescreenshot)) {
- $this->_data['pagescreenshotLink'] = LOCAL_STORAGE.'/pagescreenshot-'.$this->_data['hash'].'.jpg';
+ $this->_data['pagescreenshotLink'] = LOCAL_STORAGE.'/pagescreenshot-'.$this->_data['hash'].'.jpeg';
$this->_data['pagescreenshot'] = true;
}
}
*/
private function _deleteSnapshot(): void {
if (!empty($this->_data['hash']) && !empty($this->_data['snapshotLink'])) {
- $snapshot = LOCAL_STORAGE.'/snapshot-'.$this->_data['hash'].'.jpg';
+ $snapshot = LOCAL_STORAGE.'/snapshot-'.$this->_data['hash'].'.webp';
if (file_exists($snapshot)) {
unlink($snapshot);
}
*/
private function _deletePageScreenshot(): void {
if (!empty($this->_data['hash']) && !empty($this->_data['pagescreenshotLink'])) {
- $pagescreenshot = LOCAL_STORAGE.'/pagescreenshot-'.$this->_data['hash'].'.jpg';
+ $pagescreenshot = LOCAL_STORAGE.'/pagescreenshot-'.$this->_data['hash'].'.jpeg';
if (file_exists($pagescreenshot)) {
unlink($pagescreenshot);
}
$queryStr .= " AND ".$this->_decideLinkTypeForQuery();
$queryStr .= " GROUP BY categoryid";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
$queryStr .= " LIMIT $limit";
}
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
$this->_categories = $ret;
$queryStr .= " AND ".$this->_decideLinkTypeForQuery();
$queryStr .= " GROUP BY tagId";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
$queryStr .= " LIMIT $limit";
}
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
$queryStr .= " LIMIT $limit";
}
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
$queryStr .= " WHERE ".$this->_decideLinkTypeForQuery();
$queryStr .= " LIMIT $offset, $limit";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$ret = $query->fetch_all(MYSQLI_ASSOC);
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
$queryStr = "SELECT `id`, `name` FROM `".DB_PREFIX."_category`";
$queryStr .= " LIMIT $offset, $limit";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$ret = $query->fetch_all(MYSQLI_ASSOC);
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
$queryStr = "SELECT `id`, `name` FROM `".DB_PREFIX."_tag`";
$queryStr .= " LIMIT $offset, $limit";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$ret = $query->fetch_all(MYSQLI_ASSOC);
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
}
}
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($querySelect.$queryFrom.$queryWhere.$queryOrder.$queryLimit));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($querySelect.$queryFrom.$queryWhere.$queryOrder.$queryLimit));
try {
$query = $this->DB->query($querySelect.$queryFrom.$queryWhere.$queryOrder.$queryLimit);
$ret['amount'] = $result['amount'];
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
}
}
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($querySelect.$queryFrom.$queryWhere.$queryOrder.$queryLimit));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($querySelect.$queryFrom.$queryWhere.$queryOrder.$queryLimit));
try {
$query = $this->DB->query($querySelect.$queryFrom.$queryWhere.$queryOrder.$queryLimit);
unset($linkObj);
}
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryFrom.$queryWhere));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryFrom.$queryWhere));
$query = $this->DB->query("SELECT COUNT(DISTINCT(t.hash)) AS amount ".$queryFrom.$queryWhere);
$result = $query->fetch_assoc();
$ret['amount'] = $result['amount'];
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
}
}
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($querySelect.$queryFrom.$queryWhere.$queryOrder.$queryLimit));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($querySelect.$queryFrom.$queryWhere.$queryOrder.$queryLimit));
try {
$query = $this->DB->query($querySelect.$queryFrom.$queryWhere.$queryOrder.$queryLimit);
unset($linkObj);
}
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryFrom.$queryWhere));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryFrom.$queryWhere));
$query = $this->DB->query("SELECT COUNT(t.hash) AS amount ".$queryFrom.$queryWhere);
$result = $query->fetch_assoc();
$ret['amount'] = $result['amount'];
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
ORDER BY t.created DESC
LIMIT 1";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$ret = $query->fetch_all(MYSQLI_ASSOC);
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
return $ret;
$queryStr .= " WHERE ".$this->_decideLinkTypeForQuery();
$queryStr .= " AND t.link = '".$this->DB->real_escape_string($url)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$ret = $query->fetch_all(MYSQLI_ASSOC);
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
$queryStr .= " AND ".$this->_decideLinkTypeForQuery();
$queryStr .= " ORDER BY score DESC";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$ret = $query->fetch_all(MYSQLI_ASSOC);
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
FROM `".DB_PREFIX."_link` AS t";
$queryStr .= " WHERE ".$this->_decideLinkTypeForQuery();
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$ret = $result['amount'];
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
$queryStr = "SELECT COUNT(*) AS amount FROM `".DB_PREFIX."_tag`";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$ret = $result['amount'];
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
$queryStr = "SELECT COUNT(*) AS amount FROM `".DB_PREFIX."_category`";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$ret = $result['amount'];
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
$queryStr = "SELECT COUNT(*) AS amount FROM `".DB_PREFIX."_link`";
$queryStr .= " WHERE `status` = 3";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$ret = $result['amount'];
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
$queryWhere = " WHERE ".$this->_decideLinkTypeForQuery();
$queryWhere .= " AND t.hash = '".$this->DB->real_escape_string($hash)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($querySelect.$queryFrom.$queryWhere));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($querySelect.$queryFrom.$queryWhere));
try {
$query = $this->DB->query($querySelect.$queryFrom.$queryWhere);
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
$queryStr = "DELETE FROM `" . DB_PREFIX . "_link`
WHERE `hash` = '" . $this->DB->real_escape_string($hash) . "'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$ret = true;
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
}
SET `search` = '".$this->DB->real_escape_string($searchStr)."'
WHERE `hash` = '".$this->DB->real_escape_string($link['hash'])."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$this->DB->query($queryStr);
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
unset($LinkObj,$l,$searchStr,$_t,$queryStr);
ORDER BY `linkid`, rel ASC";
}
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
// now count the unique digit strings
WHERE `id` = '".$this->DB->real_escape_string($t)."'";
}
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$_t['rel'][$t] = $relinfo['name'];
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
} else {
$_t['rel'][$t] = $_existingRelInfo[$t];
FROM `" . DB_PREFIX . "_link`
WHERE `id` = '" . $this->DB->real_escape_string($id) . "'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$ret = true;
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
/**
* class Snapshot
* create from given ULR a Screenshot for storage
- * right now it uses google pagespeedonline.
+ * right now it uses google pagespeedonline for a simple snapshot
+ *
+ *
*/
class Snapshot {
/**
*/
private string $_googlePageSpeed = 'https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=';
- /**
- * @var string
- */
- private string $_wkhtmltoimageOptions = '--load-error-handling ignore --quality 80 --quiet --width 1900';
-
/**
* Snapshot constructor
*/
if(!empty($url) && is_writable(dirname($filename))) {
if(DEBUG) {
- Summoner::sysLog("[DEBUG] try to save to $filename with $this->_googlePageSpeed for $url");
+ Summoner::sysLog("DEBUG try to save to $filename with $this->_googlePageSpeed for $url");
}
$theCall = Summoner::curlCall($this->_googlePageSpeed.urlencode($url).'&screenshot=true');
if(!empty($theCall['status'])) {
$jsonData = json_decode($theCall['message'],true);
if(DEBUG) {
- Summoner::sysLog("[DEBUG] Call result data: ".Summoner::cleanForLog($jsonData));
+ Summoner::sysLog("DEBUG Call result data: ".Summoner::cleanForLog($jsonData));
}
if(!empty($jsonData) && isset($jsonData['lighthouseResult']['fullPageScreenshot']['screenshot']['data'])) {
$imageData = $jsonData['lighthouseResult']['fullPageScreenshot']['screenshot']['data'];
fclose($source);
fclose($destination);
} elseif(DEBUG) {
- Summoner::sysLog("[DEBUG] invalid json data. Path ['lighthouseResult']['fullPageScreenshot']['screenshot']['data'] not found in : ".Summoner::cleanForLog($jsonData));
+ Summoner::sysLog("DEBUG invalid json data. Path ['lighthouseResult']['fullPageScreenshot']['screenshot']['data'] not found in : ".Summoner::cleanForLog($jsonData));
}
} elseif(DEBUG) {
- Summoner::sysLog("[DEBUG] curl call failed ".Summoner::cleanForLog($theCall));
+ Summoner::sysLog("DEBUG curl call failed ".Summoner::cleanForLog($theCall));
}
+ } else {
+ Summoner::sysLog("ERROR URL $url is empty or target $filename is not writeable.");
}
return $ret;
* use configured COMPLETE_PAGE_SCREENSHOT_COMMAND to create a whole page screenshot
* of the given link and store it locally
*
- * @TODO: TBD
+ * Uses browserless.io and needs settings in config.php
*
* @param String $url URL to take the screenshot from
* @param string $filename
public function wholePageSnapshot(string $url, string $filename): bool {
$ret = false;
- require_once 'lib/shellcommand.class.php';
-
if(!empty($url) && is_writable(dirname($filename))) {
- $cmd = COMPLETE_PAGE_SCREENSHOT_COMMAND;
- $params = $this->_wkhtmltoimageOptions." ".$url." ".$filename;
- $command = new ShellCommand($cmd." ".$params);
- if ($command->execute()) {
- $ret = $command->getOutput();
- } else {
- Summoner::sysLog($command->getError());
- $ret = $command->getExitCode();
+
+ $postdata = json_encode(array(
+ 'url' => $url,
+ 'waitFor' => COMPLETE_PAGE_SCREEENSHOT_BROWSERLESS_TIMEOUT,
+ 'options' => array(
+ 'fullPage' => true,
+ 'type' => "jpeg",
+ 'quality' => COMPLETE_PAGE_SCREEENSHOT_BROWSERLESS_IMAGE_QUALITY
+ )
+ ));
+
+ if(DEBUG) Summoner::sysLog("DEBUG browserless json data ".Summoner::cleanForLog($postdata));
+
+ $fh = fopen($filename, 'w+');
+
+ $api_url = COMPLETE_PAGE_SCREENSHOT_BROWSERLESS_API.COMPLETE_PAGE_SCREENSHOT_BROWSERLESS_API_KEY;
+ $ch = curl_init($api_url);
+ curl_setopt($ch, CURLOPT_FILE, $fh);
+ //curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_POST, 1);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Cache-Control: no-cache'));
+
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
+ curl_setopt($ch, CURLOPT_TIMEOUT, 30);
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+ curl_setopt($ch, CURLOPT_MAXREDIRS, 2);
+
+ // DEBUG ONLY
+ //$curl_log = fopen(ABSOLUTE_PATH."/curl.log", 'w');
+ //curl_setopt($ch, CURLOPT_VERBOSE, true);
+ //curl_setopt($ch, CURLOPT_STDERR, $curl_log);
+
+ if(!empty($port)) {
+ curl_setopt($ch, CURLOPT_PORT, $port);
}
+ $do = curl_exec($ch);
+ curl_close($ch);
+ fclose($fh);
+
+ if(DEBUG) Summoner::sysLog("DEBUG return ".Summoner::cleanForLog($do));
+
+ // DEBUG ONLY
+ //fclose($curl_log);
+
+ $ret = true;
+ } else {
+ Summoner::sysLog("ERROR URL $url is empty or target $filename is not writeable.");
}
return $ret;
}
}
+
*/
class Summoner {
- private const BROWSER_AGENT_STRING = 'Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0';
+ private const BROWSER_AGENT_STRING = 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0';
/**
* validate the given string with the given type. Optional check the string
return $ret;
}
-
+
/**
* try to gather meta information from given URL
*
}
}
-
return $ret;
}
$queryStr = "SELECT `id`,`name` FROM `".DB_PREFIX."_tag`
WHERE `name` = '".$this->DB->real_escape_string($string)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$queryStr = "INSERT INTO `" . DB_PREFIX . "_tag`
SET `name` = '" . $this->DB->real_escape_string($string) . "'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
$this->DB->query($queryStr);
if (!empty($this->DB->insert_id)) {
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
return $ret;
$queryStr = "SELECT `id`,`name` FROM `".DB_PREFIX."_tag`
WHERE `id` = '".$this->DB->real_escape_string($id)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
$this->_data = $result;
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
$queryStr = "INSERT IGNORE INTO `".DB_PREFIX."_tagrelation`
SET `linkid` = '".$this->DB->real_escape_string($linkid)."',
`tagid` = '".$this->DB->real_escape_string($this->_id)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$this->DB->query($queryStr);
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
}
}
FROM `".DB_PREFIX."_tagrelation`
WHERE tagid = '".$this->DB->real_escape_string($this->_id)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$query = $this->DB->query($queryStr);
}
}
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
return $ret;
FROM `".DB_PREFIX."_tag`
WHERE `id` = '".$this->DB->real_escape_string($this->_id)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
$this->DB->query($queryStr);
$this->DB->commit();
} catch (Exception $e) {
- Summoner::sysLog('[ERROR] Failed to remove tag: '.$e->getMessage());
+ Summoner::sysLog('ERROR Failed to remove tag: '.$e->getMessage());
$this->DB->rollback();
}
SET `name` = '".$this->DB->real_escape_string($newValue)."'
WHERE `id` = '".$this->DB->real_escape_string($this->_id)."'";
- if(QUERY_DEBUG) Summoner::sysLog("[QUERY] ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
+ if(QUERY_DEBUG) Summoner::sysLog("QUERY ".__METHOD__." query: ".Summoner::cleanForLog($queryStr));
try {
$this->DB->query($queryStr);
} catch (Exception $e) {
- Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
+ Summoner::sysLog("ERROR ".__METHOD__." mysql catch: ".$e->getMessage());
}
$this->_data['name'] = $newValue;
}