Overview

Namespaces

  • None
  • Peg
    • Cli
      • Commands
    • Config
    • Custom
      • Command
        • Action
          • Generate
          • Parse
      • CommandLine
      • Config
      • Localization
      • Utilities
    • Lib
      • Definitions
        • Element
      • Generator
      • Lexers
      • Plugins
      • Signals
        • Data
          • Definitions
          • Lexers
        • Type
  • PHP

Classes

  • Base
  • ZendPHP
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo

Class ZendPHP

Class that implements a zend extension generator.

Peg\Lib\Generator\Base
Extended by Peg\Lib\Generator\ZendPHP
Namespace: Peg\Lib\Generator
Located at src/Generator/ZendPHP.php
Methods summary
public
# __construct( string $templates, string $output, Peg\Lib\Definitions\Symbols & $symbols )

The symbols object with all definitions required to generate the code.

The symbols object with all definitions required to generate the code.

Parameters

$templates
string
$templates Path where template files reside.
$output
string
$output Path where the generated source code is going to be saved.
$symbols
string
$generator_name Name of the generator being instantiated. Should be all lower case.

Overrides

Peg\Lib\Generator\Base::__construct()
public
# Start( )

Generate all the files that needed to build a zend php extension.

Generate all the files that needed to build a zend php extension.

public string
# GenerateHeader( string $header_name )

Generates a specific header file.

Generates a specific header file.

Parameters

$header_name
string
$header_name

Returns

string
Source code.
public string
# GenerateClassesHeader( string $header_name )

Generates a specific header file for classes.

Generates a specific header file for classes.

Parameters

$header_name
string
$header_name

Returns

string
Source code.
public string
# GenerateSource( string $header_name )

Generates a specific header source file.

Generates a specific header source file.

Parameters

$header_name
string
$header_name

Returns

string
Source code.
public string
# GenerateFunction( Peg\Lib\Definitions\Element\FunctionElement $function_object )

Generates the PHP wrapping code from a C/C++ function.

Generates the PHP wrapping code from a C/C++ function.

Parameters

$function_object
Peg\Lib\Definitions\Element\FunctionElement
$function_object

Returns

string
PHP C/C++ code.
public
# GenerateArgInfo( Peg\Lib\Definitions\Element\FunctionElement $function_object )

Generates an arginfo php C structure which is basically used for reflection to work properly.

Generates an arginfo php C structure which is basically used for reflection to work properly.

Parameters

$function_object
Peg\Lib\Definitions\Element\FunctionElement
$function_object
public
# GenerateOtherSources( )

Generates other sources required to build the extension, eg: php_extension.h, extension.c

Generates other sources required to build the extension, eg: php_extension.h, extension.c

public
# GenerateConfigs( )

Generates config.m4 and config.w32.

Generates config.m4 and config.w32.

public
# GenerateCustomSources( )

Generates sources from the custom_sources templates directory.

Generates sources from the custom_sources templates directory.

public string
# GetProtoHeader( Peg\Lib\Definitions\Element\FunctionElement $function )

Generates proto doc comments header for a function.

Generates proto doc comments header for a function.

Parameters

$function
Peg\Lib\Definitions\Element\FunctionElement
$function

Returns

string
public string
# GetProtoFooter( )

Generates proto doc comments footer.

Generates proto doc comments footer.

Returns

string
public string
# GetRegisterConstantTemplate( string $name, string $namespace = "", mixed $type = "" )

Retrieve the template path for registering constants, also checks if a valid override exists and returns that instead.

Retrieve the template path for registering constants, also checks if a valid override exists and returns that instead.

Parameters

$name
string
$name Name of constant.
$namespace
string
$namespace Namespace where resides the constant.
$type

Returns

string
Path to template file.

Todo

Improve this to handle various types.
public string
# GetRegisterVarConstantTemplate( Peg\Lib\Definitions\Element\GlobalVariable $variable, string $namespace = "" )

Retrieve the template path for registering constants registered as global variables, also checks if a valid override exists and returns that instead.

Retrieve the template path for registering constants registered as global variables, also checks if a valid override exists and returns that instead.

Parameters

$variable
Peg\Lib\Definitions\Element\GlobalVariable
$variable
$namespace
string
$namespace Namespace where resides the constant.

Returns

string
Path to template file.
Methods inherited from Peg\Lib\Generator\Base
AddGenericFile(), AddHeader(), AddSource(), GetCustomSources(), GetGenericTemplate(), GetHeaderDefine(), GetHeaderNamePHP(), GetParameterTemplate(), GetReturnTemplate(), GetSourceNamePHP(), GetTemplatePath(), Indent(), RemoveHeader()
Properties inherited from Peg\Lib\Generator\Base
$generator_name, $output_path, $symbols, $templates_path
PEG Api API documentation generated by ApiGen 2.8.0