Handles typical client generation, override various methods for customisation 1.
copies the template. 2. looks for template directives in the code. Usually these directives indicate a block of code that must be replicated. Each directive starts with '/**ACG' and must end with * / note that services in subfolders should get a special treatment, and ideally code would be generated in them with additionnal sub-packages. This is technically too messy, so the '/' is simply replaced by '__'. This will be replaced by a '/' in Amfphp.
author | Ariel Sommeria-klein |
---|---|
package | Amfphp_Backoffice_Generators |
__construct(array $codeFileExtensions, \type $templateFolderUrl)
array
\type
generate(array $services, string $amfphpEntryPointUrl, String $targetFolder) : null
array
. note: here '/' in each service name is replaced by '__', to avoid dealing with packages
string
String
absolute url to folder where to put the generated code
null
getInfoUrl() : String
String
getTestUrlSuffix()
getUiCallText() : String
String
generateOneServiceFileCode(String $code) : String
String
String
generateServiceFiles(String $code, \SplFileInfo $file)
processMethodListBlock(\type $code)
applies processParameterListBlock to each of them then multiplies and adapts the resulting code for each method
\type
processParameterCommaListBlock(\type $code)
\type
processParameterListBlock(\type $code)
\type
processServiceListBlock(\type $code)
applies processMethodListBlock to each of them then multiplies and adapts the resulting code for each service
\type
processSourceFile(\SplFileInfo $file)
If the file is a service block(detected by having 'SERVICE' in the file name), call generateServiceFiles If not, look for block delimited by the 'SERVICE' directive and call processServiceListBlock on them Also sets the amfphp entry point url
\SplFileInfo
searchForBlocksAndApplyProcessing(String $code, String $directive, String $functionName) : \mixed.
String
the template code. Is modified continually
String
for example 'SERVICE'
String
functionName
\mixed.
if there was a change, returns the modified code, else returns false$targetFolder : string
$amfphpEntryPointUrl : string
$codeFileExtensions : array
for example array('as')
$fileBeingProcessed : \SplFileInfo
$methodBeingProcessed : \stdClass
untyped
see | \AmfphpDiscovery_MethodDescriptor |
---|
$serviceBeingProcessed : \stdClass
untyped
see | \AmfphpDiscovery_ServiceDescriptor |
---|
$services : array
$templateFolderUrl : string
METHOD
PARAMETER
PARAMETER_COMMA
SERVICE
_METHOD_
_PARAMETER_
_SERVICE_