Clean up duplicated code in include/plugin.php and Zotlabs\Extend\Hook,
making the former just wrappers calling the latter. Also removed the
unnecessary serialization of arrays in Hook::insert, and cleaned up and
expaned the tests a bit.
It seems AVIF support was added to the GD photo driver, but not
ImageMagick. This patch adds it to ImageMagick as well, if supported by
the underlying library.
I also added pecl imagick extension to CI so that we can test it.
Using string comparison on the whole key does not work, as some keys
will be given prefixes during expansion. We need to check if the payload
has keys that _contain_ the suspicious keywords we're looking for.
Make `Route::set()` private. It is not referenced outside of the class
itself, and is also unsafe as it uncritically replaces the system routes
with whatever value it was passed.
The remaining functions are set to public visibility.
If the query towards the hubloc table don't return any entries, the loop
would continue without modifying any of the variables that could
possibly make the loop end.
The NULL_DATE constant is defined conditionally in the DBA static class.
This causes issues with static analyzing tools like PHPStan, because
they can not really know if the constant is defined or not.
We could make PHPStan ignore this, but since there already is a
`get_null_date()` method on the `dba_driver` class, this patch
changes the code to use this method instead.
We could also use the public static attribute `$null_date` on the DBA
class directly, but using a method feels cleaner, and allows for making
the attribute private, or even removing it completely at some later
time.
I'm not removing the NULL_DATE constant for now, in case it is in use by
any extensions.
There's no reason we should format the data into a string in the
Perfstats module. Let the recipient do what they want with it instead.
As an example, we reduce the precision of the loadavg stats in the
system status widget. 3 digits precision should be more than enough for
this type of status display.
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
The total number of queries is not that interesting for performance
measurements, so let's do queries pr/second instead. Adds a timestamp
column to the dataset, which could be useful for other purposes as well
(like making a graph over time etc.)
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
Make some stricter rules for accessing the perfstats module. We only
want to respond to GET request for json data made by a site admin.
This means we also need to pass along the credentials in the request.
Didn't immediately figure out how to do that using `z_fetch_url`, so we
just fall back to using the JavaScript to populate the widget. This
makes it idle for about 5 sec before it gets the first data sample.
I think that's probably OK.
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
At least for now, there's no sensible link target, so it's better to not
link anywhere.
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund
Adds a bit of javascript that requests the performance stats every 5
seconds.
Project......: Performance Profiling
Sponsored-by.: NLnet NGI0 Commons Fund