}
if (!empty($_SERVER['HTTP_ACCEPT']) && strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) {
- Logger::info('Directly serving XML for uri-id '.$item['uri-id']);
+ Logger::debug('Directly serving XML', ['uri-id' => $item['uri-id']]);
displayShowFeed($item['uri-id'], $item['uid'], false);
}
*/
if (!$preview && !empty($_REQUEST['post_id_random'])) {
if (!empty($_SESSION['post-random']) && $_SESSION['post-random'] == $_REQUEST['post_id_random']) {
- Logger::info('item post: duplicate post');
+ Logger::warning('duplicate post');
item_post_return(DI::baseUrl(), $api_source, $return_path);
} else {
$_SESSION['post-random'] = $_REQUEST['post_id_random'];
// Now check that valid personal details have been provided
if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) {
- Logger::notice('Permission denied.', ['local' => local_user(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]);
+ Logger::warning('Permission denied.', ['local' => local_user(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]);
notice(DI::l10n()->t('Permission denied.'));
if ($return_path) {
DI::baseUrl()->redirect($return_path);
}
}
- Logger::info('post_complete');
+ Logger::debug('post_complete');
if ($api_source) {
return $post_id;
$json['reload'] = $baseurl . '/' . $_REQUEST['jsreload'];
}
- Logger::info('post_json', ['json' => $json]);
+ Logger::debug('post_json', ['json' => $json]);
System::jsonExit($json);
}
item_redirect_after_action($item, $return);
} else {
- Logger::notice('Permission denied.', ['local' => local_user(), 'uid' => $item['uid'], 'cid' => $contact_id]);
+ Logger::warning('Permission denied.', ['local' => local_user(), 'uid' => $item['uid'], 'cid' => $contact_id]);
notice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('display/' . $item['guid']);
//NOTREACHED
}
if (!empty($_POST['rotate']) && (intval($_POST['rotate']) == 1 || intval($_POST['rotate']) == 2)) {
- Logger::notice('rotate');
+ Logger::debug('rotate');
$photo = Photo::getPhotoForUser($page_owner_uid, $resource_id);
$album = trim($_REQUEST['album'] ?? '');
$newalbum = trim($_REQUEST['newalbum'] ?? '');
- Logger::info('album= ' . $album . ' newalbum= ' . $newalbum);
+ Logger::debug('album= ' . $album . ' newalbum= ' . $newalbum);
if (!strlen($album)) {
if (strlen($newalbum)) {
$r = Photo::store($image, $page_owner_uid, $visitor, $resource_id, $filename, $album, 0 , Photo::DEFAULT, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
if (!$r) {
- Logger::info('image store failed');
+ Logger::warning('image store failed');
notice(DI::l10n()->t('Image upload failed.'));
return;
}
'pubmail' => $mail_pubmail
], ['uid' => local_user()]);
- Logger::notice('updating mailaccount', ['response' => $r]);
+ Logger::debug('updating mailaccount', ['response' => $r]);
$mailacct = DBA::selectFirst('mailacct', [], ['uid' => local_user()]);
if (DBA::isResult($mailacct)) {
$mb = Email::constructMailboxName($mailacct);
$item_id = ((DI::args()->getArgc() > 1) ? trim(DI::args()->getArgv()[1]) : 0);
- Logger::notice('tagger: tag ' . $term . ' item ' . $item_id);
+ Logger::info('tagger: tag ' . $term . ' item ' . $item_id);
$item = Post::selectFirst([], ['id' => $item_id]);
$contact = Contact::selectFirst([], ['self' => true, 'uid' => local_user()]);
if (!DBA::isResult($contact)) {
- Logger::notice('tagger: no contact_id');
+ Logger::warning('Self contact not found.', ['uid' => local_user()]);
return;
}
Logger::warning('Directory could not be created', ['directory' => $dirpath]);
}
} elseif ((($old_perm = fileperms($dirpath) & 0777) != $dir_perm) && !chmod($dirpath, $dir_perm)) {
- Logger::notice('Directory permissions could not be changed', ['directory' => $dirpath, 'old' => $old_perm, 'new' => $dir_perm]);
+ Logger::warning('Directory permissions could not be changed', ['directory' => $dirpath, 'old' => $old_perm, 'new' => $dir_perm]);
}
if ((($old_group = filegroup($dirpath)) != $group) && !chgrp($dirpath, $group)) {
- Logger::notice('Directory group could not be changed', ['directory' => $dirpath, 'old' => $old_group, 'new' => $group]);
+ Logger::warning('Directory group could not be changed', ['directory' => $dirpath, 'old' => $old_group, 'new' => $group]);
}
}
$old_group = filegroup($filepath);
if (($old_perm != $file_perm) && !chmod($filepath, $file_perm)) {
- Logger::notice('File permissions could not be changed', ['file' => $filepath, 'old' => $old_perm, 'new' => $file_perm]);
+ Logger::warning('File permissions could not be changed', ['file' => $filepath, 'old' => $old_perm, 'new' => $file_perm]);
}
if (($old_group != $group) && !chgrp($filepath, $group)) {
- Logger::notice('File group could not be changed', ['file' => $filepath, 'old' => $old_group, 'new' => $group]);
+ Logger::warning('File group could not be changed', ['file' => $filepath, 'old' => $old_group, 'new' => $group]);
}
DI::profiler()->stopRecording();
*/
public static function searchAndAppendToBody(string $body, bool $searchNakedUrls = false, bool $no_photos = false)
{
- Logger::info('add_page_info_to_body: fetch page info for body', ['body' => $body]);
+ Logger::debug('add_page_info_to_body: fetch page info for body', ['body' => $body]);
$url = self::getRelevantUrlFromBody($body, $searchNakedUrls);
if (!$url) {
}
}
- Logger::info('fetch page info for URL', ['url' => $url, 'data' => $data]);
+ Logger::debug('fetch page info for URL', ['url' => $url, 'data' => $data]);
return $data;
}
$c = preg_match_all('/\[img.*?\](.*?)\[\/img\]/ism', $s, $matches, PREG_SET_ORDER);
if ($c) {
foreach ($matches as $mtch) {
- Logger::info('scale_external_image', ['image' => $mtch[1]]);
+ Logger::debug('scale_external_image', ['image' => $mtch[1]]);
$hostname = str_replace('www.', '', substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3));
if (stristr($mtch[1], $hostname)) {
$Image->scaleDown(640);
$new_width = $Image->getWidth();
$new_height = $Image->getHeight();
- Logger::info('External images scaled', ['orig_width' => $orig_width, 'new_width' => $new_width, 'orig_height' => $orig_height, 'new_height' => $new_height, 'match' => $mtch[0]]);
+ Logger::debug('External images scaled', ['orig_width' => $orig_width, 'new_width' => $new_width, 'orig_height' => $orig_height, 'new_height' => $new_height, 'match' => $mtch[0]]);
$s = str_replace(
$mtch[0],
'[img=' . $new_width . 'x' . $new_height. ']' . $mtch[1] . '[/img]'
. "\n",
$s
);
- Logger::info('New string', ['image' => $s]);
+ Logger::debug('New string', ['image' => $s]);
}
}
}
if (($textlen + $img_start) > $maxlen) {
if ($textlen < $maxlen) {
- Logger::info('the limit happens before an embedded image');
+ Logger::debug('the limit happens before an embedded image');
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
$textlen = $maxlen;
}
if (($textlen + $img_end) > $maxlen) {
if ($textlen < $maxlen) {
- Logger::info('the limit happens before the end of a non-embedded image');
+ Logger::debug('the limit happens before the end of a non-embedded image');
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
$textlen = $maxlen;
}
if (($textlen + strlen($orig_body)) > $maxlen) {
if ($textlen < $maxlen) {
- Logger::info('the limit happens after the end of the last image');
+ Logger::debug('the limit happens after the end of the last image');
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
}
} else {
- Logger::info('the text size with embedded images extracted did not violate the limit');
+ Logger::debug('the text size with embedded images extracted did not violate the limit');
$new_body = $new_body . $orig_body;
}
{
$addon = Strings::sanitizeFilePathItem($addon);
- Logger::notice("Addon {addon}: {action}", ['action' => 'uninstall', 'addon' => $addon]);
+ Logger::debug("Addon {addon}: {action}", ['action' => 'uninstall', 'addon' => $addon]);
DBA::delete('addon', ['name' => $addon]);
@include_once('addon/' . $addon . '/' . $addon . '.php');
return false;
}
- Logger::notice("Addon {addon}: {action}", ['action' => 'install', 'addon' => $addon]);
+ Logger::debug("Addon {addon}: {action}", ['action' => 'install', 'addon' => $addon]);
$t = @filemtime($addon_file_path);
@include_once($addon_file_path);
if (function_exists($addon . '_install')) {
continue;
}
- Logger::notice("Addon {addon}: {action}", ['action' => 'reload', 'addon' => $addon['name']]);
+ Logger::debug("Addon {addon}: {action}", ['action' => 'reload', 'addon' => $addon['name']]);
self::uninstall($addon['name']);
self::install($addon['name']);
*
* @return boolean the directory is usable
*/
- public static function isDirectoryUsable($directory, $check_writable = true)
+ private static function isDirectoryUsable($directory, $check_writable = true)
{
if ($directory == '') {
- Logger::info('Directory is empty. This shouldn\'t happen.');
+ Logger::warning('Directory is empty. This shouldn\'t happen.');
return false;
}
if (!file_exists($directory)) {
- Logger::info('Path "' . $directory . '" does not exist for user ' . static::getUser());
+ Logger::warning('Path does not exist', ['directory' => $directory, 'user' => static::getUser()]);
return false;
}
if (is_file($directory)) {
- Logger::info('Path "' . $directory . '" is a file for user ' . static::getUser());
+ Logger::warning('Path is a file', ['directory' => $directory, 'user' => static::getUser()]);
return false;
}
if (!is_dir($directory)) {
- Logger::info('Path "' . $directory . '" is not a directory for user ' . static::getUser());
+ Logger::warning('Path is not a directory', ['directory' => $directory, 'user' => static::getUser()]);
return false;
}
if ($check_writable && !is_writable($directory)) {
- Logger::info('Path "' . $directory . '" is not writable for user ' . static::getUser());
+ Logger::warning('Path is not writable', ['directory' => $directory, 'user' => static::getUser()]);
return false;
}
{
$temppath = DI::config()->get("system", "temppath");
- if (($temppath != "") && System::isDirectoryUsable($temppath)) {
+ if (($temppath != "") && self::isDirectoryUsable($temppath)) {
// We have a temp path and it is usable
return BasePath::getRealPath($temppath);
}
$temppath = sys_get_temp_dir();
// Check if it is usable
- if (($temppath != "") && System::isDirectoryUsable($temppath)) {
+ if (($temppath != "") && self::isDirectoryUsable($temppath)) {
// Always store the real path, not the path through symlinks
$temppath = BasePath::getRealPath($temppath);
mkdir($new_temppath);
}
- if (System::isDirectoryUsable($new_temppath)) {
+ if (self::isDirectoryUsable($new_temppath)) {
// The new path is usable, we are happy
DI::config()->set("system", "temppath", $new_temppath);
return $new_temppath;
public static function getSpoolPath()
{
$spoolpath = DI::config()->get('system', 'spoolpath');
- if (($spoolpath != "") && System::isDirectoryUsable($spoolpath)) {
+ if (($spoolpath != "") && self::isDirectoryUsable($spoolpath)) {
// We have a spool path and it is usable
return $spoolpath;
}
mkdir($spoolpath);
}
- if (System::isDirectoryUsable($spoolpath)) {
+ if (self::isDirectoryUsable($spoolpath)) {
// The new path is usable, we are happy
DI::config()->set("system", "spoolpath", $spoolpath);
return $spoolpath;
foreach ($r as $entry) {
// The work will be done
if (!self::execute($entry)) {
- Logger::notice('Process execution failed, quitting.');
+ Logger::warning('Process execution failed, quitting.');
return;
}
// How long is the process already running?
$duration = (time() - strtotime($entry["executed"])) / 60;
if ($duration > $max_duration) {
- Logger::notice('Worker process took too much time - killed', ['duration' => number_format($duration, 3), 'max' => $max_duration, 'id' => $entry["id"], 'pid' => $entry["pid"], 'command' => $command]);
+ Logger::warning('Worker process took too much time - killed', ['duration' => number_format($duration, 3), 'max' => $max_duration, 'id' => $entry["id"], 'pid' => $entry["pid"], 'command' => $command]);
posix_kill($entry["pid"], SIGTERM);
// We killed the stale process.
$tables = array_merge($tables, DBA::selectToArray(
'information_schema.tables',
['table_name'],
- ['engine' => 'InnoDB', 'ROW_FORMAT' => ['COMPACT', 'REDUNDANT'], 'table_schema' => DBA::databaseName()]
+ ['engine' => 'InnoDB', 'ROW_FORMAT' => ['COMPACT', 'REDUNDANT', 'COMPRESSED'], 'table_schema' => DBA::databaseName()]
));
if (!DBA::isResult($tables)) {
}
if (!$contact_id) {
- Logger::info('Contact was not inserted', ['url' => $url, 'uid' => $uid]);
+ Logger::warning('Contact was not inserted', ['url' => $url, 'uid' => $uid]);
return 0;
}
} else {
$followings = [];
}
} else {
- Logger::notice('Contact seems to be local but could not be found here', ['url' => $url]);
+ Logger::warning('Contact seems to be local but could not be found here', ['url' => $url]);
$followers = [];
$followings = [];
}
if ($item['uid'] == $uid) {
self::markForDeletionById($item['id'], PRIORITY_HIGH);
} elseif ($item['uid'] != 0) {
- Logger::notice('Wrong ownership. Not deleting item', ['id' => $item['id']]);
+ Logger::warning('Wrong ownership. Not deleting item', ['id' => $item['id']]);
}
}
DBA::close($items);
if (!empty($item['uid'])) {
$owner = User::getOwnerDataById($item['uid'], false);
if (!$owner) {
- Logger::notice('Missing item user owner data', ['uid' => $item['uid']]);
+ Logger::warning('Missing item user owner data', ['uid' => $item['uid']]);
return false;
}
$item = Post::selectFirst(self::ITEM_FIELDLIST, ['id' => $item_id]);
if (!DBA::isResult($item)) {
- Logger::notice('like: unknown item', ['id' => $item_id]);
+ Logger::warning('Post had not been fetched', ['id' => $item_id]);
return false;
}
$activity = Activity::ANNOUNCE;
break;
default:
- Logger::notice('unknown verb', ['verb' => $verb, 'item' => $item_id]);
+ Logger::warning('unknown verb', ['verb' => $verb, 'item' => $item_id]);
return false;
}
}
if (!$convid) {
- Logger::notice('send message: conversation not found.');
+ Logger::warning('conversation not found.');
return -4;
}
}
if (!$convid) {
- Logger::notice('send message: conversation not found.');
+ Logger::warning('conversation not found.');
return -4;
}
$r = self::store($image, $user['uid'], 0, $resource_id, $filename, $album, 0, self::DEFAULT, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $desc);
if (!$r) {
- Logger::notice('Photo could not be stored');
+ Logger::warning('Photo could not be stored');
return [];
}
$r = self::store($image, $uid, 0, $resource_id, $filename, $album, 4, self::USER_AVATAR);
if (!$r) {
- logger::notice('profile image upload with scale 4 (300) failed');
+ logger::warning('profile image upload with scale 4 (300) failed');
}
if ($width > 80 || $height > 80) {
$r = self::store($image, $uid, 0, $resource_id, $filename, $album, 5, self::USER_AVATAR);
if (!$r) {
- logger::notice('profile image upload with scale 5 (80) failed');
+ logger::warning('profile image upload with scale 5 (80) failed');
}
if ($width > 48 || $height > 48) {
$r = self::store($image, $uid, 0, $resource_id, $filename, $album, 6, self::USER_AVATAR);
if (!$r) {
- logger::notice('profile image upload with scale 6 (48) failed');
+ logger::warning('profile image upload with scale 6 (48) failed');
}
logger::info('new profile image upload ended');
$r = self::store($image, $uid, 0, $resource_id, $filename, $album, 3, self::USER_BANNER);
if (!$r) {
- logger::notice('profile banner upload with scale 3 (960) failed');
+ logger::warning('profile banner upload with scale 3 (960) failed');
}
logger::info('new profile banner upload ended');
$puids = array_column($rows, 'post-user-id');
if (!DBA::update('post-user', $update_fields, ['id' => $puids])) {
DBA::rollback();
- Logger::notice('Updating post-user failed', ['fields' => $update_fields, 'condition' => $condition]);
+ Logger::warning('Updating post-user failed', ['fields' => $update_fields, 'condition' => $condition]);
return false;
}
$affected_count += DBA::affectedRows();
$uriids = array_column($rows, 'uri-id');
if (!DBA::update('post-content', $update_fields, ['uri-id' => $uriids])) {
DBA::rollback();
- Logger::notice('Updating post-content failed', ['fields' => $update_fields, 'condition' => $condition]);
+ Logger::warning('Updating post-content failed', ['fields' => $update_fields, 'condition' => $condition]);
return false;
}
$affected_count += DBA::affectedRows();
if (!DBA::update('post', $update_fields, ['uri-id' => $uriids])) {
DBA::rollback();
- Logger::notice('Updating post failed', ['fields' => $update_fields, 'condition' => $condition]);
+ Logger::warning('Updating post failed', ['fields' => $update_fields, 'condition' => $condition]);
return false;
}
$affected_count += DBA::affectedRows();
$uriids = array_column($rows, 'uri-id');
if (!DBA::update('post-delivery-data', $update_fields, ['uri-id' => $uriids])) {
DBA::rollback();
- Logger::notice('Updating post-delivery-data failed', ['fields' => $update_fields, 'condition' => $condition]);
+ Logger::warning('Updating post-delivery-data failed', ['fields' => $update_fields, 'condition' => $condition]);
return false;
}
$affected_count += DBA::affectedRows();
$uriids = array_column($rows, 'uri-id');
if (!DBA::update('post-thread', $update_fields, ['uri-id' => $uriids])) {
DBA::rollback();
- Logger::notice('Updating post-thread failed', ['fields' => $update_fields, 'condition' => $condition]);
+ Logger::warning('Updating post-thread failed', ['fields' => $update_fields, 'condition' => $condition]);
return false;
}
$affected_count += DBA::affectedRows();
$thread_puids = array_column($rows, 'post-user-id');
if (!DBA::update('post-thread-user', $update_fields, ['post-user-id' => $thread_puids])) {
DBA::rollback();
- Logger::notice('Updating post-thread-user failed', ['fields' => $update_fields, 'condition' => $condition]);
+ Logger::warning('Updating post-thread-user failed', ['fields' => $update_fields, 'condition' => $condition]);
return false;
}
$affected_count += DBA::affectedRows();
if (empty($item_id) && !empty($uri_id) && !empty($uid)) {
$item = Post::selectFirst(['id', 'parent', 'origin'], ['uri-id' => $uri_id, 'uid' => [$uid, 0]], ['order' => ['uid' => true]]);
if (empty($item['id'])) {
- Logger::notice('Item not found, removing delivery', ['uri-id' => $uri_id, 'uid' => $uid, 'cmd' => $cmd, 'inbox' => $inbox]);
+ Logger::warning('Item not found, removing delivery', ['uri-id' => $uri_id, 'uid' => $uid, 'cmd' => $cmd, 'inbox' => $inbox]);
Post\Delivery::remove($uri_id, $inbox);
return true;
} else {
$mentioned = [];
if (!$item['parent']) {
- Logger::notice('Item without parent found.', ['type' => $type, 'item' => $item]);
+ Logger::warning('Item without parent found.', ['type' => $type, 'item' => $item]);
return null;
}
// update contact
$old = Contact::selectFirst(['photo', 'url'], ['id' => $importer['id'], 'uid' => $importer['importer_uid']]);
-
if (!DBA::isResult($old)) {
- Logger::notice("Query failed to execute, no result returned in " . __FUNCTION__);
+ Logger::warning('Existing contact had not been fetched', ['id' => $importer['id']]);
return false;
}
private static function getEntryType(array $importer, array $item): int
{
if ($item['thr-parent'] != $item['uri']) {
- $community = false;
-
- if ($importer['account-type'] == User::ACCOUNT_TYPE_COMMUNITY) {
- $sql_extra = '';
- $community = true;
- Logger::notice("possible community action");
- } else {
- $sql_extra = " AND `self` AND `wall`";
- }
-
// was the top-level post for this action written by somebody on this site?
// Specifically, the recipient?
- $parent = Post::selectFirst(['wall'],
- ["`uri` = ? AND `uid` = ?" . $sql_extra, $item['thr-parent'], $importer['importer_uid']]);
-
- $is_a_remote_action = DBA::isResult($parent);
-
- if ($is_a_remote_action) {
+ if (Post::exists(['uri' => $item['thr-parent'], 'uid' => $importer['importer_uid'], 'self' => true, 'wall' => true])) {
return DFRN::REPLY_RC;
} else {
return DFRN::REPLY;
if ($xt->type == Activity\ObjectType::NOTE) {
$item_tag = Post::selectFirst(['id', 'uri-id'], ['uri' => $xt->id, 'uid' => $importer['importer_uid']]);
-
if (!DBA::isResult($item_tag)) {
- Logger::notice("Query failed to execute, no result returned in " . __FUNCTION__);
+ Logger::warning('Post had not been fetched', ['uri' => $xt->id, 'uid' => $importer['importer_uid']]);
return false;
}
}
if (!($fields = self::validPosting($msg))) {
- Logger::notice('Invalid posting');
+ Logger::warning('Invalid posting');
return false;
}
if (is_null($fields)) {
$private = true;
if (!($fields = self::validPosting($msg))) {
- Logger::notice('Invalid posting');
+ Logger::warning('Invalid posting');
return false;
}
} else {
}
}
if (!$conversation) {
- Logger::notice('Unable to create conversation.');
+ Logger::warning('Unable to create conversation.');
return false;
}
$attend_answer = 'tentative';
break;
default:
- Logger::notice('Unknown verb ' . $item['verb'] . ' in item ' . $item['guid']);
+ Logger::warning('Unknown verb ' . $item['verb'] . ' in item ' . $item['guid']);
return false;
}
$errors = imap_errors();
if (!empty($errors)) {
- Logger::notice('IMAP Errors occured', ['errors' => $errors]);
+ Logger::warning('IMAP Errors occured', ['errors' => $errors]);
}
$alerts = imap_alerts();
if (!empty($alerts)) {
- Logger::notice('IMAP Alerts occured: ', ['alerts' => $alerts]);
+ Logger::warning('IMAP Alerts occured: ', ['alerts' => $alerts]);
}
return $mbox;
if (!$search1) {
$search1 = [];
} else {
- Logger::notice("Found mails from ".$email_addr);
+ Logger::debug("Found mails from ".$email_addr);
}
$search2 = @imap_search($mbox, 'UNDELETED TO "' . $email_addr . '"', SE_UID);
if (!$search2) {
$search2 = [];
} else {
- Logger::notice("Found mails to ".$email_addr);
+ Logger::debug("Found mails to ".$email_addr);
}
$search3 = @imap_search($mbox, 'UNDELETED CC "' . $email_addr . '"', SE_UID);
if (!$search3) {
$search3 = [];
} else {
- Logger::notice("Found mails cc ".$email_addr);
+ Logger::debug("Found mails cc ".$email_addr);
}
$res = array_unique(array_merge($search1, $search2, $search3));
try {
$d = new DateTime($s, $from_obj);
} catch (Exception $e) {
- Logger::notice('DateTimeFormat::convert: exception: ' . $e->getMessage());
+ Logger::warning('DateTimeFormat::convert: exception: ' . $e->getMessage());
$d = new DateTime('now', $from_obj);
}
];
if ($count > 10) {
- Logger::notice('Endless loop detected', ['url' => $url]);
+ Logger::warning('Endless loop detected', ['url' => $url]);
return $siteinfo;
}
}
if (!function_exists('xml_parser_create')) {
- Logger::notice('Xml::toArray: parser function missing');
+ Logger::error('Xml::toArray: parser function missing');
return [];
}
$parser = @xml_parser_create();
}
- if (! $parser) {
- Logger::notice('Xml::toArray: xml_parser_create: no resource');
+ if (!$parser) {
+ Logger::warning('Xml::toArray: xml_parser_create: no resource');
return [];
}
DBA::close($itemdata);
if (empty($target_item)) {
- Logger::notice('Item ' . $target_id . "wasn't found. Quitting here.");
+ Logger::warning('Item ' . $target_id . "wasn't found. Quitting here.");
return;
}
if (empty($parent)) {
- Logger::notice('Parent ' . $parent_id . ' for item ' . $target_id . "wasn't found. Quitting here.");
+ Logger::warning('Parent ' . $parent_id . ' for item ' . $target_id . "wasn't found. Quitting here.");
self::setFailedQueue($cmd, $target_item);
return;
}
}
if (empty($items)) {
- Logger::notice('No delivery data', ['command' => $cmd, 'uri-id' => $post_uriid, 'cid' => $contact_id]);
+ Logger::warning('No delivery data', ['command' => $cmd, 'uri-id' => $post_uriid, 'cid' => $contact_id]);
}
$owner = Model\User::getOwnerDataById($uid);
Logger::notice('diaspora status: ' . $loc);
$deliver_status = Diaspora::sendStatus($target_item, $owner, $contact, $public_message);
} else {
- Logger::notice('Unknown mode ' . $cmd . ' for ' . $loc);
+ Logger::warning('Unknown mode', ['command' => $cmd, 'target' => $loc]);
return;
}
$datarray = Email::getMessage($mbox, $msg_uid, $reply, $datarray);
if (empty($datarray['body'])) {
- Logger::notice("Mail: can't fetch msg ".$msg_uid." for ".$mailconf['user']);
+ Logger::warning('Cannot fetch mail', ['msg-id' => $msg_uid, 'uid' => $mailconf['user']]);
continue;
}
Logger::notice('We are outside of the maintenance window, quitting');
return;
}
- Logger::notice('In removal', ['count' => $count, 'total' => $total]);
+ Logger::info('In removal', ['count' => $count, 'total' => $total]);
}
}
DBA::close($contacts);
DBA::delete('contact', ['id' => $contact['id']]);
if ((++$count % 1000) == 0) {
- Logger::notice('In removal', ['count' => $count, 'total' => $total]);
+ Logger::info('In removal', ['count' => $count, 'total' => $total]);
}
}
DBA::close($contacts);
// It is not named like a spool file, so we don't care.
if (substr($file, 0, 5) != "item-") {
- Logger::notice('Spool file does does not start with "item-"', ['file' => $file]);
+ Logger::info('Spool file does does not start with "item-"', ['file' => $file]);
continue;
}
// We don't care about directories either
if (filetype($fullfile) != "file") {
- Logger::notice('Spool file is no file', ['file' => $file]);
+ Logger::info('Spool file is no file', ['file' => $file]);
continue;
}
// We can't read or write the file? So we don't care about it.
if (!is_writable($fullfile) || !is_readable($fullfile)) {
- Logger::notice('Spool file has insufficent permissions', ['file' => $file, 'writable' => is_writable($fullfile), 'readable' => is_readable($fullfile)]);
+ Logger::warning('Spool file has insufficent permissions', ['file' => $file, 'writable' => is_writable($fullfile), 'readable' => is_readable($fullfile)]);
continue;
}
// Skip if it doesn't seem to be an item array
if (!isset($arr['uid']) && !isset($arr['uri']) && !isset($arr['network'])) {
- Logger::notice('Spool file does not contain the needed fields', ['file' => $file]);
+ Logger::warning('Spool file does not contain the needed fields', ['file' => $file]);
continue;
}
$result = Item::insert($arr);
- Logger::notice('Spool file is stored', ['file' => $file, 'result' => $result]);
+ Logger::info('Spool file is stored', ['file' => $file, 'result' => $result]);
unlink($fullfile);
}
closedir($dh);
$modified = $stylemodified;
}
} else {
- //TODO: use Logger::ERROR?
- Logger::notice('Error: missing file: "' . $stylecssfile .'" (userid: '. $uid .')');
+ Logger::warning('Missing CSS file', ['file' => $stylecssfile, 'uid' => $uid]);
}
}
$modified = gmdate('r', $modified);