Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P10669
extkeys-all (T187154)
Active
Public
Actions
Authored by
Krinkle
on Mar 9 2020, 6:44 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F31673289: raw.txt
Mar 9 2020, 6:44 PM
2020-03-09 18:44:00 (UTC+0)
Subscribers
None
<?php
$json
=
@
$argv
[
1
]
?
file_get_contents
(
$argv
[
1
])
:
die
(
'Missing argument'
);
$data
=
json_decode
(
$json
,
/* assoc */
true
);
$keys
=
array_keys
(
$data
);
foreach
(
$data
as
$key
=>
$val
)
{
if
(
is_array
(
$val
)
)
{
foreach
(
$val
as
$subkey
=>
$subval
)
{
$keys
[]
=
"{$key}.{$subkey}"
;
if
(
$key
===
'attributes'
)
{
// one more level for this one
foreach
(
$subval
as
$attribsubkey
=>
$_
)
{
$keys
[]
=
"{$key}.{$subkey}.{$attribsubkey}"
;
}
}
}
}
}
echo
implode
(
"
\n
"
,
$keys
)
.
"
\n
"
;
# /srv/mediawiki $ ls php/extensions/*/extension.json | xargs -P 10 -I '{}' php ~/extkeys.php '{}' > ~/extkeys-all.txt
# ~ $ sort ./extkeys-all.txt | uniq -c | sort -nr | head -n50
Event Timeline
Krinkle
created this paste.
Mar 9 2020, 6:44 PM
2020-03-09 18:44:00 (UTC+0)
Krinkle
mentioned this in
T187154: Performance regression from Apcu/ExtensionRegistry::loadFromQueue on PHP7
.
Log In to Comment