PHP Class Phalcon\Build\Generator_File_PhalconC

Show file Open project: phalcon/cphalcon

Protected Properties

Property Type Description
$configDir string Directory with configuration files, used to setup process of generating phalcon.c
$outputFile string Path of generated phalcon.c file
$rootDir string Root directory of Phalcon
$skipFiles array List of files, which should not be included into generated phalcon.c
$sourceDir string Directory with Phalcon source code

Public Methods

Method Description
__construct ( string $rootDir, string $sourceDir, string $configDir, string $outputDir )
generate ( array $alreadyIncludedHeaders = [] ) Generate phalcon.h

Protected Methods

Method Description
addAllSourceFiles ( resource $fileHandler ) Recursively scan Phalcon sources and append content of all c-files to the generated file
addLicense ( resource $fileHandler ) Add license notice to the generated file
addPriorityFiles ( resource $fileHandler ) Add contents of the files, which must be put to the generated file before other source files
addStandardHeader ( resource $fileHandler ) Add manually-created header to the generated file
composeSkipFiles ( array $alreadyIncludedHeaders = [] ) Composes list of files, which should not be scanned and put into phalcon.c during recursive scan of the source directory
extractReferencedHeaders ( $files ) : array Scan files' content and extract referenced header files
getSortedSourceFilesToAppend ( string $path ) : array | boolean Recursively walk through source files and return them in a sorted order.
limitVisibilityOfPhalconFuncs ( ) Go through the generated file and put 'static' to all declarations of Phalcon-related functions

Private Methods

Method Description
appendSource ( $fileHandler, $path ) Appends the source to phalcon.c, removing some directives, external symbol declarations and excessive comments

Method Details

__construct() public method

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

addAllSourceFiles() protected method

Recursively scan Phalcon sources and append content of all c-files to the generated file
protected addAllSourceFiles ( resource $fileHandler )
$fileHandler resource

addLicense() protected method

Add license notice to the generated file
protected addLicense ( resource $fileHandler )
$fileHandler resource

addPriorityFiles() protected method

Add contents of the files, which must be put to the generated file before other source files
protected addPriorityFiles ( resource $fileHandler )
$fileHandler resource

addStandardHeader() protected method

Add manually-created header to the generated file
protected addStandardHeader ( resource $fileHandler )
$fileHandler resource

composeSkipFiles() protected method

Composes list of files, which should not be scanned and put into phalcon.c during recursive scan of the source directory
protected composeSkipFiles ( array $alreadyIncludedHeaders = [] )
$alreadyIncludedHeaders array

extractReferencedHeaders() protected method

Scan files' content and extract referenced header files
protected extractReferencedHeaders ( $files ) : array
return array

generate() public method

Generate phalcon.h
public generate ( array $alreadyIncludedHeaders = [] )
$alreadyIncludedHeaders array List of header files, which are already included in phalcon.h

getSortedSourceFilesToAppend() protected method

Excludes unrelated files and the ones, which were already included by an other procedure.
protected getSortedSourceFilesToAppend ( string $path ) : array | boolean
$path string
return array | boolean

limitVisibilityOfPhalconFuncs() protected method

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

Property Details

$configDir protected property

Directory with configuration files, used to setup process of generating phalcon.c
protected string $configDir
return string

$outputFile protected property

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

$rootDir protected property

Root directory of Phalcon
protected string $rootDir
return string

$skipFiles protected property

List of files, which should not be included into generated phalcon.c
protected array $skipFiles
return array

$sourceDir protected property

Directory with Phalcon source code
protected string $sourceDir
return string