apache_lookup_uri

(PHP 3>= 3.0.4, PHP 4 , PHP 5)

apache_lookup_uri --  특정한 URI에 대한 부분 요청을 실행하고 그에 대한 모든 정보를 반환한다.

설명

object apache_lookup_uri ( string filename)

URI에 대한 부분 요청을 실행합니다. 주어진 자원에 대하여 모든 중요한 정보를 포함하여 많은 정보를 클래스로 반환합니다. 반환하는 클래스의 속성은 다음과 같습니다:

status
the_request
status_line
method
content_type
handler
uri
filename
path_info
args
boundary
no_cache
no_local_copy
allowed
send_bodyct
bytes_sent
byterange
clength
unparsed_uri
mtime
request_time

예 1. apache_lookup_uri() 예제

<?php
$info
= apache_lookup_uri('index.php?var=value');
print_r($info);

if (
file_exists($info->filename)) {
    echo
'파일이 존재합니다!';
}
?>

위 예제의 출력 예는:

stdClass Object
(
    [status] => 200
    [the_request] => GET /dir/file.php HTTP/1.1
    [method] => GET
    [mtime] => 0
    [clength] => 0
    [chunked] => 0
    [content_type] => application/x-httpd-php
    [no_cache] => 0
    [no_local_copy] => 1
    [unparsed_uri] => /dir/index.php?var=value
    [uri] => /dir/index.php
    [filename] => /home/htdocs/dir/index.php
    [args] => var=value
    [allowed] => 0
    [sent_bodyct] => 0
    [bytes_sent] => 0
    [request_time] => 1074282764
)
파일이 존재합니다!

참고: apache_lookup_uri()는 PHP를 아파치 모듈로 설치했을 경우에만 작동합니다.