reference/filesystem/functions/touch.xml
2b56c905fb0d6fcab44cc0c2abdbf393fc2b69ea
...
...
@@ -11,13 +11,13 @@
11
11
<methodsynopsis>
12
12
<type>bool</type><methodname>touch</methodname>
13
13
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
14
-
<methodparam choice="opt"><type>int</type><parameter>time</parameter><initializer>time()</initializer></methodparam>
15
-
<methodparam choice="opt"><type>int</type><parameter>atime</parameter></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>mtime</parameter><initializer>&null;</initializer></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>atime</parameter><initializer>&null;</initializer></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
Attempts to set the access and modification times of the file named in the
19
19
<parameter>filename</parameter> parameter to the value given in
20
-
<parameter>time</parameter>.
20
+
<parameter>mtime</parameter>.
21
21
Note that the access time is always modified, regardless of the number
22
22
of parameters.
23
23
</para>
...
...
@@ -39,11 +39,11 @@
39
39
</listitem>
40
40
</varlistentry>
41
41
<varlistentry>
42
-
<term><parameter>time</parameter></term>
42
+
<term><parameter>mtime</parameter></term>
43
43
<listitem>
44
44
<para>
45
-
The touch time. If <parameter>time</parameter> is not supplied,
46
-
the current system time is used.
45
+
The touch time. If <parameter>mtime</parameter> is &null;,
46
+
the current system <function>time</function> is used.
47
47
</para>
48
48
</listitem>
49
49
</varlistentry>
...
...
@@ -51,10 +51,10 @@
51
51
<term><parameter>atime</parameter></term>
52
52
<listitem>
53
53
<para>
54
-
If present, the access time of the given filename is set to
54
+
If not &null;, the access time of the given filename is set to
55
55
the value of <parameter>atime</parameter>. Otherwise, it is set to
56
-
the value passed to the <parameter>time</parameter> parameter.
57
-
If neither are present, the current system time is used.
56
+
the value passed to the <parameter>mtime</parameter> parameter.
57
+
If both are &null;, the current system time is used.
58
58
</para>
59
59
</listitem>
60
60
</varlistentry>
...
...
@@ -71,27 +71,25 @@
71
71

72
72
<refsect1 role="changelog">
73
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
-
It became possible to change the modification time of a directory
88
-
under Windows.
89
-
</entry>
90
-
</row>
91
-
</tbody>
92
-
</tgroup>
93
-
</informaltable>
94
-
</para>
74
+
<informaltable>
75
+
<tgroup cols="2">
76
+
<thead>
77
+
<row>
78
+
<entry>&Version;</entry>
79
+
<entry>&Description;</entry>
80
+
</row>
81
+
</thead>
82
+
<tbody>
83
+
<row>
84
+
<entry>8.0.0</entry>
85
+
<entry>
86
+
<parameter>mtime</parameter> and <parameter>atime</parameter>
87
+
are now nullable.
88
+
</entry>
89
+
</row>
90
+
</tbody>
91
+
</tgroup>
92
+
</informaltable>
95
93
</refsect1>
96
94

97
95
<refsect1 role="examples">
...
...
@@ -114,7 +112,7 @@ if (touch($filename)) {
114
112
</para>
115
113
<para>
116
114
<example>
117
-
<title><function>touch</function> using the <parameter>time</parameter> parameter</title>
115
+
<title><function>touch</function> using the <parameter>mtime</parameter> parameter</title>
118
116
<programlisting role="php">
119
117
<![CDATA[
120
118
<?php
...
...
@@ -137,12 +135,6 @@ if (!touch('some_file.txt', $time)) {
137
135
<refsect1 role="notes">
138
136
&reftitle.notes;
139
137
&note.filesystem-time-res;
140
-
<warning>
141
-
<para>
142
-
Prior to PHP 5.3.0 it was not possible to change the modification time
143
-
of a directory with this function under Windows.
144
-
</para>
145
-
</warning>
146
138
</refsect1>
147
139
148
140
</refentry>
149
141