phpDocumentor file
[ class tree: file ] [ index: file ] [ all elements ]

Class: File

Source Location: /myphp-1.9/myphp-1.9-file/html/util/File.php

Class File

Class Overview

Wrapper for the file functions, until file_getContents(...) is implemented in PHP

  1. Usage:
  2. $file = new File('my.sql');
  3. print $file->getContent();

Located in /myphp-1.9/myphp-1.9-file/html/util/File.php [line 32]



		
		
		
		

Properties

Methods

[ Top ]
Property Summary
String   $access  
String   $errorMsg  
String   $file  
String   $fp  

[ Top ]
Method Summary
File   File()   Constructor
boolean   append()   Append the content to the file opened by fp
boolean   close()   Close the file opened by fp
String   getContent()   Reads the content of the specified file as a string
boolean   open()   Open the file
boolean   save()   Save the content to the file opened by fp
boolean   write()   Write the line to the file opened by fp

[ Top ]
Properties
String   $access = '' [line 42]

[ Top ]
String   $errorMsg = '' [line 52]

[ Top ]
String   $file = '' [line 37]

[ Top ]
String   $fp = NULL [line 47]

[ Top ]
Methods
Constructor File  [line 66]

  File File( String $file, [String $access = '']  )

Constructor

Parameters:
String   $file:  A valid filename to open and read or write
String   $access:  Access Modifier
  • r open a file for reading only
  • r+ open file for reading/writing
  • w open a file for writing only. Truncate to zero length.
  • w+ open the file for reading /writing. Truncated to zero length.
  • a open a file for appending data
  • a+ open the file for appending and reading data
  • b open the file as binary read/write


[ Top ]
append  [line 167]

  boolean append( String $content  )

Append the content to the file opened by fp

Parameters:
String   $content:  The content to append

API Tags:
Return:  Returns true on success


[ Top ]
close  [line 113]

  boolean close( )

Close the file opened by fp


API Tags:
Return:  Returns true on success


[ Top ]
getContent  [line 99]

  String getContent( )

Reads the content of the specified file as a string


API Tags:
Return:  Returns the content of the file


[ Top ]
open  [line 75]

  boolean open( )

Open the file


API Tags:
Return:  Returns true on success


[ Top ]
save  [line 146]

  boolean save( String $content  )

Save the content to the file opened by fp

Parameters:
String   $content:  The content to write

API Tags:
Return:  Returns true on success


[ Top ]
write  [line 130]

  boolean write( String $line  )

Write the line to the file opened by fp

Parameters:
String   $line:  The line to write

API Tags:
Return:  Returns true on success


[ Top ]

Documentation generated on Thu, 22 Dec 2005 17:08:06 +0100 by phpDocumentor 1.3.0RC3