|
|
Nombre de visites : 21 Mise en ligne : 05/2008 Dernière modif : 06/2008 Main Sequenceindex.phpA documentation run starts in index.phpindex.php contains 2 parts :
- A part to list the available user commands, corresponding to .ini files located under phpsimpledoc/user directory.
This part is used only if phpSimpleDoc is called from the web interface, without GET or POST. - A part to order documentation generation This part is used when phpSimpleDoc is called from the web interface or from the command line. This part is activated when index.php is called : - with a GET or POST 'command' variable (when called from web interface). - with a parameter (when called from command line). Main sequenceDocumentation generation involves the following steps :
![]() This corresponds to a strategy pattern : the executed code is selected at runtime. What is called helpers here are often called behaviours in litterature. HelpersA helper is : a class performing part of the documentation job.Helpers inherit from abstract class Helper, which provides :
- a field $docu, to access to the Documentor which conducts the run ;
- "magic" __get, __set and __isset, to shorten the syntax : $this->classes instead of $this->docu->data['classes']
- an abstract method, action() that suclasses must implement.
So most of the job is done by helpers. Documentor is conducting the whole process, and is used as a central repository containng all the data computed and needed by helpers. Helpers don't store any data, or just auxiliary variables helping them to do their job. Instead, helpers fill and use documentor's public fields (ex : $userConfig, $data).
Helper's definition is vague, so there are several kinds of helpers, of different roles and importance ; they are just objects that permit object composition. Steps to documentIn the default documentor, the process of generating code documentation was decomposed in different steps :
In a strict programming point of view, these helpers are useless, they just provide an other name for method action(), but they permit to render the code more readable.
All documentor implementations do not necessarily use all these helpers ; for example, in 'php' documentor implementation, step 2 doesn't exist. Secondary helpersSome steps listed above can be decomposed in sub-steps. For example, contents generation involves several different types of contents ; each type of contents is handled by one helper. So theContentsGenerator implementation is just coordinating contents generation, calling for sub-helpers which perform the effective generation.
Configuration filesEach run of phpSimpleDoc needs 3 configuration files :
|