SlideShare a Scribd company logo
DocBlox
Your source matters
Mike van Riel
     Lead Developer of DocBlox
Technical Lead Developer for Unet B.V.
     Active with PHP since 2002
What is DocBlox?
➔   Documentation Generation Application (DGA) for PHP
➔   Inspired by phpDocumentor and JavaDoc
➔   Generates documentation from your source code
➔   Uses the structure and comments of your source code
DocBlox: your source matters @ #pfc11
Why DocBlox?
➔   Support for PHP 5.3+ features
➔   Performance, improved with up to 80%
➔   Memory usage, large projects use 100MB instead of
    gigabytes
➔   Active project, every month new features
    ●   Bug fixes even more frequent
➔   QA Tool for in-source documentation
Feature                                 DocBlox   phpDocumentor   Doxygen

PHP 5.3+ Support
Can cope with large projects
Search
Incremental Parsing
Doctrine Annotations
XML output
Class inheritance diagram
PDF
DocBook
Linking to external documentation
Markup of descriptions using Markdown
Latex support
Parse directly from phar
Secret feature
Who uses DocBlox?
Who uses DocBlox?



     You?
Installation
Installation via PEAR

 $ pear channel-discover pear.docblox-project.org
 $ pear channel-discover pear.michelf.com
 $ pear install docblox/DocBlox-beta



Manual installation
      See http://docs.docblox-project.org/Installation.html#manual-installation
Running docblox
$ docblox -d [FOLDER] -f [FILE] -t [DESTINATION]


OR


$ docblox parse -d [FOLDER] -f [FILE] -t [STAGING]
$ docblox transform -s [STAGING]/structure.xml -t [DESTINATION]
Running docblox: Incremental parsing
    $ docblox parse -d [FOLDER] -f [FILE] -t [STAGING]
    $ docblox transform -s [STAGING]/structure.xml -t [DESTINATION]


➔   Structure file is written to a staging location
➔   Every parsing run DocBlox will know if a file has changed
     ●   If so, re-parse
     ●   If not, re-use
➔   Advantages:
     ●   Parsing speed is increased
     ●   Structure file is not distributed along with rest of documentation
Running docblox: Incremental parsing
    $ docblox parse -d [FOLDER] -f [FILE] -t [STAGING]
    $ docblox transform -s [STAGING]/structure.xml -t [DESTINATION]



➔   Structure file is written to a staging location
➔   Every parsing run DocBlox will know if a file has changed
     ●   If so, re-parse
     ●   If not, re-use
➔   Advantages:
     ●   Parsing speed is increased
     ●   Structure file is not distributed along with rest of documentation
Running docblox: Options
$ docblox –-help
-h [--help]                   Show this help message
-q [--quiet]                  Silences the output and logging
-c [--config] [STRING]        Configuration filename OR "none", when this option is omitted DocBlox tries
                              to load the docblox.xml or docblox.dist.xml from the current working
                              directory
-f [--filename] STRING        Comma-separated list of files to parse. The wildcards ? and * are supported
-d [--directory] STRING       Comma-separated list of directories to (recursively) parse.
-t [--target] [STRING]        Path where to store the generated output (optional, defaults to "output")
-e [--extensions] [STRING]    Optional comma-separated list of extensions to parse, defaults to php, php3
                              and phtml
-i [--ignore] [STRING]        Comma-separated list of file(s) and directories that will be ignored.
                              Wildcards * and ? are supported
-m [--markers] [STRING]       Comma-separated list of markers/tags to filter, (optional, defaults
                              to: "TODO,FIXME")
-v [--verbose]                Provides additional information during parsing, usually only needed for
                              debugging purposes
--title [STRING]              Sets the title for this project; default is the DocBlox logo
--template [STRING]           Sets the template to use when generating the output
--force                       Forces a full build of the documentation, does not increment existing
                              documentation
--validate                    Validates every processed file using PHP Lint, costs a lot of performance
--parseprivate                Whether to parse DocBlocks tagged with @internal
--visibility [STRING]         Specifies the parse visibility that should be displayed in the
                              documentation (comma seperated e.g. "public,protected")
