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

Class: Dir

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

Class Dir

Class Overview

The Directory object.

Wrapper for the Directory functions

  1. Usage:
  2. $dir = new Dir($dir);
  3. $dir->open();
  4. $dir->doSomething();
  5. $dir->close();

Located in /myphp-1.9/myphp-1.9-file/html/util/Dir.php [line 35]



		
		
		
		

Properties

Methods

[ Top ]
Property Summary
String   $dir  
String   $dp  
String   $errorMsg  

[ Top ]
Method Summary
Dir   Dir()   Constructor
String   cd()   Change to the specified directory
void   close()   Close the directory
String   getCwd()   Get the current working directory
String   getErrorMsg()   Return the last error message
String   getUrl()   Get the URL extracted from the current working directory
String   ls()   List the directory
boolean,   mkdir()   Create a new directory
boolean   open()   Open the directory
String   read()   Read from the directory
boolean   rmdir()   Deletes a directory.

[ Top ]
Properties
String   $dir = '' [line 40]

[ Top ]
String   $dp = NULL [line 45]

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

[ Top ]
Methods
Constructor Dir  [line 56]

  Dir Dir( [String $dir = '']  )

Constructor

Parameters:
String   $dir:  A valid directory to open for read or write


[ Top ]
cd  [line 153]

  String cd( [String $dir = '']  )

Change to the specified directory

Parameters:
String   $dir:  Change to the specified directory

API Tags:
Return:  Returns true on success


[ Top ]
close  [line 221]

  void close( )

Close the directory



[ Top ]
getCwd  [line 167]

  String getCwd( )

Get the current working directory

  1. Usage:
  2. $me = Dir::getCwd() static, or
  3. $me = $dir->getCwd()
Get the CWD (Current Working Directory)


API Tags:
Return:  The name of the Current Working Directory


[ Top ]
getErrorMsg  [line 230]

  String getErrorMsg( )

Return the last error message


API Tags:
Return:  Returns message


[ Top ]
getUrl  [line 186]

  String getUrl( [String $path = '']  )

Get the URL extracted from the current working directory

  1. Usage:
  2. $theDir = new Dir();
  3. $href = $theDir->getUrl();
Get the url from the Current Working Directory

Parameters:
String   $path:  The path to use for the url calculation

API Tags:
Return:  The url extracted from the Current Working Directory


[ Top ]
ls  [line 128]

  String ls( )

List the directory


API Tags:
Return:  The list of the dir


[ Top ]
mkdir  [line 91]

  boolean, mkdir( String $dir, [String $mode = '']  )

Create a new directory

Parameters:
String   $dir:  A valid directory to open for read or write
String   $mode:  Access permissions, i.e. 0700

API Tags:
Return:  Returns true on success


[ Top ]
open  [line 64]

  boolean open( )

Open the directory


API Tags:
Return:  Returns true on success


[ Top ]
read  [line 144]

  String read( )

Read from the directory


API Tags:
Return:  Returns the name of next entry in the directory Returns false, if no more entries


[ Top ]
rmdir  [line 111]

  boolean rmdir( String $dir  )

Deletes a directory.

Note: The command will fail, if the directory is non-empty

Parameters:
String   $dir:  A valid directory to open for read or write

API Tags:
Return:  Returns true on success


[ Top ]

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