reference/filesystem/functions/realpath.xml
0c9c2dd669fe9395eaa73d487fbd160f9057429a
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.realpath">
3
+
<refentry xml:id="function.realpath" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>realpath</refname>
6
6
<refpurpose>Returns canonicalized absolute pathname</refpurpose>
...
...
@@ -9,12 +9,12 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>string</type><methodname>realpath</methodname>
12
+
<type class="union"><type>string</type><type>false</type></type><methodname>realpath</methodname>
13
13
<methodparam><type>string</type><parameter>path</parameter></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
16
<function>realpath</function> expands all symbolic links and
17
-
resolves references to '/./', '/../' and extra '/' characters in
17
+
resolves references to <literal>/./</literal>, <literal>/../</literal> and extra <literal>/</literal> characters in
18
18
the input <parameter>path</parameter> and returns the canonicalized
19
19
absolute pathname.
20
20
</para>
...
...
@@ -31,8 +31,8 @@
31
31
The path being checked.
32
32
<note>
33
33
<para>
34
-
Whilst a path must be supplied, the value can be blank or &null;
35
-
In these cases, the value is interpreted as the current directory.
34
+
Whilst a path must be supplied, the value can be an empty string.
35
+
In this case, the value is interpreted as the current directory.
36
36
</para>
37
37
</note>
38
38
</para>
...
...
@@ -46,8 +46,8 @@
46
46
&reftitle.returnvalues;
47
47
<para>
48
48
Returns the canonicalized absolute pathname on success. The resulting path
49
-
will have no symbolic link, '/./' or '/../' components. Trailing delimiters,
50
-
such as \ and /, are also removed.
49
+
will have no symbolic link, <literal>/./</literal> or <literal>/../</literal> components. Trailing delimiters,
50
+
such as <literal>\</literal> and <literal>/</literal>, are also removed.
51
51
</para>
52
52
<para>
53
53
<function>realpath</function> returns &false; on failure, e.g. if
...
...
@@ -66,43 +66,21 @@
66
66
not normalize the character case.
67
67
</para>
68
68
</note>
69
+
<note>
70
+
<para>
71
+
The function <function>realpath</function> will not work for a file which
72
+
is inside a Phar as such path would be a virtual path, not a real one.
73
+
</para>
74
+
</note>
75
+
<note>
76
+
<para>
77
+
On Windows, junctions and symbolic links to directories are only expanded by
78
+
one level.
79
+
</para>
80
+
</note>
69
81
&fs.file.32bit;
70
82
</refsect1>
71
83

72
-
<refsect1 role="changelog">
73
-
&reftitle.changelog;
74
-
<para>
75
-
<informaltable>
76
-
<tgroup cols="2">
77
-
<thead>
78
-
<row>
79
-
<entry>&Version;</entry>
80
-
<entry>&Description;</entry>
81
-
</row>
82
-
</thead>
83
-
<tbody>
84
-
<row>
85
-
<entry>5.3.0</entry>
86
-
<entry>
87
-
Prior to this release, if only the last <parameter>path</parameter>
88
-
component did not exist, <function>realpath</function> would not fail on
89
-
*BSD systems. <function>realpath</function> now fails in this case.
90
-
</entry>
91
-
</row>
92
-
<row>
93
-
<entry>5.2.1</entry>
94
-
<entry>
95
-
Prior to this version, <function>realpath</function> returned &false;
96
-
if <parameter>path</parameter> is an empty string or &null;.
97
-
</entry>
98
-
</row>
99
-
</tbody>
100
-
</tgroup>
101
-
</informaltable>
102
-
</para>
103
-
</refsect1>
104
-

105
-

106
84
<refsect1 role="examples">
107
85
&reftitle.examples;
108
86
<para>
...
...
@@ -135,9 +113,9 @@ echo realpath('/tmp/') . PHP_EOL;
135
113
<programlisting role="php">
136
114
<![CDATA[
137
115
<?php
138
-
echo realpath('/windows/system32');
116
+
echo realpath('/windows/system32'), PHP_EOL;
139
117

140
-
echo realpath('C:\Program Files\\');
118
+
echo realpath('C:\Program Files\\'), PHP_EOL;
141
119
?>
142
120
]]>
143
121
</programlisting>
...
...
@@ -164,7 +142,6 @@ C:\Program Files
164
142
</refsect1>
165
143

166
144
</refentry>
167
-

168
145
<!-- Keep this comment at the end of the file
169
146
Local variables:
170
147
mode: sgml
171
148