CodeGen_PECL
[ class tree: CodeGen_PECL ] [ index: CodeGen_PECL ] [ all elements ]

Class: CodeGen_PECL_Element_Function

Source Location: /CodeGen_PECL-1.1.3/PECL/Element/Function.php

Class Overview

CodeGen_Element
   |
   --CodeGen_PECL_Element
      |
      --CodeGen_PECL_Element_Function

Class describing a function within a PECL extension


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005-2008 Hartmut Holzgraefe

Variables

Methods


Child classes:

CodeGen_PECL_Element_Method
Class that describes a member function within a PHP class

Inherited Variables

Inherited Methods

Class: CodeGen_PECL_Element

CodeGen_PECL_Element::isKeyword()
Checks whether a string is a reserved name
CodeGen_PECL_Element::isType()
Checks whether a string is a valid PHP type name and returns the official name

Class Details

[line 43]
Class describing a function within a PECL extension


[ Top ]


Class Variables

$code =  ""

[line 733]

Code snippet
  • Access: protected

Type:   string


[ Top ]

$codeFile =  ""

[line 740]

Source file of code snippet
  • Access: protected

Type:   string


[ Top ]

$codeLine =  0

[line 747]

Source line of code snippet
  • Access: protected

Type:   int


[ Top ]

$description =  ""

[line 140]

A long description
  • Access: protected

Type:   string


[ Top ]

$hasRefArgs =  false

[line 261]

Does this function have by-reference parameters?
  • Access: protected

Type:   bool


[ Top ]

$name =  ""

[line 51]

The function name
  • Access: protected

Type:   string


[ Top ]

$params = array()

[line 254]

Function parameters (parsed from proto)
  • Access: protected

Type:   array


[ Top ]

$proto =  "void unknown(void)"

[line 240]

Function prototype
  • Access: protected

Type:   string


[ Top ]

$returns = array()

[line 247]

Function returntype (parsed from proto)
  • Access: protected

Type:   string


[ Top ]

$role =  "public"

[line 161]

Type of function: internal, public
  • Access: protected

Type:   string


[ Top ]

$summary =  ""

[line 119]

A short description
  • Access: protected

Type:   string


[ Top ]

$testCode =  "echo 'OK'; // no test case for this function yet"

[line 783]

test code snippet
  • Access: protected

Type:   string


[ Top ]

$testDescription =  ""

[line 840]

test code description
  • Access: protected

Type:   string


[ Top ]

$testIni =  ""

[line 897]

test additional ini condition
  • Access: protected

Type:   string


[ Top ]

$testResult = array()

[line 811]

expected test result string
  • Access: protected

Type:   array


[ Top ]

$testSkipIf =  ""

[line 868]

test additional skipif condition
  • Access: protected

Type:   string


[ Top ]

$varargs =  false

[line 204]

Function has variable arguments "..."
  • Access: protected

Type:   bool


[ Top ]

$varargsType =  "mixed"

[line 216]

  • Access: protected

Type:   mixed


[ Top ]



Method Detail

addParam   [line 1702]

void addParam( $param)


Parameters:

   $param     

[ Top ]

argInfoCode   [line 1607]

string argInfoCode( array $params)

Code needed ahead of the function table

Overridden in child classes as:

CodeGen_PECL_Element_Method::argInfoCode()
Code needed ahead of the method table

Parameters:

array   $params     

[ Top ]

argInfoName   [line 1681]

string argInfoName( )

Name for ARG_INFO definition

Overridden in child classes as:

CodeGen_PECL_Element_Method::argInfoName()
Name for ARG_INFO definition

[ Top ]

cCode   [line 1037]

string cCode( class $extension)

Create C code implementing the PHP userlevel function
  • Return: C code implementing the function

Overridden in child classes as:

CodeGen_PECL_Element_Method::cCode()
Create C code implementing the PHP userlevel function

Parameters:

class   $extension     Extension extension the function is part of

[ Top ]

cProto   [line 1573]

string cProto( )

C function signature
  • Return: C snippet

Overridden in child classes as:

CodeGen_PECL_Element_Method::cProto()
Create proto line for method

[ Top ]

createTest   [line 1528]

object generated createTest( CodeGen_PECL_Extension $extension)

Create test case for this function
  • Return: test case

Overridden in child classes as:

CodeGen_PECL_Element_Method::createTest()
Create test case for this function

Parameters:

object extension   $extension     the function is part of

[ Top ]

defaultval   [line 955]

string defaultval( string $param, string $default)

Helper for cCode
  • Return: default value

Parameters:

string   $param     Parameter spec. array
string   $default     default value for type

[ Top ]

docEntry   [line 1445]

string docEntry( string $base)

Create DocBook reference entry for the function
  • Return: DocBook XML code

Parameters:

string   $base     base (currently not used)

[ Top ]

functionEntry   [line 1691]

string functionEntry( )

Generate registration entry for extension function table

[ Top ]

getCode   [line 769]

string getCode( )

Code getter

[ Top ]

getFullName   [line 109]

string getFullName( )

distinguishable name getter

here it's just the same as the plain name but e.g. for class methods that wouldn't be enough


Overridden in child classes as:

CodeGen_PECL_Element_Method::getFullName()
distinguishable name getter

[ Top ]

getName   [line 95]

string getName( )

name getter

[ Top ]

getRole   [line 193]

void getRole( )


[ Top ]

getTestCode   [line 800]

string getTestCode( )