--defaultpackagename [STRING] name to use for the default package. If not specified, uses "default"
Configuration
➔   Stored as XML
➔   docblox.dist.xml or docblox.xml
<?xml version="1.0" encoding="UTF-8" ?>
<docblox>
    <parser>
        <default-package-name>DocBlox</default-package-name>
        <target>data/output</target>
    </parser>
    <transformer>
        <target>data/output</target>
    </transformer>
    <files>
        <directory>.</directory>
        <ignore>tests/*</ignore>
    </files>
</docblox>
Writing Docblocks
➔   Docblocks are used to tag elements with meta-data
➔   Specific type of comment: /** … */
➔   Three parts:
    ●   Short description, one liner
    ●   Long description, a complete description of the
        element
    ●   Tags, annotations which provide additional
        information
Docblocks - II
/**
  * This is a short description.
  *
  * This is a long description, which may span
  * multiple lines and contain {@inline} tags and
  * can be *styled* with `Markdown`.
  *
  * @param string     $a This is the first variable.
  * @param Exception $b This is the second variable.
  * @param array      $c This is the third variable.
  *
  * @return void
  */
function myFunction($a, Exception $b, array $c)
{
}
Supported elements
➔   Files
➔   Namespaces
➔   Includes & requires
➔   Classes
➔   Traits (not yet, is coming)
➔   Functions, methods and closures
➔   Properties
➔   Constants, global and class
Supported tags
➔   @abstract      ➔   @ignore     ➔   @since
➔   @access        ➔   @internal   ➔   @static
➔   @api           ➔   @license    ➔   @staticvar
➔   @author        ➔   @link       ➔   @subpackage
➔   @category      ➔   @method
                                   ➔   @throws / @throw
➔   @copyright     ➔   @name
                                   ➔   @todo
➔   @deprecated    ➔   @package
                                   ➔   @tutorial
➔   @example       ➔   @param
➔   @final         ➔   @property
                                   ➔   @uses / @usedby
➔   @filesource    ➔   @return     ➔   @var
➔   @global        ➔   @see        ➔   @version
Inheritance
➔   Docblocks inherit by default (if not overridden)
    ●   Short description
    ●   Long description
        –   Can be augmented using {@inheritdoc}
    ●   Specific tags
Inheritance - Classes
➔   Methods
➔   Properties
➔   Tags
    ●   @package
    ●   @subpackage
        –   if @package is the same as parent
    ●   @version
    ●   @copyright
    ●   @author
Inheritance - METHODS
➔   Tags
    ●   @param
    ●   @return
    ●   @throw / @throws
    ●   @version
    ●   @copyright
    ●   @author
Inheritance - Properties
➔   Tags
    ●   @var
    ●   @version
    ●   @copyright
    ●   @author
Inheritance - Example
class Parent {
    /**
     * Short description.
     *
     * @api
     * @param int    $a First param.
     * @param string $b Second param.
     */
    function doIt($a, $b) { .. }
}

class Child extends Parent {
    /**
     * Short description.
     *                                  DocBlox adds this for you.
     * @param int    $a First param.    Note the missing @api tag
     * @param string $b Second param.
     */
    function doIt($a, $b) { .. }
}
Inheritance - @inheritdoc
class Parent {
    /**
     * Short description.
     *
     * This is my long description.
     *
     * @param int    $a First param.
     * @param string $b Second param.
     */
    function doIt($a, $b) { .. }
}

class Child extends Parent {
    /**
     * Short description.
     *
     * This method adds another bit of functionality
     * {@inheritdoc}
     *
     * @param int    $a First param.
     * @param string $b Second param.
     */
    function doIt($a, $b) { .. }
}
Inheritance - @inheritdoc
class Parent {
    /**
     * Short description.
     *
     * This is my long description.
     *
     * @param int    $a First param.
     * @param string $b Second param.
     */
    function doIt($a, $b) { .. }
}

class Child extends Parent {
    /**
     * Short description.
     *
     * This method adds another bit of functionality
     * This is my long description.
     *
     * @param int    $a First param.
     * @param string $b Second param.     DocBlox adds   this for you.
     */
    function doIt($a, $b) { .. }
}
References
➔   From Docblocks you can refer to other parts of
    the documentation using
    ●   @uses         * @uses MyNamespaceClass::function()

    ●   @see          * @see MyNamespaceClass::$property

    ●   @link and {@link .. }   * @link http://my.domain link text

    ●   @example      * @example gist:123456
BONUS: Templates
➔   Templates are a sequence of data
    transformations
