Class RSDEngineFile

Description

Helper class for creating source files.

There are two ways of using this class. The first one is to extend it and to overwrite the methods getFilename, and getCode. This is recommendable if the file you want to create is rather complex. You would call the constructor with only one argument:


1 new RSDEngineFileChildClass($config);
The second way to use this class makes only sense if $config is not needed for creating your file. Call the constructor like this:

1 new RSDEngineClass(false, "myFilename.php", $fileCode);

Located in /code/framework/RSDEngine/RSDEngineFile.php (line 47)


	
			
Direct descendents
Class Description
RSDEngineControllerFile Helper class for creating template files.
RSDEngineDBApplicationConfigFile Generates the configuration file for database backended applications.
RSDEngineDBApplicationIndexFile Generates a file called index.php to be put in the code directory.
RSDEngineDBApplicationInitFile Generates the init file.
RSDEngineDBApplicationLogoutFile Generates a file called logout.php to be put in the code directory.
RSDEngineDBApplicationPrivateInitFile Generates the private init file.
RSDEngineDBApplicationPublicInitFile Generates the public init file.
RSDEngineTemplateFile Helper class for creating template files.
Variable Summary
String $code
Array $config
String $dir
String $filename
boolean $preventWriting
Method Summary
RSDEngineFile RSDEngineFile (Array &$config, [String $filename = false], [String $code = false])
String getCode ()
String getFilename ()
void setOutputDirectory (String $dir)
void setRelatedClasses (Array $classes)
void setRelatedFiles (Array $files)
void setRelatedFunctions (Array $functions)
void setWrite (String $write)
void writeToDirectory ([String $dir = false])
Variables
String $code = '' (line 62)

The code of the file to create. Gets set inside the constructor method.

Array $config = array() (line 52)

An associative array containing all configuration options. Gets set inside the constructor method.

String $dir = '' (line 68)

The directory to which to write the file.

String $filename = '' (line 57)

The name of the file to create. Gets set inside the constructor method.

boolean $overwriteExisting = true (line 100)

Whether to overwrite an existing file.


Redefined in descendants as:
boolean $preventWriting = false (line 105)

Whether to prevent writing this file.

Array $relatedClasses = array() (line 86)

An associative array containing related files. A class that extends RSDEngineFile and overwrites the method getCode might need this to communicate with other classes that are created. Gets set inside the method setRelatedClasses.

Array $relatedFiles = array() (line 77)

An associative array containing related files. A class that extends RSDEngineFile and overwrites the method getCode might need this to communicate with other files that are created. Gets set inside the method setRelatedFiles.

Array $relatedFunctions = array() (line 95)

An associative array containing related files. A class that extends RSDEngineFile and overwrites the method getCode might need this to communicate with other functions that are created. Gets set inside the method setRelatedFunctions.

Methods
Constructor RSDEngineFile (line 122)

Constructor that does the initialization.

RSDEngineFile RSDEngineFile (Array &$config, [String $filename = false], [String $code = false])
  • Array $config: An associative array containing all configuration options.
  • String $filename: The name of the file to create. Passing this argument makes only sense if the method getFilename does not get overwritten. This argument is optional. The default is false.
  • String $code: The code of the file to create. Passing this argument makes only sense if the method getCode does not get overwritten. This argument is optional. The default is false.
getCode (line 193)

Returns the code for this file.

String getCode ()

Redefined in descendants as:
getFilename (line 184)

Returns the filename.

String getFilename ()

Redefined in descendants as:
setOutputDirectory (line 174)

Sets the output direcotry.

$this->dir is set to the value passed as argument.

void setOutputDirectory (String $dir)
  • String $dir: The output directory.
setRelatedClasses (line 215)

Sets the related classes.

$this->relatedClasses is set to the array passed as argument.

void setRelatedClasses (Array $classes)
  • Array $classes: An associative array containing related classes.
setRelatedFiles (line 204)

Sets the related files.

$this->relatedFiles is set to the array passed as argument.

void setRelatedFiles (Array $files)
  • Array $files: An associative array containing related files.
setRelatedFunctions (line 226)

Sets the related functions.

$this->relatedFunctions is set to the array passed as argument.

void setRelatedFunctions (Array $functions)
  • Array $functions: An associative array containing related functions.
setWrite (line 234)

Sets the properties preventWriting and overwriteExisting based on the string passed as argument

void setWrite (String $write)
  • String $write: 'true', 'false' or 'overwrite.
writeToDirectory (line 139)

Writes the file to a directory.

If this method is called without arguments or $dir === false the file will be written to $this->dir. Otherwise the file will be written to the directory passed as argument.

void writeToDirectory ([String $dir = false])
  • String $dir: The directory to which to write the file. If this argument is false the file will be written to $this->dir. This argument is optional. The default is false.

Documentation generated on Mon, 8 Dec 2003 13:12:46 +0100 by phpDocumentor 1.2.3