cvs: phpdoc /en/reference/filesystem/functions chown.xml is-link.xml lstat.xml symlink.xml unlink.xml
| From: | Ross Masters | Date: | Thu, 09 Oct 2008 20:40:07 +0000 |
| Subject: | cvs: phpdoc /en/reference/filesystem/functions chown.xml is-link.xml lstat.xml symlink.xml unlink.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-2223@lists.php.net to get a copy of this message | ||
ross Thu Oct 9 20:40:07 2008 UTC
Modified files:
/phpdoc/en/reference/filesystem/functions chown.xml is-link.xml
lstat.xml symlink.xml
unlink.xml
Log:
Added missing examples.
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/filesystem/functions/chown.xml?r1=1.10&r2=1.11&diff_format=u
Index: phpdoc/en/reference/filesystem/functions/chown.xml
diff -u phpdoc/en/reference/filesystem/functions/chown.xml:1.10
phpdoc/en/reference/filesystem/functions/chown.xml:1.11
--- phpdoc/en/reference/filesystem/functions/chown.xml:1.10 Wed Jun 20 22:24:27 2007
+++ phpdoc/en/reference/filesystem/functions/chown.xml Thu Oct 9 20:40:06 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.10 $ -->
+<!-- $Revision: 1.11 $ -->
<refentry xmlns="http://docbook.org/ns/docbook"
xml:id="function.chown">
<refnamediv>
<refname>chown</refname>
@@ -51,6 +51,55 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>Simple <function>chown</function> usage</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+// File name and username to use
+$file_name= "foo.php";
+$path = "/home/sites/php.net/public_html/sandbox" . $file_name ;
+$user_name = "root";
+
+// Set the user
+chown($path, $user_name);
+
+// Check the result
+$stat = stat($path);
+print_r(posix_getpwuid($stat['uid']));
+
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+array(7) {
+ ["name"]=>
+ string(13) "php.net"
+ ["passwd"]=>
+ string(1) "x"
+ ["uid"]=>
+ int(148864)
+ ["gid"]=>
+ int(148910)
+ ["gecos"]=>
+ string(13) "php.net"
+ ["dir"]=>
+ string(25) "/home/sites/php.net"
+ ["shell"]=>
+ string(13) "/sbin/nologin"
+}
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+
<refsect1 role="notes">
&reftitle.notes;
¬e.no-remote;
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/filesystem/functions/is-link.xml?r1=1.9&r2=1.10&diff_format=u
Index: phpdoc/en/reference/filesystem/functions/is-link.xml
diff -u phpdoc/en/reference/filesystem/functions/is-link.xml:1.9
phpdoc/en/reference/filesystem/functions/is-link.xml:1.10
--- phpdoc/en/reference/filesystem/functions/is-link.xml:1.9 Wed Jun 20 22:24:27 2007
+++ phpdoc/en/reference/filesystem/functions/is-link.xml Thu Oct 9 20:40:06 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
<refentry xmlns="http://docbook.org/ns/docbook"
xml:id="function.is-link">
<refnamediv>
<refname>is_link</refname>
@@ -41,6 +41,31 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>Create and confirm if a file is a symbolic link</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$link = 'uploads';
+
+if(is_link($link))
+{
+ echo(readlink($link));
+}
+else
+{
+ symlink('uploads.php', $link);
+}
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
+
<refsect1 role="notes">
&reftitle.notes;
¬e.clearstatcache;
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/filesystem/functions/lstat.xml?r1=1.9&r2=1.10&diff_format=u
Index: phpdoc/en/reference/filesystem/functions/lstat.xml
diff -u phpdoc/en/reference/filesystem/functions/lstat.xml:1.9
phpdoc/en/reference/filesystem/functions/lstat.xml:1.10
--- phpdoc/en/reference/filesystem/functions/lstat.xml:1.9 Wed Jun 20 22:24:28 2007
+++ phpdoc/en/reference/filesystem/functions/lstat.xml Thu Oct 9 20:40:06 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
<refentry xmlns="http://docbook.org/ns/docbook"
xml:id="function.lstat">
<refnamediv>
<refname>lstat</refname>
@@ -46,6 +46,43 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>Comparison of <function>stat</function> and
<function>lstat</function></title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+symlink('uploads.php', 'uploads');
+
+// Contrast information for uploads.php and uploads
+array_diff(stat('uploads'), lstat('uploads'));
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <para>
+ Information that differs between the two files.
+ </para>
+ <screen>
+<![CDATA[
+Array
+(
+ [ino] => 97236376
+ [mode] => 33188
+ [size] => 34
+ [atime] => 1223580003
+ [mtime] => 1223581848
+ [ctime] => 1223581848
+ [blocks] => 8
+)
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+
<refsect1 role="notes">
&reftitle.notes;
¬e.clearstatcache;
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/filesystem/functions/symlink.xml?r1=1.9&r2=1.10&diff_format=u
Index: phpdoc/en/reference/filesystem/functions/symlink.xml
diff -u phpdoc/en/reference/filesystem/functions/symlink.xml:1.9
phpdoc/en/reference/filesystem/functions/symlink.xml:1.10
--- phpdoc/en/reference/filesystem/functions/symlink.xml:1.9 Wed Jun 20 22:24:28 2007
+++ phpdoc/en/reference/filesystem/functions/symlink.xml Thu Oct 9 20:40:06 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
<refentry xmlns="http://docbook.org/ns/docbook"
xml:id="function.symlink">
<refnamediv>
<refname>symlink</refname>
@@ -51,6 +51,26 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>Create a symbolic link</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$target = 'uploads.php';
+$link = 'uploads';
+symlink($target, $link);
+
+echo(readlink($link));
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
+
<refsect1 role="notes">
&reftitle.notes;
¬e.no-windows;
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/filesystem/functions/unlink.xml?r1=1.12&r2=1.13&diff_format=u
Index: phpdoc/en/reference/filesystem/functions/unlink.xml
diff -u phpdoc/en/reference/filesystem/functions/unlink.xml:1.12
phpdoc/en/reference/filesystem/functions/unlink.xml:1.13
--- phpdoc/en/reference/filesystem/functions/unlink.xml:1.12 Wed Jun 20 22:24:28 2007
+++ phpdoc/en/reference/filesystem/functions/unlink.xml Thu Oct 9 20:40:06 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.12 $ -->
+<!-- $Revision: 1.13 $ -->
<refentry xmlns="http://docbook.org/ns/docbook"
xml:id="function.unlink">
<refnamediv>
<refname>unlink</refname>
@@ -75,6 +75,29 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>Basic <function>unlink</function> usage</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$fh = fopen('test.html', 'a');
+fwrite($fh, '<h1>Hello world!</h1>');
+fclose($fh);
+
+mkdir('testdir', 0777);
+
+unlink('test.html');
+unlink('testdir');
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
+
<refsect1 role="seealso">
&reftitle.seealso;
<para>