testCode getter

[ Top ]

getTestDescription   [line 857]

string getTestDescription( )

testDescription getter

[ Top ]

getTestIni   [line 914]

string getTestIni( )

testIni getter

[ Top ]

getTestResult   [line 829]

array getTestResult( )

testResult getter

[ Top ]

getTestSkipIf   [line 885]

string getTestSkipIf( )

testSkipIf getter

[ Top ]

getVarargs   [line 211]

void getVarargs( )


[ Top ]

hCode   [line 1584]

string hCode( class $extension)

Create C header entry for userlevel function
  • Return: C header code snippet

Parameters:

class   $extension     Extension extension the function is part of

[ Top ]

ifConditionEnd   [line 1750]

void ifConditionEnd( [ $extension = false])


Parameters:

   $extension     

[ Top ]

ifConditionStart   [line 1723]

void ifConditionStart( [ $extension = false])


Parameters:

   $extension     

[ Top ]

isInternalName   [line 933]

bool isInternalName( string $name)

Check whether a function name is already used internally
  • Return: true if function name is already used internally

Parameters:

string   $name     function name

[ Top ]

localVariables   [line 1004]

string localVariables( $extension)

Generate local variable declarations
  • Return: C code snippet

Overridden in child classes as:

CodeGen_PECL_Element_Method::localVariables()
Generate local variable declarations

Parameters:

   $extension     

[ Top ]

minPhpVersion   [line 1786]

string minPhpVersion( )

Return minimal PHP version required to support the requested features
  • Return: version string

[ Top ]

newSetProto   [line 316]

bool newSetProto( string $proto, object Extension $extension)

Set parameter and return value information from PHP style prototype
  • Return: Success status
  • Access: protected

Parameters:

string   $proto     PHP style prototype
object Extension   $extension     object owning this function

[ Top ]

newSetProto2   [line 295]

bool newSetProto2( string $proto, object Extension $extension)

Set parameter and return value information from PHP style prototype

new (and hopefully final) version using a PHP_LexerGenerator and PHP_ParserGenerator generated prototype parser

  • Return: Success status
  • Access: protected

Parameters:

string   $proto     PHP style prototype
object Extension   $extension     object owning this function

[ Top ]

oldSetProto   [line 588]

void oldSetProto( $proto)


Parameters:

   $proto     

[ Top ]

parseParameterHook   [line 975]

void parseParameterHook( string $argString, array $argPointers, int &$count)

Hook for parameter parsing API function
  • Access: protected

Overridden in child classes as:

CodeGen_PECL_Element_Method::parseParameterHook()
Hook for parameter parsing API function

Parameters:

string   $argString     Argument string
array   $argPointers     Argument variable pointers
int   &$count     Return value for number of arguments

[ Top ]

setCode   [line 756]

void setCode( string $code, [int $line = 0], [int $file = ""])

Code setter

Overridden in child classes as:

CodeGen_PECL_Element_Method::setCode()
Code addition must be validated here

Parameters:

string   $code     code snippet
int   $line     source line
int   $file     source filename

[ Top ]

setDescription   [line 147]

void setDescription( string $text)

description setter

Parameters:

string   $text     

[ Top ]

setName   [line 58]

void setName( string $name)

name setter

Overridden in child classes as:

CodeGen_PECL_Element_Method::setName()
Method name checking is less strict

Parameters:

string   $name     

[ Top ]

setProto   [line 270]

bool setProto( string $proto, object Extension $extension)

Set parameter and return value information from PHP style prototype
  • Return: Success status

Overridden in child classes as:

CodeGen_PECL_Element_Method::setProto()
Set parameter and return value information from PHP style prototype

Parameters:

string   $proto     PHP style prototype
object Extension   $extension     object owning this function

[ Top ]

setReturns   [line 1718]

void setReturns( $returns)


Parameters:

   $returns     

[ Top ]

setRole   [line 168]

void setRole( string $role)

role setter

Overridden in child classes as:

CodeGen_PECL_Element_Method::setRole()
The role attribute doesn't apply here

Parameters:

string   $role     

[ Top ]

setSummary   [line 126]

void setSummary( string $text)

summary getter

Parameters:

string   $text     

[ Top ]

setTestCode   [line 790]

void setTestCode( string $code)

testCode setter

Parameters:

string   $code     code snippet

[ Top ]

setTestDescription   [line 847]

void setTestDescription( string $text)

testDescritpion setter

Parameters:

string   $text     text

[ Top ]

setTestIni   [line 904]

void setTestIni( string $code)

testIni setter

Parameters:

string   $code     code snippet

[ Top ]

setTestResult   [line 819]

void setTestResult( string $text, [string $mode = "plain"])

testResult setter

Parameters:

string   $text     result text
string   $mode     test output comparison mode

[ Top ]

setTestSkipIf   [line 875]

void setTestSkipIf( string $code)

testSkipIf setter

Parameters:

string   $code     code snippet

[ Top ]

setVarargs   [line 206]

void setVarargs( $varargs)


Parameters:

   $varargs     

[ Top ]

setVarargsType   [line 218]

void setVarargsType( $type)


Parameters:

   $type     

[ Top ]

writeTest   [line 1513]

void writeTest( CodeGen_PECL_Extension $extension)

write test case for this function

Parameters:

class   $extension     Extension extension the function is part of

[ Top ]


Documentation generated on Mon, 27 Sep 2010 12:00:19 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.