2020-03-26 00:48:27 +00:00
|
|
|
<?php
|
2019-01-29 23:18:35 +00:00
|
|
|
|
|
|
|
namespace Zotlabs\Daemon;
|
|
|
|
|
|
|
|
|
|
|
|
class Cache_embeds {
|
|
|
|
|
|
|
|
static public function run($argc,$argv) {
|
|
|
|
|
2020-03-26 00:48:27 +00:00
|
|
|
if (! $argc == 2) {
|
2019-01-29 23:18:35 +00:00
|
|
|
return;
|
2020-03-26 00:48:27 +00:00
|
|
|
}
|
2019-01-29 23:18:35 +00:00
|
|
|
|
2020-03-26 00:48:27 +00:00
|
|
|
$c = q("select body, html from item where id = %d ",
|
2019-01-29 23:18:35 +00:00
|
|
|
dbesc(intval($argv[1]))
|
|
|
|
);
|
|
|
|
|
2020-03-26 00:48:27 +00:00
|
|
|
if (! $c) {
|
2019-01-29 23:18:35 +00:00
|
|
|
return;
|
2020-03-26 00:48:27 +00:00
|
|
|
}
|
2019-01-29 23:18:35 +00:00
|
|
|
|
2020-03-26 00:48:27 +00:00
|
|
|
$item = array_shift($c);
|
2019-01-29 23:18:35 +00:00
|
|
|
|
|
|
|
// bbcode conversion by default processes embeds that aren't already cached.
|
|
|
|
|
2020-03-26 00:48:27 +00:00
|
|
|
if (! strlen($item['html'])) {
|
|
|
|
$s = bbcode($item['body']);
|
|
|
|
$s = sslify($s);
|
|
|
|
}
|
2019-01-29 23:18:35 +00:00
|
|
|
}
|
|
|
|
}
|