Documentation

CRM_Core_CodeGen_Reflection extends CRM_Core_CodeGen_BaseTask
in package

Create classes which are used for schema introspection.

Table of Contents

Properties

$config  : CRM_Core_CodeGen_Main
$tables  : mixed

Methods

__construct()  : mixed
needsUpdate()  : bool
run()  : mixed
Run generator.
setConfig()  : mixed
TODO: this is the most rudimentary possible hack. CG config should eventually be made into a first-class object.
extractRegex()  : string|null
Extract a single regex from a file.
getAbsFileName()  : string
Get absolute file name.
isApproxPhpMatch()  : bool
Determine if two snippets of PHP code are approximately equivalent.

Properties

Methods

needsUpdate()

public needsUpdate() : bool
Return values
bool

TRUE if an update is needed.

setConfig()

TODO: this is the most rudimentary possible hack. CG config should eventually be made into a first-class object.

public setConfig(object $config) : mixed
Parameters
$config : object

extractRegex()

Extract a single regex from a file.

protected static extractRegex(string $file, string $regex) : string|null
Parameters
$file : string

File name

$regex : string

A pattern to match. Ex: "foo=([a-z]+)".

Return values
string|null

The value matched.

getAbsFileName()

Get absolute file name.

protected getAbsFileName() : string
Return values
string

isApproxPhpMatch()

Determine if two snippets of PHP code are approximately equivalent.

protected isApproxPhpMatch(mixed $actual, mixed $expected) : bool

This includes exceptions to equivalence for (a) whitespace and (b) the token "GenCodeChecksum".

This is useful for determining if someone has manually mucked with one the files. However, it's not perfect -- because whitespace changes are not detected. Hence, it's good to use in combination with another heuristic.

Parameters
$actual : mixed
$expected : mixed
Return values
bool

        
On this page

Search results