cvs: peardoc /peardoc2/en/core/pear system.xml /peardoc2/en/core/pear/system cat.xml intro.xml mkdir.xml mktemp.xml rm.xml tmpdir.xml which.xml

From: Date: Fri, 03 Jan 2003 03:24:23 +0000
Subject: cvs: peardoc /peardoc2/en/core/pear system.xml /peardoc2/en/core/pear/system cat.xml intro.xml mkdir.xml mktemp.xml rm.xml tmpdir.xml which.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-184@lists.php.net to get a copy of this message
alexmerz Thu Jan 2 22:24:23 2003 EDT Added files: /peardoc/peardoc2/en/core/pear system.xml /peardoc/peardoc2/en/core/pear/system cat.xml intro.xml mkdir.xml mktemp.xml rm.xml tmpdir.xml which.xml Log: Add System

Index: peardoc/peardoc2/en/core/pear/system.xml +++ peardoc/peardoc2/en/core/pear/system.xml <!-- $Revision: 1.1 $ --> <sect1 id="core.pear.system"> <title>System</title> <para> Commandline functions </para> <para> <classname>System</classname> provides an API for crossplattform compatible commandline programs </para> &core.pear.system.intro; &core.pear.system.rm; &core.pear.system.mkdir; &core.pear.system.cat; &core.pear.system.mktemp; &core.pear.system.tmpdir; &core.pear.system.which; </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/peardoc2/en/core/pear/system/cat.xml +++ peardoc/peardoc2/en/core/pear/system/cat.xml <!-- $Revision: 1.1 $ --> <refentry id="core.pear.system.cat"> <refnamediv> <refname>System::&amp;cat</refname> <refpurpose>concatenate files</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "System.php"; </funcsynopsisinfo> <funcprototype> <funcdef>boolean <function>System::&amp;cat</function></funcdef> <paramdef> string <parameter>$args</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.pear.system.cat.desc"> &title.desc; <para> Concatenate files. The method uses <function>fopen</function>, URLs should work too. </para> </refsect1> <refsect1 id="core.pear.system.cat.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $args</parameter> - the arguments </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="core.pear.system.cat.return"> &title.returns; <para> <parameter>boolean</parameter> - true on success </para> </refsect1> <refsect1 id="core.pear.system.cat.note"> &title.note; &note.canstatic; <simpara></simpara> </refsect1> <refsect1 id="core.pear.system.cat.see"> &title.see; <para> <ulink url="http://unixhelp.ed.ac.uk/CGI/man-cgi?cat"><command>cat</command> man page</ulink> </para> </refsect1> <refsect1 id="core.pear.system.cat.example"> &title.example; <example> <title>Using <function>&amp;cat</function></title> <programlisting role="php"> <![CDATA[ $var = System::cat('sample.txt test.txt'); System::cat('sample.txt test.txt > final.txt'); System::cat('sample.txt test.txt >> final.txt'); ]]> </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/peardoc2/en/core/pear/system/intro.xml +++ peardoc/peardoc2/en/core/pear/system/intro.xml <!-- $Revision: 1.1 $ --> <refentry id="core.pear.system.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose>Gneral usage informations</refpurpose> </refnamediv> <refsect1 id="core.pear.system.intro.clistyle"> <title>Command line style</title> <para> The <classname>System</classname> functions are called like there commandline pendants <programlisting role="php"> <![CDATA[ if (!System::rm('-r file1 dir1')) { print "Could not delete all the files"; } ]]> </programlisting> The arguments of the functions can be introduced as string or array: <programlisting role="php"> System::rm(array('-r', 'file1', 'dir1')); </programlisting> System works like any other PHP function and will return <parameter>FALSE</parameter>, when the operation could no be completed enterely or partially. System won't stop when a error is found, it will try to continue. For example, if you are trying to delete three files and the first one can't be deleted, the next two files will be deleted but the function will return <parameter>FALSE</parameter>. </para> <para> Errors will be printed out using the PHP function <function>trigger_error()</function> so all the System methods can be silenced prefix a '@' sign before the function call (for example: <command>@System::mkdir('-p dir1/dir2/dir3');</command>). </para> </refsect1> <refsect1 id="core.pear.system.intro.compatibility"> <title>Compatiblity</title> <para> <classname>System</classname> provides file system functions. They are named like the file system commands on Unix systems and supports the same options <emphasis>independent</emphasis> of your operation system. </para> <para> At the moment the functions are tested under Linux and Windows. Further reports about compatibility on other systems are welcome. </para> <warning> <para> In earlier versions of PHP 4, <function>unlink</function> may fail on Windows. This bug is already fixed in up-to-date versions. </para> </warning> </refsect1> <refsect1 id="core.pear.system.intro.manpages"> <title>Man Pages</title> <para> This manual describes the parameters of the <classname>System</classname> functions, most only a string. The arguments and options of the specific command are <emphasis>not</emphasis> documented in the manual. Please take a look on the man-pages on unix-like systems <programlisting> <command>man</command> <parameter>commandname</parameter> </programlisting> or when man-pages not avaible on your system, visit the <ulink url="http://unixhelp.ed.ac.uk/alphabetical/index.html"> On-line UNIX manual pages</ulink> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/peardoc2/en/core/pear/system/mkdir.xml +++ peardoc/peardoc2/en/core/pear/system/mkdir.xml <!-- $Revision: 1.1 $ --> <refentry id="core.pear.system.mkdir"> <refnamediv> <refname>System::mkDir</refname> <refpurpose>create directories</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "System.php"; </funcsynopsisinfo> <funcprototype> <funcdef>bool <function>System::mkDir</function></funcdef> <paramdef> string <parameter>$args</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.pear.system.mkdir.desc"> &title.desc; <para> Creates directories. </para> </refsect1> <refsect1 id="core.pear.system.mkdir.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $args</parameter> - the name of the directory/-ies to create </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="core.pear.system.mkdir.return"> &title.returns; <para> <parameter>bool</parameter> - true for success </para> </refsect1> <refsect1 id="core.pear.system.mkdir.note"> &title.note; &note.canstatic; <simpara></simpara> </refsect1> <refsect1 id="core.pear.system.mkdir.see"> &title.see; <para> <ulink url="http://unixhelp.ed.ac.uk/CGI/man-cgi?mkdir"><command>mkdir</command> man page</ulink> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/peardoc2/en/core/pear/system/mktemp.xml +++ peardoc/peardoc2/en/core/pear/system/mktemp.xml <!-- $Revision: 1.1 $ --> <refentry id="core.pear.system.mktemp"> <refnamediv> <refname>System::mktemp</refname> <refpurpose>Create temporary files or directories</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "System.php"; </funcsynopsisinfo> <funcprototype> <funcdef>mixed <function>System::mktemp</function></funcdef> <paramdef> string <parameter><optional>$args=null</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.pear.system.mktemp.desc"> &title.desc; <para> Creates temporary files or directories. This function will remove the created files when the scripts finish its execution. </para> </refsect1> <refsect1 id="core.pear.system.mktemp.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $args</parameter> - The arguments <itemizedlist> <listitem> <para> <parameter>prefix</parameter> - The string that will be prepended to the temp name (defaults to <parameter>tmp</parameter>) </para> </listitem> <listitem> <para> <parameter>-d</parameter> - A temporary dir will be created instead of a file. </para> </listitem> <listitem> <para> <parameter>-t</parameter> - The target dir where the temporary file or directory will be created. If this parameter is missing, by default the enviroment vars <parameter>TMP</parameter> on Windows or <parameter>TMPDIR</parameter> on Unix will be used. If these vars are also missing <parameter>c:\windows\temp</parameter> or <parameter>/tmp</parameter> will be used. </para> </listitem> </itemizedlist> </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="core.pear.system.mktemp.return"> &title.returns; <para> <parameter>mixed</parameter> - the full path of the created file or dir, or false </para> </refsect1> <refsect1 id="core.pear.system.mktemp.note"> &title.note; &note.canstatic; <simpara></simpara> </refsect1> <refsect1 id="core.pear.system.mktemp.see"> &title.see; <para> <ulink url="http://unixhelp.ed.ac.uk/CGI/man-cgi?mktemp"><command>mktemp</command> man page</ulink> </para> </refsect1> <refsect1 id="core.pear.system.mktemp.example"> &title.example; <example> <title>Using <function>mktemp</function></title> <programlisting role="php"> <![CDATA[ $tempfile = System::mktemp("prefix"); $tempdir = System::mktemp("-d prefix"); $tempfile = System::mktemp(); $tempfile = System::mktemp("-t /var/tmp prefix"); ]]> </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/peardoc2/en/core/pear/system/rm.xml +++ peardoc/peardoc2/en/core/pear/system/rm.xml <!-- $Revision: 1.1 $ --> <refentry id="core.pear.system.rm"> <refnamediv> <refname>System::rm</refname> <refpurpose>remove files</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "System.php"; </funcsynopsisinfo> <funcprototype> <funcdef>mixed <function>System::rm</function></funcdef> <paramdef> string <parameter>$args</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.pear.system.rm.desc"> &title.desc; <para> The rm command for removing files. Supports multiple files and dirs and also recursive deletes. </para> </refsect1> <refsect1 id="core.pear.system.rm.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $args</parameter> - the arguments for rm </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="core.pear.system.rm.return"> &title.returns; <para> <parameter>mixed</parameter> - true for success </para> </refsect1> <refsect1 id="core.pear.system.rm.note"> &title.note; &note.canstatic; <simpara></simpara> </refsect1> <refsect1 id="core.pear.system.rm.see"> &title.see; <para> <ulink url="http://unixhelp.ed.ac.uk/CGI/man-cgi?rm"><command>rm</command> man page</ulink> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/peardoc2/en/core/pear/system/tmpdir.xml +++ peardoc/peardoc2/en/core/pear/system/tmpdir.xml <!-- $Revision: 1.1 $ --> <refentry id="core.pear.system.tmpdir"> <refnamediv> <refname>System::tmpdir</refname> <refpurpose>Get path of temporal directory</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "System.php"; </funcsynopsisinfo> <funcprototype> <funcdef>string <function>System::tmpdir</function></funcdef> <paramdef></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.pear.system.tmpdir.desc"> &title.desc; <para> Get the path of the temporal directory set in the system by looking in its environments variables. </para> </refsect1> <refsect1 id="core.pear.system.tmpdir.return"> &title.returns; <para> <parameter>string</parameter> - The temporal directory on the system </para> </refsect1> <refsect1 id="core.pear.system.tmpdir.note"> &title.note; &note.canstatic; <para> php.ini-recommended removes the <parameter>E</parameter> from the variables_order setting, making unavaible the $_ENV array </para> </refsect1> <refsect1 id="core.pear.system.tmpdir.see"> &title.see; <para> <ulink url="http://unixhelp.ed.ac.uk/CGI/man-cgi?tmpdir"><command>tmpdir</command> man page</ulink> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/peardoc2/en/core/pear/system/which.xml +++ peardoc/peardoc2/en/core/pear/system/which.xml <!-- $Revision: 1.1 $ --> <refentry id="core.pear.system.system.which"> <refnamediv> <refname>System::which</refname> <refpurpose>show full path of a command</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once "System.php"; </funcsynopsisinfo> <funcprototype> <funcdef>mixed <function>System::which</function></funcdef> <paramdef> string <parameter>$program</parameter> </paramdef> <paramdef> boolean <parameter><optional>$fallback=false</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="core.pear.system.system.which.desc"> &title.desc; <para> The command shows the full path of a command. </para> </refsect1> <refsect1 id="core.pear.system.system.which.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>string $program</parameter> - the command to search for </para> </listitem> <listitem> <para> <parameter>boolean $fallback</parameter> - value to return in case of program not found </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="core.pear.system.system.which.return"> &title.returns; <para> <parameter>mixed</parameter> - A string with the full path or false if not found </para> </refsect1> <refsect1 id="core.pear.system.system.which.note"> &title.note; &note.canstatic; <simpara></simpara> </refsect1> <refsect1 id="core.pear.system.which.see"> &title.see; <para> <ulink url="http://unixhelp.ed.ac.uk/CGI/man-cgi?which"><command>which</command> man page</ulink> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.pear.doc (#184) next »