➔   Can contain other templates
➔   May reside anywhere; even in your own project
    ●   which is recommended for custom templates
➔   A transformation invokes a Writer
BONUS: Templates
➔   Skeleton can be generated using the following
    command:

$ docblox theme:generate -t [PATH] -n [NAME]
BONUS: THEMES
➔   Are a collection of `views`
➔   Can be transformed to a specific output
➔   Templates can cherry pick from different
    themes
➔   Themes can 'use' eachother
Secret Feature
Plugins
➔   Starting with 0.15 DocBlox will support plugins
➔   Core functionality will be captured in a plugin
    (eat your own dog food)
➔   An easy pluggable event-based system
➔   Able to manipulate many functions in DocBlox
Plugins: invoking
➔   Add to configuration file as `plugins/plugin`
    element
➔   DocBlox Core plugin is assumed when nothing
    is defined
➔   Define path and class prefix for autoloading
➔   Can have options, added in configuration file
Plugins: Configuration
<?xml version="1.0" encoding="UTF-8" ?>
<docblox>
...
    <plugins>
        <plugin path="/my/path/to/plugin_folder"
                class_prefix="My_Plugin">
            <option name="my_option">
                value
            </option>
        </plugin>
    </plugins>
...
</docblox>
Plugins - Example
class DocBlox_Plugin_Core_Listener extends DocBlox_Plugin_Abstract
{

    /**
      * Apply a set of behaviours to the given structure.
      *
      * @docblox-event transformer.pre-transform
      *
      * @param sfEvent $data
      *
      * @return void
      */
    public function applyBehaviours(sfEvent $data)
    {
        …
    }
}
Plugins - Hooks
➔   No XSL hooks to start with
➔   Limited set to start with:
    ●   system.log, default logger
    ●   system.debug, logging of debug messages
    ●   parser.log, logging of parser errors
    ●   transformer.transform.pre, adding behaviour
    ●   transformer.transform.post, post processing of output
    ●   reflection.docblock-extraction.post, validating docblock
    ●   reflection.docblock.tag.export, transform tag to specialized form
Questions?
Mike van Riel
          mike.vanriel@naenius.com
          @mvriel
          http://blog.naenius.com
          http://joind.in/3661

 Links
 ●   http://www.docblox-project.org
 ●   http://github.com/mvriel/docblox




37 / 37                                 What is SCRUM?

More Related Content

PPTX
PostgreSQL Database Slides
PDF
The beautyandthebeast phpbat2010
PDF
Doctrine in FLOW3
PPTX
CSV to XML Converter
DOCX
Big Data Analytics Lab File
PPTX
Hdfs connector api
PPT
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
PPTX
Session 04 pig - slides
PostgreSQL Database Slides
The beautyandthebeast phpbat2010
Doctrine in FLOW3
CSV to XML Converter
Big Data Analytics Lab File
Hdfs connector api
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Session 04 pig - slides

What's hot (19)

PPT
Perl Intro 6 Ftp
PPT
Chapter 11
PDF
Devtools cheatsheet
PPTX
Comparing SAS Files
PPT
PHP - PDO Objects
PDF
Pig
PPTX
ODP
Postgre sql unleashed
PPTX
Postgresql Database Administration- Day4
PDF
Hive
ODP
Adodb Pdo Presentation
PDF
Cascading at the Lyon Hadoop User Group
PPTX
Unit 4 lecture-3
PDF
Hbase
PDF
Data manipulation language
PDF
Unix primer
PDF
Applications for the Enterprise with PHP (CPEurope)
PPT
documents writing with LATEX
PDF
第2回 Hadoop 輪読会
Perl Intro 6 Ftp
Chapter 11
Devtools cheatsheet
Comparing SAS Files
PHP - PDO Objects
Pig
Postgre sql unleashed
Postgresql Database Administration- Day4
Hive
Adodb Pdo Presentation
Cascading at the Lyon Hadoop User Group
Unit 4 lecture-3
Hbase
Data manipulation language
Unix primer
Applications for the Enterprise with PHP (CPEurope)
documents writing with LATEX
第2回 Hadoop 輪読会
Ad

Viewers also liked (7)

