This commit is contained in:
Mike Macgirvin 2023-07-09 12:46:34 +10:00
parent 9f0cbcd991
commit 79dc88fd67
4 changed files with 29 additions and 12 deletions

View file

@ -18,7 +18,7 @@ services:
xdebug: true
overrides:
environment:
PHP_IDE_CONFIG: "serverName=appserver"
PHP_IDE_CONFIG: serverName=appserver
XDEBUG_SESSION_START: lando
config:
php: .vscode/php.ini
@ -37,10 +37,15 @@ tooling:
xdebug-on:
service: appserver
description: Enable xdebug for Apache.
cmd: rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && docker-php-ext-enable xdebug && /etc/init.d/apache2 reload && echo "Xdebug enabled"
cmd: >-
rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini &&
docker-php-ext-enable xdebug && /etc/init.d/apache2 reload && echo "Xdebug
enabled"
user: root
xdebug-off:
service: appserver
description: Disable xdebug for Apache.
cmd: rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload && echo "Xdebug disabled"
cmd: >-
rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini &&
/etc/init.d/apache2 reload && echo "Xdebug disabled"
user: root

View file

@ -1609,7 +1609,7 @@ class Libzot
$result = [];
$commentApproval = null;
// logger('msg_arr: ' . print_r($msg_arr,true),LOGGER_ALL);
logger('msg_arr: ' . print_r($msg_arr,true),LOGGER_ALL);
// If an upstream hop used ActivityPub, set the identities to zot6 nomadic identities where applicable
// else things could easily get confused

View file

@ -363,6 +363,7 @@ function q($sql)
$args = func_get_args();
array_shift($args);
$watching = false;
if (DBA::$dba && DBA::$dba->connected) {
$stmt = vsprintf($sql, $args);
@ -370,11 +371,23 @@ function q($sql)
db_logger('dba: vsprintf error: ' .
print_r(debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 1), true), LOGGER_NORMAL, LOG_CRIT);
}
$watch = get_config('system','db_watch');
if ($watch && stripos($stmt, $watch) !== false) {
dbg(2);
$watching = true;
}
if (DBA::$dba->debug) {
db_logger('Sql: ' . $stmt, LOGGER_DEBUG, LOG_INFO);
}
return DBA::$dba->q($stmt);
$result = DBA::$dba->q($stmt);
if ($watching) {
dbg(0);
}
return $result;
}
/*

View file

@ -1846,6 +1846,7 @@ function item_store($arr, $deliver = true) {
if(($terms) && (is_array($terms))) {
foreach($terms as $t) {
dbg(2);
q("insert into term (uid,oid,otype,ttype,term,url)
values(%d,%d,%d,%d,'%s','%s') ",
intval($arr['uid']),
@ -1855,6 +1856,7 @@ function item_store($arr, $deliver = true) {
dbesc($t['term']),
dbesc($t['url'])
);
dbg(0);
}
$arr['term'] = $terms;
@ -2188,6 +2190,7 @@ function item_store_update($arr, $deliver = true) {
if(is_array($terms)) {
foreach($terms as $t) {
dbg(2);
q("insert into term (uid,oid,otype,ttype,term,url)
values(%d,%d,%d,%d,'%s','%s') ",
intval($uid),
@ -2197,6 +2200,7 @@ function item_store_update($arr, $deliver = true) {
dbesc($t['term']),
dbesc($t['url'])
);
dbg(0);
}
$arr['term'] = $terms;
}
@ -2565,7 +2569,7 @@ function tag_deliver($uid, $item_id) {
return;
}
// don't boost likes and other response activities as it is likely that
// don't boost likes and other response activities as it isdelivery_cha likely that
// few platforms will handle this in an elegant way
if (ActivityStreams::is_response_activity($item['verb'])) {
@ -2900,7 +2904,7 @@ function i_am_mentioned($channel,$item,$check_groups = false) {
*/
function start_delivery_chain($channel, $item, $item_id, bool|array $parent, $group = false, $edit = false) {
// btlogger('start_chain: ' . $channel['channel_id'] . ' item: ' . $item_id);
btlogger('start_chain: ' . $channel['channel_id'] . ' item: ' . print_r($item, true));
$moderated = perm_is_allowed($channel['channel_id'], $item['author_xchan'], 'moderated');
$source = check_item_source($channel['channel_id'],$item);
@ -3642,11 +3646,6 @@ function delete_item_lowlevel($item, $stage = DROPITEM_NORMAL, $force = false, $
ObjCache::Delete($item['mid']);
}
q("delete from term where oid = %d and otype = %d",
intval($item['id']),
intval(TERM_OBJ_POST)
);
// remove delivery reports
$c = q("select channel_hash from channel where channel_id = %d limit 1",