### combine some versions for ~f and D* Tobias Diekershoff 6 年前
 `@ -229,12 +229,69 @@ function admin_page_federation(&\$a) {` ` \$platforms = array('Diaspora', 'Friendica', '%%red%%', 'Hubzilla', 'GNU Social', 'StatusNet');` ` \$counts = array();` ` foreach (\$platforms as \$p) {` ``` // get a totaö count for the platform, the name and version of the ``` ``` // get a total count for the platform, the name and version of the ``` ``` // highest version and the protocol tpe ``` ` \$c = q('select count(*), platform, network, version from gserver where platform like "'.\$p.'" and last_contact > last_failure order by version asc;');` ` \$c = q('select count(*), platform, network, version from gserver` ` where platform like "'.\$p.'" and last_contact > last_failure` ` order by version asc;');` ``` // what versions for that platform do we know at all? ``` ``` // again only the active nodes ``` ` \$v = q('select count(*), version from gserver where last_contact > last_failure and platform like "'.\$p.'" group by version order by version;');` ` \$v = q('select count(*), version from gserver` ` where last_contact > last_failure and platform like "'.\$p.'" ` ` group by version` ` order by version;');` ``` // ``` ``` // clean up version numbers ``` ``` // ``` ``` // in the DB the Diaspora versions have the format x.x.x.x-xx the last ``` ``` // part (-xx) should be removed to clean up the versions from the "head ``` ``` // commit" information and combined into a single entry for x.x.x.x ``` ` if (\$p=='Diaspora') {` ` \$newV = array();` ` \$newVv = array();` ` foreach(\$v as \$vv) {` ` \$newVC = \$vv['count(*)'];` ` \$newVV = \$vv['version'];` ` \$posDash = strpos(\$newVV, '-');` ` if (\$posDash) ` ` \$newVV = substr(\$newVV, 0, \$posDash);` ` if (isset(\$newV[\$newVV]))` ` { ` ` \$newV[\$newVV] += \$newVC; ` ` } else { ` ` \$newV[\$newVV] = \$newVC; ` ` }` ` }` ` foreach (\$newV as \$key => \$value) {` ` array_push(\$newVv, array('count(*)'=>\$value, 'version'=>\$key));` ` }` ` \$v = \$newVv;` ` }` ``` // early friendica versions have the format x.x.xxxx where xxxx is the ``` ``` // DB version stamp; those should be operated out and versions be ``` ``` // conbined ``` ` if (\$p=='Friendica') {` ` \$newV = array();` ` \$newVv = array();` ` foreach (\$v as \$vv) {` ` \$newVC = \$vv['count(*)'];` ` \$newVV = \$vv['version'];` ` \$lastDot = strrpos(\$newVV,'.');` ` \$len = strlen(\$newVV)-1;` ` if (\$lastDot == \$len-4)` ` \$newVV = substr(\$newVV, 0, \$lastDot);` ` if (isset(\$newV[\$newVV])) ` ` { ` ` \$newV[\$newVV] += \$newVC; ` ` } else { ` ` \$newV[\$newVV] = \$newVC; ` ` }` ` }` ` foreach (\$newV as \$key => \$value) {` ` array_push(\$newVv, array('count(*)'=>\$value, 'version'=>\$key));` ` }` ` \$v = \$newVv;` ` }` ``` // the 3rd array item is needed for the JavaScript graphs as JS does ``` ``` // not like some characters in the names of variables... ``` ` \$counts[\$p]=array(\$c, \$v, str_replace(array(' ','%'),'',\$p));`
{"ft_lang_label":"__label__en","ft_lang_prob":0.5093644,"math_prob":0.9646463,"size":3102,"snap":"2021-31-2021-39","text_gpt3_token_len":1025,"char_repetition_ratio":0.27792123,"word_repetition_ratio":0.5342262,"special_character_ratio":0.47614443,"punctuation_ratio":0.1814346,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9835272,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-08-03T04:05:00Z\",\"WARC-Record-ID\":\"<urn:uuid:f34f3674-d04d-4294-a81f-bc0f10c99bef>\",\"Content-Length\":\"75770\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:398b7968-7d2f-4890-9485-0b518203ceb1>\",\"WARC-Concurrent-To\":\"<urn:uuid:b9ce83f6-c17c-43a8-89eb-91bb86162243>\",\"WARC-IP-Address\":\"95.217.122.172\",\"WARC-Target-URI\":\"https://git.friendi.ca/friendica/friendica/commit/ce399928759320a29d9bfe47e60e607fe88408d9?lang=zh-TW\",\"WARC-Payload-Digest\":\"sha1:RRZ42QZ3EDCIXM672AI437KPU3V4EBBE\",\"WARC-Block-Digest\":\"sha1:JRYH4DGGIJGXXAPNTFQ3TCWCASQGTS5I\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-31/CC-MAIN-2021-31_segments_1627046154420.77_warc_CC-MAIN-20210803030201-20210803060201-00002.warc.gz\"}"}