Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894647
update_compat_info.php
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
update_compat_info.php
View Options
#!/usr/bin/env php
<?php
require_once
dirname
(
__FILE__
)
.
'/__init_script__.php'
;
$target
=
'resources/php_compat_info.json'
;
echo
"Purpose: Updates {$target} used by ArcanistXHPASTLinter.\n"
;
$ok
=
include
'PHP/CompatInfo/Autoload.php'
;
if
(
!
$ok
)
{
echo
"You need PHP_CompatInfo available in 'include_path'.\n"
;
echo
"http://php5.laurent-laville.org/compatinfo/\n"
;
exit
(
1
)
;
}
$required
=
'5.2.3'
;
$reference
=
id
(
new
PHP_CompatInfo_Reference_ALL
(
)
)
->
getAll
(
)
;
$output
=
array
(
)
;
$output
[
'@'
.
'generated'
]
=
true
;
$output
[
'params'
]
=
array
(
)
;
foreach
(
array
(
'functions'
,
'classes'
,
'interfaces'
)
as
$type
)
{
$output
[
$type
]
=
array
(
)
;
foreach
(
$reference
[
$type
]
as
$name
=>
$versions
)
{
$name
=
strtolower
(
$name
)
;
$versions
=
reset
(
$versions
)
;
list
(
$min
,
$max
)
=
$versions
;
if
(
version_compare
(
$min
,
$required
)
>
0
)
{
$output
[
$type
]
[
$name
]
=
$min
;
}
if
(
$type
==
'functions'
&&
isset
(
$versions
[
4
]
)
)
{
$params
=
explode
(
', '
,
$versions
[
4
]
)
;
foreach
(
$params
as
$i
=>
$version
)
{
if
(
version_compare
(
$version
,
$required
)
>
0
)
{
$output
[
'params'
]
[
$name
]
[
$i
]
=
$version
;
}
}
}
}
}
// Grepped from PHP Manual.
$output
[
'functions_windows'
]
=
array
(
'apache_child_terminate'
=>
''
,
'chroot'
=>
''
,
'getrusage'
=>
''
,
'imagecreatefromxpm'
=>
''
,
'lchgrp'
=>
''
,
'lchown'
=>
''
,
'nl_langinfo'
=>
''
,
'strptime'
=>
''
,
'sys_getloadavg'
=>
''
,
'checkdnsrr'
=>
'5.3.0'
,
'dns_get_record'
=>
'5.3.0'
,
'fnmatch'
=>
'5.3.0'
,
'getmxrr'
=>
'5.3.0'
,
'getopt'
=>
'5.3.0'
,
'imagecolorclosesthwb'
=>
'5.3.0'
,
'inet_ntop'
=>
'5.3.0'
,
'inet_pton'
=>
'5.3.0'
,
'link'
=>
'5.3.0'
,
'linkinfo'
=>
'5.3.0'
,
'readlink'
=>
'5.3.0'
,
'socket_create_pair'
=>
'5.3.0'
,
'stream_socket_pair'
=>
'5.3.0'
,
'symlink'
=>
'5.3.0'
,
'time_nanosleep'
=>
'5.3.0'
,
'time_sleep_until'
=>
'5.3.0'
,
)
;
file_put_contents
(
phutil_get_library_root
(
'arcanist'
)
.
'/../'
.
$target
,
id
(
new
PhutilJSON
(
)
)
->
encodeFormatted
(
$output
)
)
;
echo
"Done.\n"
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 19, 20:11 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128339
Default Alt Text
update_compat_info.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment