Commit Graph

37 Commits

Author SHA1 Message Date
Andrew Dolgov d373b7b452
* bring back cache-busting for feed icons based on timestamp
* DiskCache: use singleton pattern to create less cache object instances
 * DiskCache: implement ETag
2022-12-19 21:36:50 +03:00
Andrew Dolgov 3180b35807
deprecate DiskCache->touch() 2022-11-24 08:16:56 +03:00
wn_ 3487c922b3 Replace use of 'array_merge' with the spread operator and 'array_push' in various places.
This isn't supported for arrays with string keys until PHP 8.1.

https://wiki.php.net/rfc/spread_operator_for_array
2022-08-12 17:58:38 +00:00
Philip Klempin a769ccc51c Fix starred images not being deleted 2022-01-16 22:44:46 +00:00
Andrew Dolgov 1ea177491f * base plugin class: correct description of hook_house_keeping()
* cache_starred_images: keep status files in a separate cache directory
2021-11-18 19:54:42 +03:00
Andrew Dolgov 91c9a73532 deal with phpstan warnings in plugins/cache_starred_images.php 2021-11-14 20:59:49 +03:00
Andrew Dolgov 0a2dcacbcf normalize some mismatching hook function definitions to match base Plugin class 2021-11-14 11:11:49 +03:00
Andrew Dolgov 20a844085f hide version for bundled plugins because it's meaningless; for everything else support showing version using git (if about[0] is null) 2021-03-01 12:11:42 +03:00
Andrew Dolgov 211f699aa0 migrate the rest into Config:: 2021-02-22 22:35:27 +03:00
Andrew Dolgov b888bc2091 cache_starred_images: don't try to use undefined array index 2021-02-17 21:54:43 +03:00
Andrew Dolgov 6ecee2abbd cache_starred_images: minor fixes 2021-02-17 16:17:05 +03:00
Andrew Dolgov 166f2d4666 diskcache: unify naming 2021-02-15 16:11:30 +03:00
Andrew Dolgov 7874f6ac58 remove PHPMD.UnusedFormalParameter 2021-02-08 19:42:10 +03:00
Andrew Dolgov 38a7a1da88 hide uninteresting errors in several DOMDocument->loadHTML() invocations 2020-10-01 13:20:07 +03:00
Andrew Dolgov 74568df4ff remove a lot of stuff from global context (functions.php), add a few helper classes instead 2020-09-22 09:04:33 +03:00
Andrew Dolgov c34726b2b2 consistency: use DiskCache->exists() to check for present files 2019-08-14 12:52:41 +03:00
Andrew Dolgov 6914ad1f74 retire MIN_CACHE_FILE_SIZE 2019-08-14 12:44:50 +03:00
Andrew Dolgov 3c075bfd21 DiskCache: more strict checking for input filenames, getUrl() is no longer static 2019-08-14 09:49:18 +03:00
Andrew Dolgov fdb6066bf6 * HOOK_ENCLOSURE_ENTRY: pass article_id to handler
* DiskCache: multiple fixes; support isWritable() for cache entries, set content-disposition for send()
* public/cached_url: allow selecting files from sub-caches other than images
* plugins/Cache_Starred_Images: rework to use DiskCache, can be enabled per-user, properly handles article enclosures, etc
2019-08-13 16:40:21 +03:00
Andrew Dolgov 088fcf8131 move more globals to more appropriate places
set libxml to always use internal errors
2019-06-20 08:40:02 +03:00
Andrew Dolgov 671f4cee65 domdocument: remove old meta charset unicode hacks, replace with shorter xml preamble utf8 hack (on loadhtml where it makes sense)
af_readability: better (?) charset hack for non-unicode pages
2019-03-21 21:08:02 +03:00
Andrew Dolgov c10a43069e debug logging system rework:
* support various logging levels per-message
 * remove hacks like debug_suppress, DAEMON_EXTENDED_DEBUG, etc
 * _debug() is kept as a compatibility shim for plugins
2018-11-30 08:34:29 +03:00
Andrew Dolgov 758752684c cache_starred_articles: limit maximum amount of download attempts per-article, consider cache operation a success even if all images were too small (prevents repeated requests) 2018-11-30 07:20:13 +03:00
Andrew Dolgov b14f6d58b4 implement hard limits on downloaded data size for general fetching and cache plugins: MAX_DOWNLOAD_FILE_SIZE & MAX_CACHE_FILE_SIZE 2018-05-20 11:08:33 +03:00
Andrew Dolgov 96930889dd plugins/cache_starred_images: use PDO 2017-12-03 11:03:09 +03:00
Andrew Dolgov 8b73bd28d8 remove apache-specific x-sendfile stuff
implement a hook (HOOK_SEND_LOCAL_FILE) which plugins may use to send files
via httpd-specific implementation to increase performance typically on larger files
2017-10-08 17:14:56 +03:00
Andrew Dolgov 6fd0399694 tunables:
* add CACHE_MAX_DAYS as a tunable generic expiry interval for various cached files
* add some comments to tunables in functions.php
* rename _MIN_CACHE_FILE_SIZE to MIN_CACHE_FILE_SIZE
* respect MIN_CACHE_FILE_SIZE setting in a few more places where content is cached
2017-05-29 23:14:42 +03:00
Andrew Dolgov 21ce7d9ec0 update phpmd ruleset to use (subset) of cleancode
fix various minor issues reported by static analysis
remove redundant php closing tag from several more files
2017-04-26 20:57:36 +03:00
Andrew Dolgov 5edd605ae1 image cache: do not try to cache data: schema urls; add caching of html5 video content (similar to cache_starred_images plugin) 2017-02-04 11:50:01 +03:00
Andrew Dolgov c203486e04 cache_starred_images: set filename when sending cached image 2016-01-06 21:00:53 +03:00
Andrew Dolgov 88bf000f8d cache_starred_images: also handle html5 mp4 video files 2015-07-07 13:07:58 +03:00
Andrew Dolgov 95ebe737bd cache_starred_images: route images to public.php 2015-02-25 21:16:14 +03:00
Andrew Dolgov 849c66b783 remove ob_clean/flush shit as unneeded hacks from cached image output routines 2014-08-21 13:20:23 +04:00
Andrew Dolgov ae3851b1b5 discard gzipped buffer in cache starred image sender method 2013-10-05 20:28:26 +04:00
Andrew Dolgov f5967cf825 cache starred: only try to chmod cache directory if it is not writable 2013-09-06 09:21:17 +04:00
Andrew Dolgov 4e5ddeafa6 make cache starred plugin use hook_house_keeping 2013-08-02 14:12:56 +04:00
Andrew Dolgov 910592b49a add plugin to cache images in starred articles; pass article_id to
sanitize
2013-08-02 14:04:14 +04:00