System_Mount
[ class tree: System_Mount ] [ index: System_Mount ] [ all elements ]

Source for file example.php

Documentation is available at example.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2003 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 3.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available through the world-wide-web at the following url:           |
  11. // | http://www.php.net/license/3_0.txt.                                  |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Author: Ian Eure <ieure@php.net>                                     |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: example.php 304153 2010-10-06 12:14:29Z clockwerx $
  20.  
  21. require_once 'System/Mount.php';
  22.  
  23. // Create the mount class
  24. $m &new System_Mount();
  25.  
  26. // Get an object representing the CD-ROM entry
  27. $cdrom &$m->getEntryForPath('/cdrom');
  28.  
  29. if (PEAR::isError($cdrom)) {
  30.     die($cdrom->message."\n");
  31. }
  32.  
  33. // Mount it
  34. $res $cdrom->mount();
  35. if (PEAR::isError($res)) {
  36.     die($res->getMessage()."\n");
  37. }
  38.  
  39. // List it's contents
  40. print `ls {$cdrom->mountPoint}`;
  41.  
  42. // Unmount it
  43. $cdrom->unmount();
  44. if (PEAR::isError($res)) {
  45.     die($res->getMessage()."\n");
  46. }
  47.  
  48. ?>

Documentation generated on Mon, 11 Mar 2019 15:39:48 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.