1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-21 14:22:40 +01:00

Read extension classes and functions from php_compat_info.json.

Summary: Consolidate `php_extension_classes.txt` and `php_extension_functions.txt` with `php_compat_info.json`. Given that `php_extension_classes.txt` and `php_extension_functions.txt` are manually generated whereas `php_compat_info.json` is generated automatically, this should make maintenance easier.

Test Plan: Deleted the `src/.phutil_module_cache` file (in each of rARC, rPHU and rP) and ran `arc liberate`.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9662
This commit is contained in:
Joshua Spence 2014-06-23 04:26:01 +10:00
parent 3228f7789c
commit 2f3e5e48ef
5 changed files with 3623 additions and 1962 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,33 +0,0 @@
CURLFile
DOMException
DOMStringList
DOMNameList
DOMImplementationList
DOMImplementationSource
DOMImplementation
DOMNode
DOMNameSpaceNode
DOMDocumentFragment
DOMDocument
DOMNodeList
DOMNamedNodeMap
DOMCharacterData
DOMAttr
DOMElement
DOMText
DOMComment
DOMTypeinfo
DOMUserDataHandler
DOMDomError
DOMErrorHandler
DOMLocator
DOMConfiguration
DOMCdataSection
DOMDocumentType
DOMNotation
DOMEntity
DOMEntityReference
DOMProcessingInstruction
DOMStringExtend
DOMXPath
ZipArchive

View file