PDF
Scrum in the Wild at #dpc10
PPTX
Struggle & survival part 2
PPT
2010re9clinicalbeforeandafter
PPTX
Nation Report Pt2[1]
PDF
Scrum in the Wild - phpBenelux 2011
PDF
SCRUM in the Wild
PPTX
California ch.6 and 13
Scrum in the Wild at #dpc10
Struggle & survival part 2
2010re9clinicalbeforeandafter
Nation Report Pt2[1]
Scrum in the Wild - phpBenelux 2011
SCRUM in the Wild
California ch.6 and 13
Ad

Similar to DocBlox: your source matters @ #pfc11 (20)

PDF
Inside DocBlox
PDF
The Beauty and the Beast
PDF
The Beauty And The Beast Php N W09
KEY
20090629 Using phpDocumentor
PPT
The Big Documentation Extravaganza
PDF
Living With Legacy Code
PDF
Php Documentor The Beauty And The Beast
PPT
Php Docs
PDF
Nikita Popov "What’s new in PHP 8.0?"
PDF
What's new in PHP 8.0?
PDF
Php Development With Eclipde PDT
ODP
What's new, what's hot in PHP 5.3
PDF
Eclipse Pdt2.0 26.05.2009
PDF
Advanced PHP Simplified - Sunshine PHP 2018
PDF
Lessons learned: Choosing your documentation system
PPTX
Introducing PHP Latest Updates
PDF
OSS SW Basics Lecture 03: Fundamental parts of open-source projects
PDF
What's new in PHP 8.0?
PDF
PHP OOP
Inside DocBlox
The Beauty and the Beast
The Beauty And The Beast Php N W09
20090629 Using phpDocumentor
The Big Documentation Extravaganza
Living With Legacy Code
Php Documentor The Beauty And The Beast
Php Docs
Nikita Popov "What’s new in PHP 8.0?"
What's new in PHP 8.0?
Php Development With Eclipde PDT
What's new, what's hot in PHP 5.3
Eclipse Pdt2.0 26.05.2009
Advanced PHP Simplified - Sunshine PHP 2018
Lessons learned: Choosing your documentation system
Introducing PHP Latest Updates
OSS SW Basics Lecture 03: Fundamental parts of open-source projects
What's new in PHP 8.0?
PHP OOP

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
KodekX | Application Modernization Development
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Machine learning based COVID-19 study performance prediction
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation_ Review paper, used for researhc scholars
DOCX
The AUB Centre for AI in Media Proposal.docx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Understanding_Digital_Forensics_Presentation.pptx
Empathic Computing: Creating Shared Understanding
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Electronic commerce courselecture one. Pdf
20250228 LYD VKU AI Blended-Learning.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Programs and apps: productivity, graphics, security and other tools
Reach Out and Touch Someone: Haptics and Empathic Computing
Spectral efficient network and resource selection model in 5G networks
KodekX | Application Modernization Development
sap open course for s4hana steps from ECC to s4
Building Integrated photovoltaic BIPV_UPV.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Machine learning based COVID-19 study performance prediction
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation_ Review paper, used for researhc scholars
The AUB Centre for AI in Media Proposal.docx

