cvs: peardoc /en/package/system windrives.xml /en/package/system/windrives constants.xml example.xml intro.xml
/en/package/system/windrives/windrives getdrivelist.xml getdrivename.xml getdrivesinformation.xml getdrivetype.xml getreadname.xml gettypetitle.xml
guessdrivelist.xml isapiavailable.xml setreadname.xml system_windrives.xml
| From: | Christian Weiske | Date: | Thu, 16 Feb 2006 15:05:24 +0000 |
| Subject: | cvs: peardoc /en/package/system windrives.xml /en/package/system/windrives constants.xml example.xml intro.xml /en/package/system/windrives/windrives getdrivelist.xml getdrivename.xml getdrivesinformation.xml getdrivetype.xml getreadname.xml gettypetitle.xml guessdrivelist.xml isapiavailable.xml setreadname.xml system_windrives.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-7533@lists.php.net to get a copy of this message | ||
cweiske Thu Feb 16 15:05:24 2006 UTC
Added files:
/peardoc/en/package/system windrives.xml
/peardoc/en/package/system/windrives constants.xml example.xml
intro.xml
/peardoc/en/package/system/windrives/windrives getdrivelist.xml
getdrivename.xml
getdrivesinformation.xml
getdrivetype.xml
getreadname.xml
gettypetitle.xml
guessdrivelist.xml
isapiavailable.xml
setreadname.xml
system_windrives.xml
Log:
System_WinDrives documentation
http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives.xml +++ peardoc/en/package/system/windrives.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="package.system.windrives"> <title>System_WinDrives</title> <para> Provides functions to enumerate root directories ("Drives") on Windows systems by using win32 api calls. </para> &package.system.windrives.intro; &package.system.windrives.example; &package.system.windrives.constants; &package.system.windrives.windrives.system-windrives; &package.system.windrives.windrives.getdrivelist; &package.system.windrives.windrives.getdrivename; &package.system.windrives.windrives.getdrivesinformation; &package.system.windrives.windrives.getdrivetype; &package.system.windrives.windrives.getreadname; &package.system.windrives.windrives.gettypetitle; &package.system.windrives.windrives.guessdrivelist; &package.system.windrives.windrives.isapiavailable; &package.system.windrives.windrives.setreadname; </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/constants.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/constants.xml +++ peardoc/en/package/system/windrives/constants.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.constants"> <refnamediv> <refname>Constants</refname> <refpurpose> Constants defined and used in System_WinDrives </refpurpose> </refnamediv> <refsect1 id="package.system.windrives.constants.details"> <title>All Constants</title> <para> <table> <title>Constants defined in System/WinDrives.php</title> <tgroup cols="3"> <thead> <row> <entry>Name</entry> <entry>Value</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>SYSTEM_WINDRIVE_ERROR</entry> <entry>1</entry> <entry>Drive type couldn't be determined</entry> </row> <row> <entry>SYSTEM_WINDRIVE_REMOVABLE</entry> <entry>2</entry> <entry>Removable (Floppy, ZIP)</entry> </row> <row> <entry>SYSTEM_WINDRIVE_FIXED</entry> <entry>3</entry> <entry>Harddisk</entry> </row> <row> <entry>SYSTEM_WINDRIVE_REMOTE</entry> <entry>4</entry> <entry>Network drive</entry> </row> <row> <entry>SYSTEM_WINDRIVE_CDROM</entry> <entry>5</entry> <entry>CD/DVD drive</entry> </row> <row> <entry>SYSTEM_WINDRIVE_RAMDISK</entry> <entry>6</entry> <entry>Virtual disk in the RAM</entry> </row> </tbody> </tgroup> </table> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/example.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/example.xml +++ peardoc/en/package/system/windrives/example.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.example"> <refnamediv> <refname>Example</refname> <refpurpose> How to use System_WinDrives </refpurpose> </refnamediv> <refsect1> <title>Using System_WinDrives</title> <example> <title>General usage</title> <programlisting role="php"> <![CDATA[ <?php require_once 'System/WinDrives.php'; //if you want to read the names, pass "true" as first parameter //this may crash your php.exe, so it's disabled by default $wd = new System_WinDrives(false); echo 'API available: '; echo $wd->isApiAvailable() ? 'yes' : 'no'; echo "\r\n"; $arInfo = $wd->getDrivesInformation(); foreach ($arInfo as $strDrive => $objInfo) { echo $strDrive . "\r\n"; echo ' Type: ' . $objInfo->type . "\r\n"; echo ' Type title: ' . $objInfo->typetitle . "\r\n"; echo ' Name: ' . $objInfo->name . "\r\n"; ?> ]]></programlisting> <para> At first, you need to instantitiate a new <classname>System_WinDrives</classname> object. You can pass "true" as parameter to enable hard disk names, but that can crash PHP and is disabled by default. </para> <para> The next thing to do is checking if the class can be used. That depends on the available extensions (win32api on PHP4, and php_ffi on PHP5). If the <literal>isApiAvailable</literal> method returns true, everything is ok. </para> <para> Now that everything is ok, you can read the driver information via <literal>getDrivesInformation</literal> and display the output. </para> <para> In case the API is not available, the method tries to guess the drive list by checking if the root directories exist. </para> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/intro.xml +++ peardoc/en/package/system/windrives/intro.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose> Enumerating drives on Windows systems </refpurpose> </refnamediv> <refsect1 id="package.system.windrives.intro.contrib"> <title>Contributors</title> <para> <itemizedlist> <listitem><simpara>Christian Weiske</simpara></listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.system.windrives.intro.desc"> <title>Description</title> <para> <classname>System_WinDrives</classname> uses win32 api calls to get a list of all installed roots ("Drives") on the current Windows operating system (The folders "A:\" until "Z:\"). </para> <para> Additional to the list of drives, detail information like the name and the drive type (network, harddisk, removable etc) is given. </para> <para> The win32 api functions are used to access the Windows application programming interface. This means that the extension <emphasis>php_w32api.dll</emphasis> on PHP4 and <emphasis>php_ffi.dll</emphasis> on PHP5 have to be installed to use all functions. If no dll is available, the drives are guessed, but drive types and drive names can't be determined. </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/getdrivelist.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/getdrivelist.xml +++ peardoc/en/package/system/windrives/windrives/getdrivelist.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.getdrivelist"> <refnamediv> <refname>System_WinDrives::getDriveList()</refname> <refpurpose>Gets array with path of all drives</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>array <function>System_WinDrives::getDriveList</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.getdrivelist.desc"> &title.desc; <para> Returns an array with all drive paths (e.g. <literal>A:\</literal>, <literal>C:\</literal>). </para> <para> If no API is available, the drive list is guessed. To get more data (like drive type and name), you should use <link linkend="package.system.windrives.windrives.getdrivesinformation"> <function>getDrivesInformation</function></link>. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivelist.return"> &title.returns; <para> &type.array; - array with all the drives </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivelist.example"> &title.example; <example> <title>Using <function>myFunction</function></title> <programlisting role="php"> <![CDATA[ <?php require_once 'System/WinDrives.php'; $swd = new System_WinDrives(); $arPaths = $swd->getDriveList(); foreach ($arPaths as $strPath) { echo $strPath . "\r\n";//echoes things like "A:\" and "C:\" } ?> ]]> </programlisting> <para> Output: </para> <screen> <![CDATA[ A:\ C:\ ]]> </screen> </example> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivelist.see"> &title.see; <para> <link linkend="package.system.windrives.windrives.isapiavailable"> <function>isApiAvailable</function></link> <link linkend="package.system.windrives.windrives.guessdrivelist"> <function>guessDriveList</function></link> <link linkend="package.system.windrives.windrives.getdrivesinformation"> <function>getDrivesInformation</function></link> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/getdrivename.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/getdrivename.xml +++ peardoc/en/package/system/windrives/windrives/getdrivename.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.getdrivename"> <refnamediv> <refname>System_WinDrives::getDriveName()</refname> <refpurpose>Returns the user-defined name for a drive</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>string <function>System_WinDrives::getDriveName</function></funcdef> <paramdef> string <parameter>$strDrive</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.getdrivename.desc"> &title.desc; <para> Returns the user-given name for the given drive. The function does not work on PHP5 and returns an empty string <literal>''</literal>. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivename.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$strDrive</parameter> </term> <listitem> <para> The drive path, whose name shall be read. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivename.return"> &title.returns; <para> &type.string; - The drive label </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivename.example"> &title.example; <example> <title>Using <function>myFunction</function></title> <programlisting role="php"> <![CDATA[ <?php require_once 'System/WinDrives.php'; $swd = new System_WinDrives(); echo $swd->getDriveName('C:\\'); ?> ]]> </programlisting> <para> Output: </para> <screen> <![CDATA[ Windrive ]]> </screen> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/getdrivesinformation.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/getdrivesinformation.xml +++ peardoc/en/package/system/windrives/windrives/getdrivesinformation.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.getdrivesinformation"> <refnamediv> <refname>System_WinDrives::getDrivesInformation()</refname> <refpurpose>Gets information about all drives</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>array <function>System_WinDrives::getDrivesInformation</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.getdrivesinformation.desc"> &title.desc; <para> Returns an array with all pieces of information one can get for the drives. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivesinformation.return"> &title.returns; <para> &type.array; - Array of little objects. Key is the drive path, the value is an object with the following values: <literal>type</literal>, <literal>name</literal> and <literal>typetitle</literal>. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivesinformation.example"> &title.example; <example> <title>Using <function>myFunction</function></title> <programlisting role="php"> <![CDATA[ <?php require_once 'System/WinDrives.php'; $swd = new System_WinDrives(); $arInfo = $swd->getDrivesInformation(); foreach ($arInfo as $strPath => $objInfo) { echo 'Drive ' . $strPath . "\r\n"; echo ' type: ' . $objInfo->type . '(' . $objInfo->typetitle . ")\r\n"; echo ' name: ' . $objInfo->name . "\r\n"; } ?> ]]> </programlisting> <para> Output: </para> <screen><![CDATA[ Drive A:\ 2 (Removable) diskette Drive C:\ 3 Harddisk Windisk]]> </screen> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/getdrivetype.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/getdrivetype.xml +++ peardoc/en/package/system/windrives/windrives/getdrivetype.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.getdrivetype"> <refnamediv> <refname>System_WinDrives::getDriveType()</refname> <refpurpose>Gets the type of a drive</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>int <function>System_WinDrives::getDriveType</function></funcdef> <paramdef> string <parameter>$strDrive</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.getdrivetype.desc"> &title.desc; <para> Returns the type of a drive. </para> <para> <table> <title>Return values</title> <tgroup cols="3"> <thead> <row> <entry>Value</entry> <entry>Constant</entry> <entry>Meaning</entry> </row> </thead> <tbody> <row> <entry>1</entry> <entry>SYSTEM_WINDRIVE_ERROR</entry> <entry>Non-existent drive or other error</entry> </row> <row> <entry>2</entry> <entry>SYSTEM_WINDRIVE_REMOVABLE</entry> <entry>Removable drive (e.g. floppy)</entry> </row> <row> <entry>3</entry> <entry>SYSTEM_WINDRIVE_FIXED</entry> <entry>Harddisk</entry> </row> <row> <entry>4</entry> <entry>SYSTEM_WINDRIVE_REMOTE</entry> <entry>Network share</entry> </row> <row> <entry>5</entry> <entry>SYSTEM_WINDRIVE_CDROM</entry> <entry>CD-Rom or DVD</entry> </row> <row> <entry>6</entry> <entry>SYSTEM_WINDRIVE_RAMDISK</entry> <entry>RAM disk</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivetype.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$strDrive</parameter> </term> <listitem> <para> The drive that type shall be returned. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivetype.return"> &title.returns; <para> &type.int; - the type (use the constants for comparison) </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivetype.see"> &title.see; <para> <link linkend="package.system.windrives.windrives.gettypetitle"> <function>getTypeTitle</function></link> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/getreadname.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/getreadname.xml +++ peardoc/en/package/system/windrives/windrives/getreadname.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.getreadname"> <refnamediv> <refname>System_WinDrives::getReadName()</refname> <refpurpose>Returns if drive names shall be read or not</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>boolean <function>System_WinDrives::getReadName</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.getreadname.desc"> &title.desc; <para> Returns of drive names should be read or not. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getreadname.return"> &title.returns; <para> &type.bool; - true if they shall be read, false if not. </para> </refsect1> <refsect1 id="packages.categorie.mypackage.myclass.getreadname.see"> &title.see; <para> <link linkend="package.system.windrives.windrives.setreadname"> <function>setReadName</function></link> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/gettypetitle.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/gettypetitle.xml +++ peardoc/en/package/system/windrives/windrives/gettypetitle.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.gettypetitle"> <refnamediv> <refname>System_WinDrives::getTypeTitle()</refname> <refpurpose>Gets the readable name to a drive type</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>string <function>System_WinDrives::getTypeTitle</function></funcdef> <paramdef> int <parameter>$nType</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.gettypetitle.desc"> &title.desc; <para> Gets the readable name to a drive type, e.g. "Harddisk" for the type <literal>3</literal> (<literal>SYSTEM_WINDRIVE_FIXED</literal>). </para> </refsect1> <refsect1 id="package.system.windrives.windrives.gettypetitle.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$nType</parameter> </term> <listitem> <para> The type whose name shall be returned </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.windrives.windrives.gettypetitle.return"> &title.returns; <para> &type.string; - the name for the type </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/guessdrivelist.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/guessdrivelist.xml +++ peardoc/en/package/system/windrives/windrives/guessdrivelist.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.guessdrivelist"> <refnamediv> <refname>System_WinDrives::guessDriveList()</refname> <refpurpose>Tries to guess the drive list</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>array <function>System_WinDrives::guessDriveList</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.guessdrivelist.desc"> &title.desc; <para> Tries to guess the drive list by brute-force checking all letters. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.guessdrivelist.return"> &title.returns; <para> &type.array; - Array with all found drive paths. </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/isapiavailable.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/isapiavailable.xml +++ peardoc/en/package/system/windrives/windrives/isapiavailable.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.isapiavailable"> <refnamediv> <refname>System_WinDrives::isApiAvailable()</refname> <refpurpose>Checks if the API is available</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>boolean <function>System_WinDrives::isApiAvailable</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.isapiavailable.desc"> &title.desc; <para> Checks if the API methods to read the drive list are available, and returns that. </para> <para> They may not be available if the necessary extensions (win32api on PHP4, php_ffi on PHP5) are not installed on the system. </para> <para> If the API is not available, the drive list is brute-force guessed. Drive types are not available in that case. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.isapiavailable.return"> &title.returns; <para> &type.bool; - true if they are there, false if not. </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/setreadname.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/setreadname.xml +++ peardoc/en/package/system/windrives/windrives/setreadname.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.setreadname"> <refnamediv> <refname>System_WinDrives::setReadName()</refname> <refpurpose>Sets the readName setting</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef><function>System_WinDrives::setReadName</function></funcdef> <paramdef> boolean <parameter>$bReadName</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.setreadname.desc"> &title.desc; <para> Set, if drive names shall be read or not. Drive name reading may crash PHP, so this is disabled by default. You can enable label reading with this method. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.myfunction.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.bool; <parameter>$bReadName</parameter> </term> <listitem> <para> If the names shall be read or not </para> </listitem> </varlistentry> </variablelist> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/system_windrives.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/system_windrives.xml +++ peardoc/en/package/system/windrives/windrives/system_windrives.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.system-windrives"> <refnamediv> <refname>System_WinDrives()</refname> <refpurpose>Outputs short description of the method</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>System_WinDrives <function>System_WinDrives</function></funcdef> <paramdef> boolean <parameter><optional>$bReadName = false</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.system-windrives.desc"> &title.desc; <para> Constructor. Creates a new <classname>System_WinDrives</classname> instance. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.system-windrives.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.bool; <parameter>$bReadName</parameter> </term> <listitem> <para> If the titles/names of drives shall be read. It is disabled by default, because it might cause PHP to crash. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="packages.categorie.mypackage.myclass.system-windrives.see"> &title.see; <para> <link linkend="package.system.windrives.windrives.setreadname"> <function>setReadName</function></link> </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 -->
http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives.xml +++ peardoc/en/package/system/windrives.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="package.system.windrives"> <title>System_WinDrives</title> <para> Provides functions to enumerate root directories ("Drives") on Windows systems by using win32 api calls. </para> &package.system.windrives.intro; &package.system.windrives.example; &package.system.windrives.constants; &package.system.windrives.windrives.system-windrives; &package.system.windrives.windrives.getdrivelist; &package.system.windrives.windrives.getdrivename; &package.system.windrives.windrives.getdrivesinformation; &package.system.windrives.windrives.getdrivetype; &package.system.windrives.windrives.getreadname; &package.system.windrives.windrives.gettypetitle; &package.system.windrives.windrives.guessdrivelist; &package.system.windrives.windrives.isapiavailable; &package.system.windrives.windrives.setreadname; </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/constants.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/constants.xml +++ peardoc/en/package/system/windrives/constants.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.constants"> <refnamediv> <refname>Constants</refname> <refpurpose> Constants defined and used in System_WinDrives </refpurpose> </refnamediv> <refsect1 id="package.system.windrives.constants.details"> <title>All Constants</title> <para> <table> <title>Constants defined in System/WinDrives.php</title> <tgroup cols="3"> <thead> <row> <entry>Name</entry> <entry>Value</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>SYSTEM_WINDRIVE_ERROR</entry> <entry>1</entry> <entry>Drive type couldn't be determined</entry> </row> <row> <entry>SYSTEM_WINDRIVE_REMOVABLE</entry> <entry>2</entry> <entry>Removable (Floppy, ZIP)</entry> </row> <row> <entry>SYSTEM_WINDRIVE_FIXED</entry> <entry>3</entry> <entry>Harddisk</entry> </row> <row> <entry>SYSTEM_WINDRIVE_REMOTE</entry> <entry>4</entry> <entry>Network drive</entry> </row> <row> <entry>SYSTEM_WINDRIVE_CDROM</entry> <entry>5</entry> <entry>CD/DVD drive</entry> </row> <row> <entry>SYSTEM_WINDRIVE_RAMDISK</entry> <entry>6</entry> <entry>Virtual disk in the RAM</entry> </row> </tbody> </tgroup> </table> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/example.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/example.xml +++ peardoc/en/package/system/windrives/example.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.example"> <refnamediv> <refname>Example</refname> <refpurpose> How to use System_WinDrives </refpurpose> </refnamediv> <refsect1> <title>Using System_WinDrives</title> <example> <title>General usage</title> <programlisting role="php"> <![CDATA[ <?php require_once 'System/WinDrives.php'; //if you want to read the names, pass "true" as first parameter //this may crash your php.exe, so it's disabled by default $wd = new System_WinDrives(false); echo 'API available: '; echo $wd->isApiAvailable() ? 'yes' : 'no'; echo "\r\n"; $arInfo = $wd->getDrivesInformation(); foreach ($arInfo as $strDrive => $objInfo) { echo $strDrive . "\r\n"; echo ' Type: ' . $objInfo->type . "\r\n"; echo ' Type title: ' . $objInfo->typetitle . "\r\n"; echo ' Name: ' . $objInfo->name . "\r\n"; ?> ]]></programlisting> <para> At first, you need to instantitiate a new <classname>System_WinDrives</classname> object. You can pass "true" as parameter to enable hard disk names, but that can crash PHP and is disabled by default. </para> <para> The next thing to do is checking if the class can be used. That depends on the available extensions (win32api on PHP4, and php_ffi on PHP5). If the <literal>isApiAvailable</literal> method returns true, everything is ok. </para> <para> Now that everything is ok, you can read the driver information via <literal>getDrivesInformation</literal> and display the output. </para> <para> In case the API is not available, the method tries to guess the drive list by checking if the root directories exist. </para> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/intro.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/intro.xml +++ peardoc/en/package/system/windrives/intro.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.intro"> <refnamediv> <refname>Introduction</refname> <refpurpose> Enumerating drives on Windows systems </refpurpose> </refnamediv> <refsect1 id="package.system.windrives.intro.contrib"> <title>Contributors</title> <para> <itemizedlist> <listitem><simpara>Christian Weiske</simpara></listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.system.windrives.intro.desc"> <title>Description</title> <para> <classname>System_WinDrives</classname> uses win32 api calls to get a list of all installed roots ("Drives") on the current Windows operating system (The folders "A:\" until "Z:\"). </para> <para> Additional to the list of drives, detail information like the name and the drive type (network, harddisk, removable etc) is given. </para> <para> The win32 api functions are used to access the Windows application programming interface. This means that the extension <emphasis>php_w32api.dll</emphasis> on PHP4 and <emphasis>php_ffi.dll</emphasis> on PHP5 have to be installed to use all functions. If no dll is available, the drives are guessed, but drive types and drive names can't be determined. </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/getdrivelist.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/getdrivelist.xml +++ peardoc/en/package/system/windrives/windrives/getdrivelist.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.getdrivelist"> <refnamediv> <refname>System_WinDrives::getDriveList()</refname> <refpurpose>Gets array with path of all drives</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>array <function>System_WinDrives::getDriveList</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.getdrivelist.desc"> &title.desc; <para> Returns an array with all drive paths (e.g. <literal>A:\</literal>, <literal>C:\</literal>). </para> <para> If no API is available, the drive list is guessed. To get more data (like drive type and name), you should use <link linkend="package.system.windrives.windrives.getdrivesinformation"> <function>getDrivesInformation</function></link>. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivelist.return"> &title.returns; <para> &type.array; - array with all the drives </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivelist.example"> &title.example; <example> <title>Using <function>myFunction</function></title> <programlisting role="php"> <![CDATA[ <?php require_once 'System/WinDrives.php'; $swd = new System_WinDrives(); $arPaths = $swd->getDriveList(); foreach ($arPaths as $strPath) { echo $strPath . "\r\n";//echoes things like "A:\" and "C:\" } ?> ]]> </programlisting> <para> Output: </para> <screen> <![CDATA[ A:\ C:\ ]]> </screen> </example> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivelist.see"> &title.see; <para> <link linkend="package.system.windrives.windrives.isapiavailable"> <function>isApiAvailable</function></link> <link linkend="package.system.windrives.windrives.guessdrivelist"> <function>guessDriveList</function></link> <link linkend="package.system.windrives.windrives.getdrivesinformation"> <function>getDrivesInformation</function></link> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/getdrivename.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/getdrivename.xml +++ peardoc/en/package/system/windrives/windrives/getdrivename.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.getdrivename"> <refnamediv> <refname>System_WinDrives::getDriveName()</refname> <refpurpose>Returns the user-defined name for a drive</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>string <function>System_WinDrives::getDriveName</function></funcdef> <paramdef> string <parameter>$strDrive</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.getdrivename.desc"> &title.desc; <para> Returns the user-given name for the given drive. The function does not work on PHP5 and returns an empty string <literal>''</literal>. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivename.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$strDrive</parameter> </term> <listitem> <para> The drive path, whose name shall be read. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivename.return"> &title.returns; <para> &type.string; - The drive label </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivename.example"> &title.example; <example> <title>Using <function>myFunction</function></title> <programlisting role="php"> <![CDATA[ <?php require_once 'System/WinDrives.php'; $swd = new System_WinDrives(); echo $swd->getDriveName('C:\\'); ?> ]]> </programlisting> <para> Output: </para> <screen> <![CDATA[ Windrive ]]> </screen> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/getdrivesinformation.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/getdrivesinformation.xml +++ peardoc/en/package/system/windrives/windrives/getdrivesinformation.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.getdrivesinformation"> <refnamediv> <refname>System_WinDrives::getDrivesInformation()</refname> <refpurpose>Gets information about all drives</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>array <function>System_WinDrives::getDrivesInformation</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.getdrivesinformation.desc"> &title.desc; <para> Returns an array with all pieces of information one can get for the drives. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivesinformation.return"> &title.returns; <para> &type.array; - Array of little objects. Key is the drive path, the value is an object with the following values: <literal>type</literal>, <literal>name</literal> and <literal>typetitle</literal>. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivesinformation.example"> &title.example; <example> <title>Using <function>myFunction</function></title> <programlisting role="php"> <![CDATA[ <?php require_once 'System/WinDrives.php'; $swd = new System_WinDrives(); $arInfo = $swd->getDrivesInformation(); foreach ($arInfo as $strPath => $objInfo) { echo 'Drive ' . $strPath . "\r\n"; echo ' type: ' . $objInfo->type . '(' . $objInfo->typetitle . ")\r\n"; echo ' name: ' . $objInfo->name . "\r\n"; } ?> ]]> </programlisting> <para> Output: </para> <screen><![CDATA[ Drive A:\ 2 (Removable) diskette Drive C:\ 3 Harddisk Windisk]]> </screen> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/getdrivetype.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/getdrivetype.xml +++ peardoc/en/package/system/windrives/windrives/getdrivetype.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.getdrivetype"> <refnamediv> <refname>System_WinDrives::getDriveType()</refname> <refpurpose>Gets the type of a drive</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>int <function>System_WinDrives::getDriveType</function></funcdef> <paramdef> string <parameter>$strDrive</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.getdrivetype.desc"> &title.desc; <para> Returns the type of a drive. </para> <para> <table> <title>Return values</title> <tgroup cols="3"> <thead> <row> <entry>Value</entry> <entry>Constant</entry> <entry>Meaning</entry> </row> </thead> <tbody> <row> <entry>1</entry> <entry>SYSTEM_WINDRIVE_ERROR</entry> <entry>Non-existent drive or other error</entry> </row> <row> <entry>2</entry> <entry>SYSTEM_WINDRIVE_REMOVABLE</entry> <entry>Removable drive (e.g. floppy)</entry> </row> <row> <entry>3</entry> <entry>SYSTEM_WINDRIVE_FIXED</entry> <entry>Harddisk</entry> </row> <row> <entry>4</entry> <entry>SYSTEM_WINDRIVE_REMOTE</entry> <entry>Network share</entry> </row> <row> <entry>5</entry> <entry>SYSTEM_WINDRIVE_CDROM</entry> <entry>CD-Rom or DVD</entry> </row> <row> <entry>6</entry> <entry>SYSTEM_WINDRIVE_RAMDISK</entry> <entry>RAM disk</entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivetype.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$strDrive</parameter> </term> <listitem> <para> The drive that type shall be returned. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivetype.return"> &title.returns; <para> &type.int; - the type (use the constants for comparison) </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getdrivetype.see"> &title.see; <para> <link linkend="package.system.windrives.windrives.gettypetitle"> <function>getTypeTitle</function></link> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/getreadname.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/getreadname.xml +++ peardoc/en/package/system/windrives/windrives/getreadname.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.getreadname"> <refnamediv> <refname>System_WinDrives::getReadName()</refname> <refpurpose>Returns if drive names shall be read or not</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>boolean <function>System_WinDrives::getReadName</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.getreadname.desc"> &title.desc; <para> Returns of drive names should be read or not. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.getreadname.return"> &title.returns; <para> &type.bool; - true if they shall be read, false if not. </para> </refsect1> <refsect1 id="packages.categorie.mypackage.myclass.getreadname.see"> &title.see; <para> <link linkend="package.system.windrives.windrives.setreadname"> <function>setReadName</function></link> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/gettypetitle.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/gettypetitle.xml +++ peardoc/en/package/system/windrives/windrives/gettypetitle.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.gettypetitle"> <refnamediv> <refname>System_WinDrives::getTypeTitle()</refname> <refpurpose>Gets the readable name to a drive type</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>string <function>System_WinDrives::getTypeTitle</function></funcdef> <paramdef> int <parameter>$nType</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.gettypetitle.desc"> &title.desc; <para> Gets the readable name to a drive type, e.g. "Harddisk" for the type <literal>3</literal> (<literal>SYSTEM_WINDRIVE_FIXED</literal>). </para> </refsect1> <refsect1 id="package.system.windrives.windrives.gettypetitle.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$nType</parameter> </term> <listitem> <para> The type whose name shall be returned </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.system.windrives.windrives.gettypetitle.return"> &title.returns; <para> &type.string; - the name for the type </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/guessdrivelist.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/guessdrivelist.xml +++ peardoc/en/package/system/windrives/windrives/guessdrivelist.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.guessdrivelist"> <refnamediv> <refname>System_WinDrives::guessDriveList()</refname> <refpurpose>Tries to guess the drive list</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>array <function>System_WinDrives::guessDriveList</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.guessdrivelist.desc"> &title.desc; <para> Tries to guess the drive list by brute-force checking all letters. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.guessdrivelist.return"> &title.returns; <para> &type.array; - Array with all found drive paths. </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/isapiavailable.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/isapiavailable.xml +++ peardoc/en/package/system/windrives/windrives/isapiavailable.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.isapiavailable"> <refnamediv> <refname>System_WinDrives::isApiAvailable()</refname> <refpurpose>Checks if the API is available</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>boolean <function>System_WinDrives::isApiAvailable</function></funcdef> <paramdef>void</paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.isapiavailable.desc"> &title.desc; <para> Checks if the API methods to read the drive list are available, and returns that. </para> <para> They may not be available if the necessary extensions (win32api on PHP4, php_ffi on PHP5) are not installed on the system. </para> <para> If the API is not available, the drive list is brute-force guessed. Drive types are not available in that case. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.isapiavailable.return"> &title.returns; <para> &type.bool; - true if they are there, false if not. </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/setreadname.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/setreadname.xml +++ peardoc/en/package/system/windrives/windrives/setreadname.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.setreadname"> <refnamediv> <refname>System_WinDrives::setReadName()</refname> <refpurpose>Sets the readName setting</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef><function>System_WinDrives::setReadName</function></funcdef> <paramdef> boolean <parameter>$bReadName</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.setreadname.desc"> &title.desc; <para> Set, if drive names shall be read or not. Drive name reading may crash PHP, so this is disabled by default. You can enable label reading with this method. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.myfunction.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.bool; <parameter>$bReadName</parameter> </term> <listitem> <para> If the names shall be read or not </para> </listitem> </varlistentry> </variablelist> </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 --> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/system/windrives/windrives/system_windrives.xml?view=markup&rev=1.1 Index: peardoc/en/package/system/windrives/windrives/system_windrives.xml +++ peardoc/en/package/system/windrives/windrives/system_windrives.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.system.windrives.windrives.system-windrives"> <refnamediv> <refname>System_WinDrives()</refname> <refpurpose>Outputs short description of the method</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'System/WinDrives.php'; </funcsynopsisinfo> <funcprototype> <funcdef>System_WinDrives <function>System_WinDrives</function></funcdef> <paramdef> boolean <parameter><optional>$bReadName = false</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.system.windrives.windrives.system-windrives.desc"> &title.desc; <para> Constructor. Creates a new <classname>System_WinDrives</classname> instance. </para> </refsect1> <refsect1 id="package.system.windrives.windrives.system-windrives.parameter"> &title.param; <para> <variablelist> <varlistentry> <term> &type.bool; <parameter>$bReadName</parameter> </term> <listitem> <para> If the titles/names of drives shall be read. It is disabled by default, because it might cause PHP to crash. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="packages.categorie.mypackage.myclass.system-windrives.see"> &title.see; <para> <link linkend="package.system.windrives.windrives.setreadname"> <function>setReadName</function></link> </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 -->