Public Member Functions | |
| __construct ($strFileName, $strFileContent="", $boolRealFile=true) | |
| setFileName ($strFileName) | |
| getFileName () | |
| setFileContent ($strFileContent) | |
| getFileContent () | |
| getArrFileContent () | |
| getFileBit ($intLineStart, $intLineEnds) | |
| isRealFile () | |
Static Public Member Functions | |
| static | getCodeInstrFileName ($strFileName) |
Protected Attributes | |
| $strFileName | |
| $arrFileContent | |
| $boolRealFile | |
Static Protected Attributes | |
| static | $arrInstances = array() |
In this mode this class keep the alias fake name of the alias content and the file content, this information can be access by others classes what will be able to interaction with the fake file.
You can get a streck of code of the memory file or the real file using the same method send the first line and last line of the bit of code what you want to receive.
Definition at line 21 of file CodeReflectionFile.class.php.
| __construct | ( | $ | strFileName, | |
| $ | strFileContent = "", |
|||
| $ | boolRealFile = true | |||
| ) |
Create the Code Reflection File
CodeReflectionFile::setFileName( string )
CodeReflectionFile::setFileContent( string )
| string | $strFileName file name | |
| string | $strFileContent file content | |
| boolean | $boolRealFile if is a real file or not |
Definition at line 85 of file CodeReflectionFile.class.php.
References $boolRealFile, $strFileName, setFileContent(), and setFileName().
00086 { 00087 $this->setFileName( $strFileName); 00088 $this->setFileContent( $strFileContent ); 00089 $this->boolRealFile = (bool)$boolRealFile; 00090 self::$arrInstances[ $strFileName ] = $this; 00091 }
| getArrFileContent | ( | ) |
Get the array of lines with the code file content
Set the code file content and return itselft.
CodeReflectionFile::setFileContent( string )
Definition at line 158 of file CodeReflectionFile.class.php.
| static getCodeInstrFileName | ( | $ | strFileName | ) | [static] |
Get The File by Name
Search into all object files saved and return that one have the searched name
| string | $strFileName |
Definition at line 63 of file CodeReflectionFile.class.php.
References $strFileName.
Referenced by CodeReflectionFunction::createFunctionContentCode(), CodeReflectionMethod::createMethodContentCode(), and CodeInstrumentationMethod::createMethodContentCode().
00064 { 00065 if( array_key_exists( $strFileName , self::$arrInstances ) ) 00066 { 00067 return self::$arrInstances[ $strFileName ]; 00068 } 00069 else 00070 { 00071 return new CodeReflectionFile( $strFileName ); 00072 } 00073 }
| getFileBit | ( | $ | intLineStart, | |
| $ | intLineEnds | |||
| ) |
Get a slice, a streck, a bit of the content of the file receiving the first and last line of the slice wish.
CodeReflectionFile->arrFileContent
CodeReflectionFile->arrFileContent
| integer | $intLineStart first line of the content | |
| integer | $intLineEnds last line of the content |
Definition at line 174 of file CodeReflectionFile.class.php.
References CorujaArrayManipulation::getArrayField(), getFileName(), isRealFile(), and setFileContent().
00175 { 00176 $strFileBit = ""; 00177 00178 if( $this->isRealFile() ) 00179 { 00180 $this->setFileContent( $this->getFileName() ); 00181 } 00182 00183 for( $intLine = $intLineStart ; $intLine < $intLineEnds ; ++$intLine ) 00184 { 00185 $strFileBit .= CorujaArrayManipulation::getArrayField( $this->arrFileContent ,$intLine , "") . "\n"; 00186 } 00187 return $strFileBit; 00188 }
| getFileContent | ( | ) |
Get the file content
CodeReflectionFile::setFileContent( string )
Definition at line 142 of file CodeReflectionFile.class.php.
| getFileName | ( | ) |
Get the file name
CodeReflectionFile->strFileName
Definition at line 114 of file CodeReflectionFile.class.php.
Referenced by getFileBit().
| isRealFile | ( | ) |
Returns if the file it is a real file
true if is a real file false if not Definition at line 196 of file CodeReflectionFile.class.php.
Referenced by getFileBit().
| setFileContent | ( | $ | strFileContent | ) |
Set the code Reflection file content
Set the code Reflection file content and return itselft.
| string | $strFileContent file content |
Definition at line 129 of file CodeReflectionFile.class.php.
Referenced by __construct(), and getFileBit().
00130 { 00131 $this->arrFileContent = explode( "\n" , (string)$strFileContent ); 00132 return $this; 00133 }
| setFileName | ( | $ | strFileName | ) |
Set the file name
CodeReflectionFile->strFileName
| string | $strFileName file name |
Definition at line 101 of file CodeReflectionFile.class.php.
References $strFileName.
Referenced by __construct().
00102 { 00103 $this->strFileName = (string)$strFileName; 00104 return $this; 00105 }
$arrFileContent [protected] |
$arrInstances = array() [static, protected] |
array of all instances of CodeReflectionFile using the name as key
Definition at line 28 of file CodeReflectionFile.class.php.
$boolRealFile [protected] |
Flag if the file it is a real file true if is a real file false if is a not real file
boolean
Definition at line 51 of file CodeReflectionFile.class.php.
Referenced by __construct().
$strFileName [protected] |
File Name
string
Definition at line 35 of file CodeReflectionFile.class.php.
Referenced by __construct(), getCodeInstrFileName(), and setFileName().
1.5.9