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

Class: File_Fstab

Source Location: /File_Fstab-2.0.3/File/Fstab.php

Class Overview


Class to read, write, and manipulate fstab files


Author(s):

Version:

  • CVS: $Revision: 304144 $

Copyright:

  • (c) 2004, 2005 Ian Eure

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 47]
Class to read, write, and manipulate fstab files


[ Top ]


Class Variables

$entries = array()

[line 53]

Array of fstab entries

Type:   array


[ Top ]

$options = array()

[line 60]

Class options.

Type:   array


[ Top ]



Method Detail

File_Fstab (Constructor)   [line 88]

void File_Fstab( [array $options = false])

Constructor

Parameters:

array   $options     Associative array of options to set

[ Top ]

addEntry   [line 236]

mixed addEntry( &$entry, object $entry)

Add a new entry
  • Return: boolean true on success, PEAR_Error otherwise.

Parameters:

object   $entry     Reference to a File_Fstab_Entry-derived class
   &$entry     

[ Top ]

getEntryForDevice   [line 182]

mixed &getEntryForDevice( string $blockdev)

Get a File_Fstab_Entry object for a block device
  • Return: File_Fstab_Entry instance on success, PEAR_Error otherwise

Parameters:

string   $blockdev     Block device

[ Top ]

getEntryForLabel   [line 218]

mixed &getEntryForLabel( string $label)

Get a File_Fstab_Entry object for a label
  • Return: File_Fstab_Entry instance on success, PEAR_Error otherwise

Parameters:

string   $label     Label

[ Top ]

getEntryForPath   [line 165]

mixed &getEntryForPath( string $path)

Get a File_Fstab_Entry object for a path
  • Return: File_Fstab_Entry instance on success, PEAR_Error otherwise

Parameters:

string   $path     Mount point

[ Top ]

getEntryForUUID   [line 200]

mixed &getEntryForUUID( string $uuid)

Get a File_Fstab_Entry object for a UUID
  • Return: File_Fstab_Entry instance on success, PEAR_Error otherwise

Parameters:

string   $uuid     UUID device

[ Top ]

load   [line 122]

void load( )

Parse fstab file
  • Since: 1.0.1

[ Top ]

save   [line 285]

mixed save( [ $output = false])

Write out a modified fstab

WARNING: This will strip comments and blank lines from the original fstab.

  • Return: true on success, PEAR_Error on failure
  • Since: 1.0.1

Parameters:

   $output     

[ Top ]

setOptions   [line 268]

void setOptions( [array $options = false])

Set class options

The allowed options are:

  • entryClass Class to use for entries in the fstab. Defaults to File_Fstab_Entry. you can use this to provide your own entry class with added functionality. This class must extend File_Fstab_Entry.
  • file File to parse. Defaults to /etc/fstab.
  • fieldSeparator Separator for fields. This only affects the output when you call save(). This text is placed in between the elements of the fstab entry line.


Parameters:

array   $options     Associative array of options to set

[ Top ]

singleton   [line 102]

object File_Fstab &singleton( string $fstab)

Return a single instance to handle a fstab file
  • Return: instance

Parameters:

string   $fstab     Path to the fstab file

[ Top ]

update   [line 153]

void update( )

Update entries

This will dump all the entries and re-parse the fstab. There's probably a better way of doing this, like forcing the extant entries to re-parse, and adding/removing entries as needed, but I don't feel like doing that right now.


[ Top ]


Documentation generated on Wed, 06 Oct 2010 12:30:03 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.