@ -1,579 +0,0 @@
apc_add
apc_bin_dump
apc_bin_dumpfile
apc_bin_load
apc_bin_loadfile
apc_cache_info
apc_cas
apc_clear_cache
apc_compile_file
apc_dec
apc_define_constants
apc_delete
apc_delete_file
apc_exists
apc_fetch
apc_inc
apc_load_constants
apc_sma_info
apc_store
bcadd
bccomp
bcdiv
bcmod
bcmul
bcpow
bcpowmod
bcscale
bcsqrt
bcsub
curl_close
curl_copy_handle
curl_errno
curl_error
curl_escape
curl_exec
curl_getinfo
curl_init
curl_multi_add_handle
curl_multi_close
curl_multi_exec
curl_multi_getcontent
curl_multi_info_read
curl_multi_init
curl_multi_remove_handle
curl_multi_select
curl_reset
curl_setopt
curl_setopt_array
curl_share_close
curl_share_init
curl_share_setopt
curl_unescape
curl_version
gzrewind
gzclose
gzeof
gzgetc
gzgets
gzgetss
gzread
gzopen
gzpassthru
gzseek
gztell
gzwrite
gzputs
gzfile
gzcompress
gzuncompress
gzdeflate
gzinflate
gzencode
gzdecode
image2wbmp
image_type_to_extension
image_type_to_mime_type
imagealphablending
imageantialias
imagearc
imagechar
imagecharup
imagecolorallocate
imagecolorallocatealpha
imagecolorat
imagecolorclosest
imagecolorclosestalpha
imagecolorclosesthwb
imagecolordeallocate
imagecolorexact
imagecolorexactalpha
imagecolormatch
imagecolorresolve
imagecolorresolvealpha
imagecolorset
imagecolorsforindex
imagecolorstotal
imagecolortransparent
imageconvolution
imagecopy
imagecopymerge
imagecopymergegray
imagecopyresampled
imagecopyresized
imagecreate
imagecreatefromgd
imagecreatefromgd2
imagecreatefromgd2part
imagecreatefromgif
imagecreatefromjpeg
imagecreatefrompng
imagecreatefromstring
imagecreatefromwbmp
imagecreatefromxbm
imagecreatefromxpm
imagecreatetruecolor
imagedashedline
imagedestroy
imageellipse
imagefill
imagefilledarc
imagefilledellipse
imagefilledpolygon
imagefilledrectangle
imagefilltoborder
imagefilter
imagefontheight
imagefontwidth
imageftbbox
imagefttext
imagegammacorrect
imagegd
imagegd2
imagegif
imagegrabscreen
imagegrabwindow
imageinterlace
imageistruecolor
imagejpeg
imagelayereffect
imageline
imageloadfont
imagepalettecopy
imagepng
imagepolygon
imagepsbbox
imagepsencodefont
imagepsextendfont
imagepsfreefont
imagepsloadfont
imagepsslantfont
imagepstext
imagerectangle
imagerotate
imagesavealpha
imagesetbrush
imagesetpixel
imagesetstyle
imagesetthickness
imagesettile
imagestring
imagestringup
imagesx
imagesy
imagetruecolortopalette
imagettfbbox
imagettftext
imagetypes
imagewbmp
imagexbm
ldap_connect
ldap_close
ldap_bind
ldap_sasl_bind
ldap_unbind
ldap_read
ldap_list
ldap_search
ldap_free_result
ldap_count_entries
ldap_first_entry
ldap_next_entry
ldap_get_entries
ldap_first_attribute
ldap_next_attribute
ldap_get_attributes
ldap_get_values
ldap_get_values_len
ldap_get_dn
ldap_explode_dn
ldap_dn2ufn
ldap_add
ldap_delete
ldap_modify
ldap_mod_add
ldap_mod_replace
ldap_mod_del
ldap_errno
ldap_err2str
ldap_error
ldap_compare
ldap_sort
ldap_rename
ldap_get_option
ldap_set_option
ldap_first_reference
ldap_next_reference
ldap_parse_reference
ldap_parse_result
ldap_start_tls
ldap_set_rebind_proc
ldap_control_paged_result
ldap_control_paged_result_response
mb_convert_case
mb_strtoupper
mb_strtolower
mb_language
mb_internal_encoding
mb_http_input
mb_http_output
mb_detect_order
mb_substitute_character
mb_parse_str
mb_output_handler
mb_preferred_mime_name
mb_strlen
mb_strpos
mb_strrpos
mb_stripos
mb_strripos
mb_strstr
mb_strrchr
mb_stristr
mb_strrichr
mb_substr_count
mb_substr
mb_strcut
mb_strwidth
mb_strimwidth
mb_convert_encoding
mb_detect_encoding
mb_list_encodings
mb_encoding_aliases
mb_convert_kana
mb_encode_mimeheader
mb_decode_mimeheader
mb_convert_variables
mb_encode_numericentity
mb_decode_numericentity
mb_send_mail
mb_get_info
mb_check_encoding
mb_regex_encoding
mb_regex_set_options
mb_ereg
mb_eregi
mb_ereg_replace
mb_eregi_replace
mb_ereg_replace_callback
mb_split
mb_ereg_match
mb_ereg_search
mb_ereg_search_pos
mb_ereg_search_regs
mb_ereg_search_init
mb_ereg_search_getregs
mb_ereg_search_getpos
mb_ereg_search_setpos
mbregex_encoding
mbereg
mberegi
mbereg_replace
mberegi_replace
mbsplit
mbereg_match
mbereg_search
mbereg_search_pos
mbereg_search_regs
mbereg_search_init
mbereg_search_getregs
mbereg_search_getpos
mbereg_search_setpos
mysql_connect
mysql_pconnect
mysql_close
mysql_select_db
mysql_query
mysql_unbuffered_query
mysql_db_query
mysql_list_dbs
mysql_list_tables
mysql_list_fields
mysql_list_processes
mysql_error
mysql_errno
mysql_affected_rows
mysql_insert_id
mysql_result
mysql_num_rows
mysql_num_fields
mysql_fetch_row
mysql_fetch_array
mysql_fetch_assoc
mysql_fetch_object
mysql_data_seek
mysql_fetch_lengths
mysql_fetch_field
mysql_field_seek
mysql_free_result
mysql_field_name
mysql_field_table
mysql_field_len
mysql_field_type
mysql_field_flags
mysql_escape_string
mysql_real_escape_string
mysql_stat
mysql_thread_id
mysql_client_encoding
mysql_ping
mysql_get_client_info
mysql_get_host_info
mysql_get_proto_info
mysql_get_server_info
mysql_info
mysql_set_charset
mysql
mysql_fieldname
mysql_fieldtable
mysql_fieldlen
mysql_fieldtype
mysql_fieldflags
mysql_selectdb
mysql_freeresult
mysql_numfields
mysql_numrows
mysql_listdbs
mysql_listtables
mysql_listfields
mysql_db_name
mysql_dbname
mysql_tablename
mysql_table_name
mysqli_affected_rows
mysqli_autocommit
mysqli_change_user
mysqli_character_set_name
mysqli_close
mysqli_commit
mysqli_connect
mysqli_connect_errno
mysqli_connect_error
mysqli_data_seek
mysqli_dump_debug_info
mysqli_debug
mysqli_errno
mysqli_error
mysqli_error_list
mysqli_stmt_execute
mysqli_execute
mysqli_fetch_field
mysqli_fetch_fields
mysqli_fetch_field_direct
mysqli_fetch_lengths
mysqli_fetch_all
mysqli_fetch_array
mysqli_fetch_assoc
mysqli_fetch_object
mysqli_fetch_row
mysqli_field_count
mysqli_field_seek
mysqli_field_tell
mysqli_free_result
mysqli_get_connection_stats
mysqli_get_client_stats
mysqli_get_charset
mysqli_get_client_info
mysqli_get_client_version
mysqli_get_host_info
mysqli_get_proto_info
mysqli_get_server_info
mysqli_get_server_version
mysqli_get_warnings
mysqli_init
mysqli_info
mysqli_insert_id
mysqli_kill
mysqli_more_results
mysqli_multi_query
mysqli_next_result
mysqli_num_fields
mysqli_num_rows
mysqli_options
mysqli_ping
mysqli_poll
mysqli_prepare
mysqli_report
mysqli_query
mysqli_real_connect
mysqli_real_escape_string
mysqli_real_query
mysqli_reap_async_query
mysqli_rollback
mysqli_select_db
mysqli_set_charset
mysqli_stmt_affected_rows
mysqli_stmt_attr_get
mysqli_stmt_attr_set
mysqli_stmt_bind_param
mysqli_stmt_bind_result
mysqli_stmt_close
mysqli_stmt_data_seek
mysqli_stmt_errno
mysqli_stmt_error
mysqli_stmt_error_list
mysqli_stmt_fetch
mysqli_stmt_field_count
mysqli_stmt_free_result
mysqli_stmt_get_result
mysqli_stmt_get_warnings
mysqli_stmt_init
mysqli_stmt_insert_id
mysqli_stmt_more_results
mysqli_stmt_next_result
mysqli_stmt_num_rows
mysqli_stmt_param_count
mysqli_stmt_prepare
mysqli_stmt_reset
mysqli_stmt_result_metadata
mysqli_stmt_send_long_data
mysqli_stmt_store_result
mysqli_stmt_sqlstate
mysqli_sqlstate
mysqli_ssl_set
mysqli_stat
mysqli_store_result
mysqli_thread_id
mysqli_thread_safe
mysqli_use_result
mysqli_warning_count
mysqli_refresh
mysqli_escape_string
mysqli_set_opt
openssl_pkey_free
openssl_pkey_new
openssl_pkey_export
openssl_pkey_export_to_file
openssl_pkey_get_private
openssl_pkey_get_public
openssl_pkey_get_details
openssl_free_key
openssl_get_privatekey
openssl_get_publickey
openssl_x509_read
openssl_x509_free
openssl_x509_parse
openssl_x509_checkpurpose
openssl_x509_check_private_key
openssl_x509_export
openssl_x509_export_to_file
openssl_pkcs12_export
openssl_pkcs12_export_to_file
openssl_pkcs12_read
openssl_csr_new
openssl_csr_export
openssl_csr_export_to_file
openssl_csr_sign
openssl_csr_get_subject
openssl_csr_get_public_key
openssl_digest
openssl_encrypt
openssl_decrypt
openssl_cipher_iv_length
openssl_sign
openssl_verify
openssl_seal
openssl_open
openssl_pkcs7_verify
openssl_pkcs7_decrypt
openssl_pkcs7_sign
openssl_pkcs7_encrypt
openssl_private_encrypt
openssl_private_decrypt
openssl_public_encrypt
openssl_public_decrypt
openssl_get_md_methods
openssl_get_cipher_methods
openssl_dh_compute_key
openssl_random_pseudo_bytes
openssl_error_string
password_get_info
password_hash
password_needs_rehash
password_verify
pcntl_fork
pcntl_waitpid
pcntl_wait
pcntl_signal
pcntl_signal_dispatch
pcntl_wifexited
pcntl_wifstopped
pcntl_wifsignaled
pcntl_wexitstatus
pcntl_wtermsig
pcntl_wstopsig
pcntl_exec
pcntl_alarm
pcntl_get_last_error
pcntl_errno
pcntl_strerror
pcntl_getpriority
pcntl_setpriority
pcntl_sigprocmask
posix_kill
posix_getpid
posix_getppid
posix_getuid
posix_setuid
posix_geteuid
posix_seteuid
posix_getgid
posix_setgid
posix_getegid
posix_setegid
posix_getgroups
posix_getlogin
posix_getpgrp
posix_setsid
posix_setpgid
posix_getpgid
posix_getsid
posix_uname
posix_times
posix_ctermid
posix_ttyname
posix_isatty
posix_getcwd
posix_mkfifo
posix_mknod
posix_access
posix_getgrnam
posix_getgrgid
posix_getpwnam
posix_getpwuid
posix_getrlimit
posix_get_last_error
posix_errno
posix_strerror
posix_initgroups
socket_accept
socket_bind
socket_clear_error
socket_close
socket_connect
socket_create
socket_create_listen
socket_create_pair
socket_get_option
socket_get_status
socket_getopt
socket_getpeername
socket_getsockname
socket_import_stream
socket_last_error
socket_listen
socket_read
socket_recv
socket_recvfrom
socket_select
socket_send
socket_sendto
socket_set_block
socket_set_blocking
socket_set_nonblock
socket_set_option
socket_set_timeout
socket_setopt
socket_shutdown
socket_strerror
socket_write

