PHP Class Phalcon\Build\Generator_File_PhalconH

Datei anzeigen Open project: phalcon/cphalcon

Protected Properties

Property Type Description
$outputFile string Path of generated phalcon.h file
$sourceDir string Directory with Phalcon source code

Public Methods

Method Description
__construct ( string $sourceDir, string $outputDir )
generate ( ) : array Create phalcon.h by processing phalcon.h in sources directory: - Remove all extern declarations - Replace #include with the direct file content Return list of header files that are included in the generated phalcon.h

Protected Methods

Method Description
appendFileAndReferencedHeaders ( resource $fileHandle, string $filePath ) : array Add source of $filePath, processing its content.
cleanExtern ( string $line ) : string Remove 'extern ' declaration from the source file line
getCleanHeaderFileContent ( string $file ) : string Return content of the header file, where comments like license notices are removed and no 'extern's present.
limitVisibilityOfPhalconFuncs ( ) Go through the generated file and put 'static' to all declarations of Phalcon-related functions

Method Details

__construct() public method

public __construct ( string $sourceDir, string $outputDir )
$sourceDir string
$outputDir string

appendFileAndReferencedHeaders() protected method

Also includes content of files, referenced from $filePath.
protected appendFileAndReferencedHeaders ( resource $fileHandle, string $filePath ) : array
$fileHandle resource
$filePath string
return array

cleanExtern() protected method

Remove 'extern ' declaration from the source file line
protected cleanExtern ( string $line ) : string
$line string
return string

generate() public method

Create phalcon.h by processing phalcon.h in sources directory: - Remove all extern declarations - Replace #include with the direct file content Return list of header files that are included in the generated phalcon.h
public generate ( ) : array
return array

getCleanHeaderFileContent() protected method

Overall, removing comments is not necessary for putting result to a merged file, we just don't want to put license notices for every included file.
protected getCleanHeaderFileContent ( string $file ) : string
$file string
return string

limitVisibilityOfPhalconFuncs() protected method

Go through the generated file and put 'static' to all declarations of Phalcon-related functions

Property Details

$outputFile protected_oe property

Path of generated phalcon.h file
protected string $outputFile
return string

$sourceDir protected_oe property

Directory with Phalcon source code
protected string $sourceDir
return string