use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Util\XML;
require_once 'include/conversation.php';
-require_once 'include/html2plain.php';
require_once 'mod/share.php';
require_once 'mod/item.php';
require_once 'include/security.php';
-require_once 'include/html2bbcode.php';
require_once 'mod/wall_upload.php';
require_once 'mod/proxy.php';
/// @TODO round() really everywhere?
logger(
parse_url($a->query_string, PHP_URL_PATH) . ": " . sprintf(
- "Database: %s/%s, Network: %s, I/O: %s, Other: %s, Total: %s",
+ "Database: %s/%s, Cache %s/%s, Network: %s, I/O: %s, Other: %s, Total: %s",
round($a->performance["database"] - $a->performance["database_write"], 3),
round($a->performance["database_write"], 3),
+ round($a->performance["cache"], 3),
+ round($a->performance["cache_write"], 3),
round($a->performance["network"], 2),
round($a->performance["file"], 2),
- round($duration - ($a->performance["database"] + $a->performance["network"] + $a->performance["file"]), 2),
+ round($duration - ($a->performance["database"]
+ + $a->performance["cache"] + $a->performance["cache_write"]
+ + $a->performance["network"] + $a->performance["file"]), 2),
round($duration, 2)
),
LOGGER_DEBUG
}
}
+ $o = "Cache Read:\n";
+ foreach ($a->callstack["cache"] as $func => $time) {
+ $time = round($time, 3);
+ if ($time > 0) {
+ $o .= $func . ": " . $time . "\n";
+ }
+ }
+ $o .= "\nCache Write:\n";
+ foreach ($a->callstack["cache_write"] as $func => $time) {
+ $time = round($time, 3);
+ if ($time > 0) {
+ $o .= $func . ": " . $time . "\n";
+ }
+ }
+
$o .= "\nNetwork:\n";
foreach ($a->callstack["network"] as $func => $time) {
$time = round($time, 3);
$purifier = new HTMLPurifier($config);
$txt = $purifier->purify($txt);
}
- $txt = html2bbcode($txt);
+ $txt = HTML::toBBCode($txt);
$a->argv[1]=$user_info['screen_name']; //should be set to username?
$purifier = new HTMLPurifier($config);
$txt = $purifier->purify($txt);
- $_REQUEST['body'] = html2bbcode($txt);
+ $_REQUEST['body'] = HTML::toBBCode($txt);
}
} else {
$_REQUEST['body'] = requestdata('status');
if ($_GET['getText'] == 'html') {
$ret['text'] = BBCode::convert($item['body'], false);
} elseif ($_GET['getText'] == 'plain') {
- $ret['text'] = trim(html2plain(BBCode::convert(api_clean_plain_items($item['body']), false, 2, true), 0));
+ $ret['text'] = trim(HTML::toPlaintext(BBCode::convert(api_clean_plain_items($item['body']), false, 2, true), 0));
}
} else {
- $ret['text'] = $item['title'] . "\n" . html2plain(BBCode::convert(api_clean_plain_items($item['body']), false, 2, true), 0);
+ $ret['text'] = $item['title'] . "\n" . HTML::toPlaintext(BBCode::convert(api_clean_plain_items($item['body']), false, 2, true), 0);
}
if (x($_GET, 'getUserObjects') && $_GET['getUserObjects'] == 'false') {
unset($ret['sender']);
// Workaround for ostatus messages where the title is identically to the body
$html = BBCode::convert(api_clean_plain_items($body), false, 2, true);
- $statusbody = trim(html2plain($html, 0));
+ $statusbody = trim(HTML::toPlaintext($html, 0));
// handle data: images
$statusbody = api_format_items_embeded_images($item, $statusbody);
$result = [];
while ($term = $terms->fetch()) {
$result[] = [
- 'name' => $term['term'],
- 'query' => $term['term'],
+ 'created_at' => api_date(time()),
+ 'id' => intval($term['id']),
'id_str' => $term['id'],
- 'id' => intval($term['id'])
+ 'name' => $term['term'],
+ 'position' => null,
+ 'query' => $term['term']
];
}