[NodeInfo] New endpoint and formula for computing active users

Seriously improved documentation
Now NodeInfo 2.0 is available at /api/nodeinfo/2.0.json
For active users we now also consider favourites and recently created accounts
Some further minor bug fixes and full review of the implementation
This commit is contained in:
Diogo Cordeiro
2019-08-12 04:45:25 +01:00
parent c0ac7f0ac8
commit e4bdb21a54
7 changed files with 519 additions and 179 deletions

View File

@@ -2657,7 +2657,7 @@ function common_strip_html($html, $trim=true, $save_whitespace=false)
* @param string|bool $size
* @return int the php.ini upload limit in machine-readable format
*/
function _common_size_str_to_int($size) : int
function _common_size_str_to_int($size): int
{
// `memory_limit` can be -1 and `post_max_size` can be 0
// for unlimited. Consistency.
@@ -2692,7 +2692,7 @@ function _common_size_str_to_int($size) : int
*
* @return int
*/
function common_get_preferred_php_upload_limit() : int {
function common_get_preferred_php_upload_limit(): int {
return min(_common_size_str_to_int(ini_get('post_max_size')),
_common_size_str_to_int(ini_get('upload_max_filesize')),
_common_size_str_to_int(ini_get('memory_limit')));