mg              Wed Aug 18 17:24:33 2004 EDT

  Modified files:              
    /phpdoc/en/reference/xattr/functions        xattr-get.xml xattr-list.xml 
                                                xattr-remove.xml 
  Log:
  Add examples.
  
  
http://cvs.php.net/diff.php/phpdoc/en/reference/xattr/functions/xattr-get.xml?r1=1.1&r2=1.2&ty=u
Index: phpdoc/en/reference/xattr/functions/xattr-get.xml
diff -u phpdoc/en/reference/xattr/functions/xattr-get.xml:1.1 
phpdoc/en/reference/xattr/functions/xattr-get.xml:1.2
--- phpdoc/en/reference/xattr/functions/xattr-get.xml:1.1       Sat Aug 14 19:39:49 
2004
+++ phpdoc/en/reference/xattr/functions/xattr-get.xml   Wed Aug 18 17:24:33 2004
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
 <!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
   <refentry id="function.xattr-get">
    <refnamediv>
@@ -46,6 +46,23 @@
     <para>
      Returns <type>string</type> with value or &false; if attribute doesn't exist. 
     </para>
+    <example>
+     <title><function>xattr_get</function> example</title>
+     <para>
+      The following code checks if system administrator has signed the file.
+     </para>
+     <programlisting role="php">
+<![CDATA[
+<?php
+$file = '/usr/local/sbin/some_binary;
+$signature = xattr_get($file, 'Root signature', XATTR_ROOT);
+
+/* ... check if $signature is valid ... */
+
+?>
+]]>
+     </programlisting>
+    </example>
     <para>
      See also <function>xattr_set</function>, <function>xattr_remove</function>, 
      <function>xattr_list</function>.
http://cvs.php.net/diff.php/phpdoc/en/reference/xattr/functions/xattr-list.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc/en/reference/xattr/functions/xattr-list.xml
diff -u phpdoc/en/reference/xattr/functions/xattr-list.xml:1.2 
phpdoc/en/reference/xattr/functions/xattr-list.xml:1.3
--- phpdoc/en/reference/xattr/functions/xattr-list.xml:1.2      Sat Aug 14 19:46:10 
2004
+++ phpdoc/en/reference/xattr/functions/xattr-list.xml  Wed Aug 18 17:24:33 2004
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
   <refentry id="function.xattr-list">
    <refnamediv>
@@ -45,6 +45,32 @@
     <para>
      This function returns <type>array</type> with names of extended attributes. 
     </para>
+    <example>
+     <title><function>xattr_list</function> example</title>
+     <para>
+      The following code prints names of all extended attributes of file.
+     </para>
+     <programlisting role="php">
+<![CDATA[
+<?php
+$file = 'some_file;
+$root_attributes = xattr_list($file, XATTR_ROOT);
+$user_attributes = xattr_list($file);
+
+echo "Root attributes: \n";
+foreach ($root_attributes as $attr_name) {
+    printf("%s\n", $attr_name);
+}
+
+echo "\n User attributes: \n";
+foreach ($attributes as $attr_name) {
+    printf("%s\n", $attr_name);
+}
+
+?>
+]]>
+     </programlisting>
+    </example>
     <para>
      See also <function>xattr_get</function>, <function>xattr_set</function>, 
      <function>xattr_remove</function>.
http://cvs.php.net/diff.php/phpdoc/en/reference/xattr/functions/xattr-remove.xml?r1=1.1&r2=1.2&ty=u
Index: phpdoc/en/reference/xattr/functions/xattr-remove.xml
diff -u phpdoc/en/reference/xattr/functions/xattr-remove.xml:1.1 
phpdoc/en/reference/xattr/functions/xattr-remove.xml:1.2
--- phpdoc/en/reference/xattr/functions/xattr-remove.xml:1.1    Sat Aug 14 19:39:49 
2004
+++ phpdoc/en/reference/xattr/functions/xattr-remove.xml        Wed Aug 18 17:24:33 
2004
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
 <!-- Generated by xml_proto.php v2.0. Found in /scripts directory of phpdoc. -->
   <refentry id="function.xattr-remove">
    <refnamediv>
@@ -46,6 +46,24 @@
     <para>
      &return.success;
     </para>
+    <example>
+     <title><function>xattr_remove</function> example</title>
+     <para>
+      The following code removes all extended attributes of file.
+     </para>
+     <programlisting role="php">
+<![CDATA[
+<?php
+$file = 'some_file;
+$attributes = xattr_list($file);
+
+foreach ($attributes as $attr_name) {
+    xattr_remove($file, $attr_name);
+}
+?>
+]]>
+     </programlisting>
+    </example>
     <para>
      See also <function>xattr_get</function>, <function>xattr_set</function>, 
      <function>xattr_list</function>.

Reply via email to