View file

@ -368,7 +368,7 @@ foreach ($calls as $call) {
// -( Interfaces )------------------------------------------------------------
// Find interfaces declared in ths file.
// Find interfaces declared in this file.
// This is "interface X .. { ... }".
@ -488,8 +488,8 @@ if ($args->getArg('ugly')) {
function phutil_fail_on_unsupported_feature(XHPASTNode $node, $file, $what) {
$line = $node->getLineNumber();
$message = phutil_console_wrap(pht(
"`arc liberate` has limited support for features introduced after PHP ".
"5.2.3. This library uses an unsupported feature (%s) on line %d of %s",
'`arc liberate` has limited support for features introduced after PHP '.
'5.2.3. This library uses an unsupported feature (%s) on line %d of %s',
$what,
$line,
Filesystem::readablePath($file)));
@ -512,14 +512,17 @@ function phutil_symbols_get_builtins() {
$funcs = get_defined_functions();
$builtin['functions'] = $funcs['internal'];
foreach (array('functions', 'classes') as $type) {
$compat = json_decode(
file_get_contents(
dirname(__FILE__).'/../resources/php_compat_info.json'),
true);
foreach (array('functions', 'classes', 'interfaces') as $type) {
// Developers may not have every extension that a library potentially uses
// installed. We supplement the list of declared functions and classses with
// installed. We supplement the list of declared functions and classes with
// a list of known extension functions to avoid raising false positives just
// because you don't have pcntl, etc.
$list = dirname(__FILE__)."/php_extension_{$type}.txt";
$extensions = file_get_contents($list);
$extensions = explode("\n", trim($extensions));
$extensions = array_keys($compat[$type]);
$builtin[$type] = array_merge($builtin[$type], $extensions);
}

View file

@ -19,9 +19,11 @@ $output['classMethods'] = array();
$references = array(
new \Bartlett\CompatInfo\Reference\Extension\ApcExtension(),
new \Bartlett\CompatInfo\Reference\Extension\BcmathExtension(),
new \Bartlett\CompatInfo\Reference\Extension\CoreExtension(),
new \Bartlett\CompatInfo\Reference\Extension\CurlExtension(),
new \Bartlett\CompatInfo\Reference\Extension\DateExtension(),
new \Bartlett\CompatInfo\Reference\Extension\DomExtension(),
new \Bartlett\CompatInfo\Reference\Extension\FileinfoExtension(),
new \Bartlett\CompatInfo\Reference\Extension\GdExtension(),
new \Bartlett\CompatInfo\Reference\Extension\GettextExtension(),
@ -29,9 +31,12 @@ $references = array(
new \Bartlett\CompatInfo\Reference\Extension\ImagickExtension(),
new \Bartlett\CompatInfo\Reference\Extension\IntlExtension(),
new \Bartlett\CompatInfo\Reference\Extension\JsonExtension(),
new \Bartlett\CompatInfo\Reference\Extension\LdapExtension(),
new \Bartlett\CompatInfo\Reference\Extension\LibxmlExtension(),
new \Bartlett\CompatInfo\Reference\Extension\MbstringExtension(),
new \Bartlett\CompatInfo\Reference\Extension\MysqlExtension(),
new \Bartlett\CompatInfo\Reference\Extension\MysqliExtension(),
new \Bartlett\CompatInfo\Reference\Extension\OpensslExtension(),
new \Bartlett\CompatInfo\Reference\Extension\PcntlExtension(),
new \Bartlett\CompatInfo\Reference\Extension\PcreExtension(),
new \Bartlett\CompatInfo\Reference\Extension\PdoExtension(),
@ -39,12 +44,15 @@ $references = array(
new \Bartlett\CompatInfo\Reference\Extension\PosixExtension(),
new \Bartlett\CompatInfo\Reference\Extension\ReflectionExtension(),
new \Bartlett\CompatInfo\Reference\Extension\SimplexmlExtension(),
new \Bartlett\CompatInfo\Reference\Extension\SocketsExtension(),
new \Bartlett\CompatInfo\Reference\Extension\StandardExtension(),
new \Bartlett\CompatInfo\Reference\Extension\SplExtension(),
new \Bartlett\CompatInfo\Reference\Extension\XmlExtension(),
new \Bartlett\CompatInfo\Reference\Extension\XmlreaderExtension(),
new \Bartlett\CompatInfo\Reference\Extension\XmlwriterExtension(),
new \Bartlett\CompatInfo\Reference\Extension\YamlExtension(),
new \Bartlett\CompatInfo\Reference\Extension\ZipExtension(),
new \Bartlett\CompatInfo\Reference\Extension\ZlibExtension(),
);
foreach ($references as $reference) {