2011-06-14 4 views
4

PHP5.3 이상에서 실행할 수있는 PHP 코드베이스를 업그레이드하는 중입니다. 래퍼를 사용하는 함수 목록이 필요합니다.래퍼를 사용하는 PHP 함수

http://www.php.net/manual/en/wrappers.php

이 페이지는 언급; fopen(), copy(), file_exists() 및 filesize()가 있습니다. 다른 기능이 있다는 사실을 알고 있습니다. file_get_contents(), file() 및 기타.

누구든지 전체 목록을 보유하고 있습니까? 또는 래퍼를 사용하여 함수를 찾기 위해 디렉토리를 "grep"하는 쉬운 방법일까요?

+0

@ninuhadida - 목록이 가장 가능성이 매우 긴 것입니다. include_once ","include_once ","readfile ","file ","virtual ","imagecreatefrom ... ","DomDocument :: loadXMLFile "," Dom :: Document :: loadHTMLFile "등등. 함수의 많은 부분이 파일 이름/URL의 사용에 의존합니다. ** 여기서 진짜 질문은 완전한리스트를 원하는 이유입니까? ** –

+0

파일 이름을 지원하는 거의 모든 함수/메소드가 확장자를 포함하여 스트림 래퍼를 지원하기 때문에 그러한 목록을 만드는 것은 거의 불가능합니다. URL이 표현식 또는 변수의 결과 일 수 있기 때문에 래퍼를 사용하는 모든 함수에 대해 실제로 grep 할 수 없습니다. 당신이 할 수있는 최선은 아마도 디렉토리의 모든 URL에 대해'grep '일 것입니다. – netcoder

+0

@ Francois - 일부 래퍼가 기능을 변경했습니다./dev/stdin을 php : // stdin으로 변경해야합니다. 함수 목록을 가지고있는 한 grep 및 다른 도구로 처리 할 수 ​​있습니다. –

답변

3

grep PHP 소스가 php_stream_open_wrapper_ex인데, 이는 래퍼와 직접 상호 작용하는 PHP_FUNCTION을 제공해야합니다.

거친 아마도 부분적으로 잘못된 목록 (-B 100 정확한되지 않습니다) :

$ find . -name '*.c'| xargs grep -B 100 php_stream_open_wrapper_ex| grep PHP_FUNCTION 
./ext/standard/url.c-PHP_FUNCTION(rawurlencode) 
./ext/standard/url.c-PHP_FUNCTION(rawurldecode) 
./ext/standard/url.c-PHP_FUNCTION(get_headers) 
./ext/standard/file.c-PHP_FUNCTION(file_get_contents) 
./ext/standard/file.c-PHP_FUNCTION(file_put_contents) 
./ext/standard/file.c-PHP_FUNCTION(file) 
./ext/standard/file.c-PHP_FUNCTION(tempnam) 
./ext/standard/file.c-PHP_FUNCTION(mkdir) 
./ext/standard/file.c-PHP_FUNCTION(rmdir) 
./ext/standard/file.c-PHP_FUNCTION(readfile) 
./ext/oci8/oci8_interface.c-PHP_FUNCTION(oci_lob_export) 
./ext/hash/hash.c-PHP_FUNCTION(hash) 
./ext/hash/hash.c-PHP_FUNCTION(hash_file) 
./ext/hash/hash.c-PHP_FUNCTION(hash_update) 
./ext/hash/hash.c-PHP_FUNCTION(hash_update_stream) 
./ext/hash/hash.c-PHP_FUNCTION(hash_update_file)