DocBlox: your source matters @ #pfc11

  • 2. Mike van Riel Lead Developer of DocBlox Technical Lead Developer for Unet B.V. Active with PHP since 2002
  • 3. What is DocBlox? ➔ Documentation Generation Application (DGA) for PHP ➔ Inspired by phpDocumentor and JavaDoc ➔ Generates documentation from your source code ➔ Uses the structure and comments of your source code
  • 5. Why DocBlox? ➔ Support for PHP 5.3+ features ➔ Performance, improved with up to 80% ➔ Memory usage, large projects use 100MB instead of gigabytes ➔ Active project, every month new features ● Bug fixes even more frequent ➔ QA Tool for in-source documentation
  • 6. Feature DocBlox phpDocumentor Doxygen PHP 5.3+ Support Can cope with large projects Search Incremental Parsing Doctrine Annotations XML output Class inheritance diagram PDF DocBook Linking to external documentation Markup of descriptions using Markdown Latex support Parse directly from phar Secret feature
  • 9. Installation Installation via PEAR $ pear channel-discover pear.docblox-project.org $ pear channel-discover pear.michelf.com $ pear install docblox/DocBlox-beta Manual installation See http://docs.docblox-project.org/Installation.html#manual-installation
  • 10. Running docblox $ docblox -d [FOLDER] -f [FILE] -t [DESTINATION] OR $ docblox parse -d [FOLDER] -f [FILE] -t [STAGING] $ docblox transform -s [STAGING]/structure.xml -t [DESTINATION]
  • 11. Running docblox: Incremental parsing $ docblox parse -d [FOLDER] -f [FILE] -t [STAGING] $ docblox transform -s [STAGING]/structure.xml -t [DESTINATION] ➔ Structure file is written to a staging location ➔ Every parsing run DocBlox will know if a file has changed ● If so, re-parse ● If not, re-use ➔ Advantages: ● Parsing speed is increased ● Structure file is not distributed along with rest of documentation
  • 12. Running docblox: Incremental parsing $ docblox parse -d [FOLDER] -f [FILE] -t [STAGING] $ docblox transform -s [STAGING]/structure.xml -t [DESTINATION] ➔ Structure file is written to a staging location ➔ Every parsing run DocBlox will know if a file has changed ● If so, re-parse ● If not, re-use ➔ Advantages: ● Parsing speed is increased ● Structure file is not distributed along with rest of documentation
  • 13. Running docblox: Options $ docblox –-help -h [--help] Show this help message -q [--quiet] Silences the output and logging -c [--config] [STRING] Configuration filename OR "none", when this option is omitted DocBlox tries to load the docblox.xml or docblox.dist.xml from the current working directory -f [--filename] STRING Comma-separated list of files to parse. The wildcards ? and * are supported -d [--directory] STRING Comma-separated list of directories to (recursively) parse. -t [--target] [STRING] Path where to store the generated output (optional, defaults to "output") -e [--extensions] [STRING] Optional comma-separated list of extensions to parse, defaults to php, php3 and phtml -i [--ignore] [STRING] Comma-separated list of file(s) and directories that will be ignored. Wildcards * and ? are supported -m [--markers] [STRING] Comma-separated list of markers/tags to filter, (optional, defaults to: "TODO,FIXME") -v [--verbose] Provides additional information during parsing, usually only needed for debugging purposes --title [STRING] Sets the title for this project; default is the DocBlox logo --template [STRING] Sets the template to use when generating the output --force Forces a full build of the documentation, does not increment existing documentation --validate Validates every processed file using PHP Lint, costs a lot of performance --parseprivate Whether to parse DocBlocks tagged with @internal --visibility [STRING] Specifies the parse visibility that should be displayed in the documentation (comma seperated e.g. "public,protected") --defaultpackagename [STRING] name to use for the default package. If not specified, uses "default"
  • 14. Configuration ➔ Stored as XML ➔ docblox.dist.xml or docblox.xml <?xml version="1.0" encoding="UTF-8" ?> <docblox> <parser> <default-package-name>DocBlox</default-package-name> <target>data/output</target> </parser> <transformer> <target>data/output</target> </transformer> <files> <directory>.</directory> <ignore>tests/*</ignore> </files> </docblox>
  • 15. Writing Docblocks ➔ Docblocks are used to tag elements with meta-data ➔ Specific type of comment: /** … */ ➔ Three parts: ● Short description, one liner ● Long description, a complete description of the element ● Tags, annotations which provide additional information
  • 16. Docblocks - II /** * This is a short description. * * This is a long description, which may span * multiple lines and contain {@inline} tags and * can be *styled* with `Markdown`. * * @param string $a This is the first variable. * @param Exception $b This is the second variable. * @param array $c This is the third variable. * * @return void */ function myFunction($a, Exception $b, array $c) { }
  • 17. Supported elements ➔ Files ➔ Namespaces ➔ Includes & requires ➔ Classes ➔ Traits (not yet, is coming) ➔ Functions, methods and closures ➔ Properties ➔ Constants, global and class
  • 18. Supported tags ➔ @abstract ➔ @ignore ➔ @since ➔ @access ➔ @internal ➔ @static ➔ @api ➔ @license ➔ @staticvar ➔ @author ➔ @link ➔ @subpackage ➔ @category ➔ @method ➔ @throws / @throw ➔ @copyright ➔ @name ➔ @todo ➔ @deprecated ➔ @package ➔ @tutorial ➔ @example ➔ @param ➔ @final ➔ @property ➔ @uses / @usedby ➔ @filesource ➔ @return ➔ @var ➔ @global ➔ @see ➔ @version
  • 19. Inheritance ➔ Docblocks inherit by default (if not overridden) ● Short description ● Long description – Can be augmented using {@inheritdoc} ● Specific tags
  • 20. Inheritance - Classes ➔ Methods ➔ Properties ➔ Tags ● @package ● @subpackage – if @package is the same as parent ● @version ● @copyright ● @author
  • 21. Inheritance - METHODS ➔ Tags ● @param ● @return ● @throw / @throws ● @version ● @copyright ● @author
  • 22. Inheritance - Properties ➔ Tags ● @var ● @version ● @copyright ● @author
  • 23. Inheritance - Example class Parent { /** * Short description. * * @api * @param int $a First param. * @param string $b Second param. */ function doIt($a, $b) { .. } } class Child extends Parent { /** * Short description. * DocBlox adds this for you. * @param int $a First param. Note the missing @api tag * @param string $b Second param. */ function doIt($a, $b) { .. } }
  • 24. Inheritance - @inheritdoc class Parent { /** * Short description. * * This is my long description. * * @param int $a First param. * @param string $b Second param. */ function doIt($a, $b) { .. } } class Child extends Parent { /** * Short description. * * This method adds another bit of functionality * {@inheritdoc} * * @param int $a First param. * @param string $b Second param. */ function doIt($a, $b) { .. } }
  • 25. Inheritance - @inheritdoc class Parent { /** * Short description. * * This is my long description. * * @param int $a First param. * @param string $b Second param. */ function doIt($a, $b) { .. } } class Child extends Parent { /** * Short description. * * This method adds another bit of functionality * This is my long description. * * @param int $a First param. * @param string $b Second param. DocBlox adds this for you. */ function doIt($a, $b) { .. } }
  • 26. References ➔ From Docblocks you can refer to other parts of the documentation using ● @uses * @uses MyNamespaceClass::function() ● @see * @see MyNamespaceClass::$property ● @link and {@link .. } * @link http://my.domain link text ● @example * @example gist:123456
  • 27. BONUS: Templates ➔ Templates are a sequence of data transformations ➔ Can contain other templates ➔ May reside anywhere; even in your own project ● which is recommended for custom templates ➔ A transformation invokes a Writer
  • 28. BONUS: Templates ➔ Skeleton can be generated using the following command: $ docblox theme:generate -t [PATH] -n [NAME]
  • 29. BONUS: THEMES ➔ Are a collection of `views` ➔ Can be transformed to a specific output ➔ Templates can cherry pick from different themes ➔ Themes can 'use' eachother
  • 31. Plugins ➔ Starting with 0.15 DocBlox will support plugins ➔ Core functionality will be captured in a plugin (eat your own dog food) ➔ An easy pluggable event-based system ➔ Able to manipulate many functions in DocBlox
  • 32. Plugins: invoking ➔ Add to configuration file as `plugins/plugin` element ➔ DocBlox Core plugin is assumed when nothing is defined ➔ Define path and class prefix for autoloading ➔ Can have options, added in configuration file
  • 33. Plugins: Configuration <?xml version="1.0" encoding="UTF-8" ?> <docblox> ... <plugins> <plugin path="/my/path/to/plugin_folder" class_prefix="My_Plugin"> <option name="my_option"> value </option> </plugin> </plugins> ... </docblox>
  • 34. Plugins - Example class DocBlox_Plugin_Core_Listener extends DocBlox_Plugin_Abstract { /** * Apply a set of behaviours to the given structure. * * @docblox-event transformer.pre-transform * * @param sfEvent $data * * @return void */ public function applyBehaviours(sfEvent $data) { … } }
  • 35. Plugins - Hooks ➔ No XSL hooks to start with ➔ Limited set to start with: ● system.log, default logger ● system.debug, logging of debug messages ● parser.log, logging of parser errors ● transformer.transform.pre, adding behaviour ● transformer.transform.post, post processing of output ● reflection.docblock-extraction.post, validating docblock ● reflection.docblock.tag.export, transform tag to specialized form
  • 37. Mike van Riel mike.vanriel@naenius.com @mvriel http://blog.naenius.com http://joind.in/3661 Links ● http://www.docblox-project.org ● http://github.com/mvriel/docblox 37 / 37 What is SCRUM?