SlideShare a Scribd company logo
1 of 34
Download to read offline
The Beauty and the Beast




Bastian Feder                            PHPBCAT2010
papaya Software GmbH                        01.05.2010
Me, myself and I

             application developer
             PHP since 2001
             JavaScript since 2002
             papaya CMS seit 01.2008
Who are you?
Agenda

●   What is this phpDocumentor everyone is talking
    about?
●   Doh! Too less space for a complete
    documentation!
●   Nice so far! Are there tools supporting this
    thing?
●   Where to find more information.
What is this phpDocumentor?
●   Automated documentation
●   Identifies annotations (tags)
●   Command line tool
●   Written in PHP
●   Converters render different formats (HTML,
    Smarty, DocBook, etc)
phpDocumentor - tags

●   A phpDocumentor tag is an annotation telling a
    parser what to do with the given information.
●   Rendering template decides which information
    will be displayed.
Tags - examples

●   @package, @subpackage, @category
●   @author, @license, @version
●   @param, @return
●   @access
●   @see, @link, @uses
●   @todo
●   @example, @tutorial
inline{} tags
●   Display their information in the text flow


    /**
    * inline tags demonstration
    *
    * this function works heavily with {@link foo()} to rule the world. If I want
    * to use the characters "{@link" in a docblock, I just use "{@}link." If
    * I want the characters "{@*}" I use "{@}*}"
    */
     function bar() {
       return;
     }
DocBlock definition
/**
* This is an example short description of a phpDocumentor DocBlock.
*
* This example shall show how a DocBlock shall look like and what information are
* to be displayed.
* This text and the upper license will be displayed in the rendered documentation as the
* so called long description of the DocBlock.
*
* @copyright 2002-2008 by papaya Software GmbH - All rights reserved.
* @link http://www.papaya-cms.com/
* @license GNU General Public Licence (GPL) 2 http://www.gnu.org/copyleft/gpl.html
*
* You can redistribute and/or modify this script under the terms of the GNU General Public
* License (GPL) version 2, provided that the copyright and license notes, including these
* lines, remain unmodified. papaya is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @package Papaya-Modules
* @subpackage Free-Domains
* @version $Id: connector_domains.php 19965 2010-04-11 12:23:29Z feder $
*/
DocBlock inheritence
●   @author, @version, and @copyright are automatically
    inherited unless explicitly specified in the DocBlock
●   @package and @subpackage are inherited unless
    explicitly specified in the DocBlock
●   If there is no short description, the short description will be
    inherited.
●   If there is no long description, the long description will be
    inherited.
●   If there is a long description, and you still want to inherit
    the parent's description, use inline {@inheritdoc}
Commandline options
 $> phpdoc -h

 -d    --directory      name of a directory(s) to parse
                        directory1,directory2
 -t    --target         path where to save the generated files
 -ti   --title          title of generated documentation,
                        default is 'Generated Documentation'
 -pp   --parseprivate   parse @internal and elements marked
                        private with @access.
                        Use on/off, default off
 -o    --output         output information to use separated by
                        ','. Format:
                        output:converter:templatedir like
                        "HTML:frames:phpedit"
 -c    --useconfig      Use a Config file in the
                        users/ subdirectory for all
                        command-line options

 ...
User conifguration file
●   Templates in subdir 'user'
●   Covers complete configuration options
●   Additional description each option

               $> phpdoc -c PATH/TO/myConf.ini
Generated documentation
Tutorials
●   DocBook format
●   Link in external documentation (inline{})
●   Enable rendering the tutorial:
    ●   Existing subdir named „tutorials“
    ●   Comandline switch „-d“, „--directory“, „-f“ or „--
        filename“ must contain the subdir
    ●   Predefined structure:
        –   tutorials/package/package.pkg
        –   tutorials/package/subpackage/subpackage.pkg
Tutorials – types
●   Package tutorials
    ●   File extension: .pkg

●   Class tutorials
    ●   File extension: .cls

●   Procedural code tutorials
    ●   File extension: .proc
Tutorials – example annotation

/**
* FluentDOM implements a jQuery like replacement for DOMNodeList
*
* @version $Id: FluentDOM.php 338 2009-09-28 13:21:22Z lapis $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @copyright Copyright (c) 2009 Bastian Feder, Thomas Weinert
*
* @tutorial FluentDOM.pkg
* @package FluentDOM
*/
Tutorials – example
FluentDOM.pkg
<refentry id="{@id}">
 <refnamediv>
  <refname>User Guide for FluentDOM</refname>
  <refpurpose></refpurpose>
 </refnamediv>
 <refsynopsisdiv>
  <author>Bastian Feder</author>
  <author>Thomas Weinert</author>
 </refsynopsisdiv>
 {@toc}
 <refsect1 id="{@id intro}">
  <title>FluentDOM</title>
  <para>
    FluentDOM ist a jQuery like fluent XML interface for the DOMDocument in PHP.
  </para>
  <para>
    The idea was born in a workshop of {@link http://schlitt.info Tobias Schlitt},
    about the PHP XML extensions at the IPC Spring, in Berlin. He used this idea to show
    XPath samples in the session.
  </para>
 </refsect1>
</refentry>
Tutorials – generated output
Quality check
●   Error log
    (errors.html in root of API documentation)
●   Todo list
    (todolist.html in root of API documentation)
SVN identifiers
●   $Date: $
    ●   $Date: 2006-07-22 21:42:37 -0700 (Sat, 22 Jul 2006) $
●   $Revision: $
    ●   $Revision: 144 $
●   $Author: $
    ●   $Author: feder $
●   $headURL: $
    ●   $HeadURL: http://svn.papaya.local/svn/weisseliste/trunk/README $
●   $Id: $
    ●   $Id: content_assistant_step.php 19696 2008-08-05 15:52:41Z feder $
SVN / CVS identifier               (II)




●   Location of 'config' – file:
    ●   MacOsX/Linux:
         ~/.subversion/config
    ●   WinXp:
        C:Dokumente und Einstellungen
        <USER>AnwendungsdatenSubversionconf
        ig
SVN / CVS identifier                                               (III)




    ●    Add following lines to configuration file:

[miscellany]
global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store .project .cache .settings
enable-auto-props = yes

[auto-props]
*.js = svn:eol-style=LF;svn:keywords=Id LastChangedDate LastChangedRevision URL
*.css = svn:eol-style=LF;svn:keywords=Id LastChangedDate LastChangedRevision URL
*.php = svn:eol-style=LF;svn:keywords=Id LastChangedDate LastChangedRevision URL
*.html = svn:eol-style=LF;svn:mime-type=text/html;svn:keywords=Id URL
*.htm = svn:eol-style=LF;svn:mime-type=text/html;svn:keywords=Id URL
*.xsl = svn:eol-style=LF
*.xml = svn:eol-style=LF
*.xsd = svn:eol-style=LF
*.sql = svn:eol-style=LF
*.txt = svn:eol-style=LF
Eclipse PDT – docu hints

If you plan to instantiate a new object in your
   class, declare the name of the class to be
   instantitated as type of the class var you will
   use.

            /**
            * Example description for a public class var.
            *
            * @var base_plugin
            */
            protected $basePluginObj;
Eclipse PDT – docu hints               (II)




●   Once you declared the complete function
    DocBlock, Eclipse is able to show you these
    information in the tooltip of the function call.
●   Try to hit F2 when the tooltip appears. This will
    set the focus to the tooltip and it can be resized
    to see the complete info.
Eclipse PDT – docu hints                                       (III)




 ●   Magic methods                             ●   Magic properties
      ●   __clone()                                ●   __set()
      ●   __empty()                                ●   __get()
      ●   ...

/**
* FluentDOM implements a jQuery like replacement for DOMNodeList
*
* @property string $contentType Ouput type – text/xml or text/html
* @property-read DOMDocument $document An instance of the current DOMDocument
* @property-read DOMXPath $xpath An Instance of the current DOMXPath object
*
* @method bool empty() clears the current node list identified by a selector
* @method DOMDocument clone() clones the current node list identified by a selector
*
* @package FluentDOM
*/
Eclipse PDT – docu hints
external Tools framework
●   Enables Eclipse to run ‚stand-alone‘
    applications
●   Two broad classes of external tools are
    available:
    ●   Ant build files
    ●   Everything else
How to integrate
How to integrate (II)
●   Location
    points to the phpDocumentor installation

●   Working Directory
    directory to store temporary data

●   Arguments
    command line parameters to be passed to
    phpDocumentor

    '-c' defines the location of a configuration
    file

    '${project_loc}' Eclipse variable
    representing the location of the current
    selected project.
How to integrate (III)
●   Display in favorites
    menu

●   Standard Input and
    Output
Any questions left?
Slides'n Feedback
●   Sildes
    (http://www.slideshare.net/lapistano)

●   Feedback
     ●   Personal contact
         (conference@bastian-feder.de)

     ●   Joind'in
         (http://joind.in/user/view/557)
References
●   phpDocumentor website @ pear.php.net
    (http://pear.php.net/package/PhpDocumentor/docs/1.4.4)

●   phpDocumentor Manual
    (http://manual.phpdoc.org)

●   FluentDOM
    (http://fluentdom.org)

●   Eclipse website
    (http://eclipse-org/pdt)

●   SVN keyword substitution
    (http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.advanced.props.special.keywords)
License
   This set of slides and the source code included
    in the download package is licensed under the

        Creative Commons Attribution-
     Noncommercial-Share Alike 2.0 Generic
                   License


      http://creativecommons.org/licenses/by-nc-sa/2.0/deed.en

More Related Content

What's hot

TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)Robert Lemke
 
Unit 3
Unit  3Unit  3
Unit 3siddr
 
Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Stephan Schmidt
 
Assic 16th Lecture
Assic 16th LectureAssic 16th Lecture
Assic 16th Lecturebabak danyal
 
Github.com anton terekhov-orientdb-php
Github.com anton terekhov-orientdb-phpGithub.com anton terekhov-orientdb-php
Github.com anton terekhov-orientdb-phpSan jay
 
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...Dariusz Drobisz
 
Consuming Libraries with CMake
Consuming Libraries with CMakeConsuming Libraries with CMake
Consuming Libraries with CMakeRichard Thomson
 
Applications for the Enterprise with PHP (CPEurope)
Applications for the Enterprise with PHP (CPEurope)Applications for the Enterprise with PHP (CPEurope)
Applications for the Enterprise with PHP (CPEurope)Robert Lemke
 
Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchAndrew Lowe
 
IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3Robert Lemke
 
Php File Operations
Php File OperationsPhp File Operations
Php File Operationsmussawir20
 
Yapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlYapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlBruce Gray
 
Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Robert Lemke
 
Drupal 8's Multilingual APIs: Building for the Entire World
Drupal 8's Multilingual APIs: Building for the Entire WorldDrupal 8's Multilingual APIs: Building for the Entire World
Drupal 8's Multilingual APIs: Building for the Entire WorldChristian López Espínola
 
Fantastic DSL in Python
Fantastic DSL in PythonFantastic DSL in Python
Fantastic DSL in Pythonkwatch
 

What's hot (20)

TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)TYPO3 Flow and the Joy of Development (FOSDEM 2013)
TYPO3 Flow and the Joy of Development (FOSDEM 2013)
 
Unit 3
Unit  3Unit  3
Unit 3
 
Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5
 
IO Streams, Files and Directories
IO Streams, Files and DirectoriesIO Streams, Files and Directories
IO Streams, Files and Directories
 
Assic 16th Lecture
Assic 16th LectureAssic 16th Lecture
Assic 16th Lecture
 
Github.com anton terekhov-orientdb-php
Github.com anton terekhov-orientdb-phpGithub.com anton terekhov-orientdb-php
Github.com anton terekhov-orientdb-php
 
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
Framework agnostic application Will it fit with Symfony? - Symfony live warsa...
 
Consuming Libraries with CMake
Consuming Libraries with CMakeConsuming Libraries with CMake
Consuming Libraries with CMake
 
Applications for the Enterprise with PHP (CPEurope)
Applications for the Enterprise with PHP (CPEurope)Applications for the Enterprise with PHP (CPEurope)
Applications for the Enterprise with PHP (CPEurope)
 
Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible research
 
Spl in the wild
Spl in the wildSpl in the wild
Spl in the wild
 
Srgoc dotnet
Srgoc dotnetSrgoc dotnet
Srgoc dotnet
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Php File Operations
Php File OperationsPhp File Operations
Php File Operations
 
Yapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlYapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line Perl
 
Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)Getting Into FLOW3 (DPC12)
Getting Into FLOW3 (DPC12)
 
Drupal 8's Multilingual APIs: Building for the Entire World
Drupal 8's Multilingual APIs: Building for the Entire WorldDrupal 8's Multilingual APIs: Building for the Entire World
Drupal 8's Multilingual APIs: Building for the Entire World
 
Fantastic DSL in Python
Fantastic DSL in PythonFantastic DSL in Python
Fantastic DSL in Python
 

Similar to The beautyandthebeast phpbat2010

DocBlox: your source matters @ #pfc11
DocBlox: your source matters @ #pfc11DocBlox: your source matters @ #pfc11
DocBlox: your source matters @ #pfc11Mike van Riel
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy CodeRowan Merewood
 
Automating API Documentation
Automating API DocumentationAutomating API Documentation
Automating API DocumentationSelvakumar T S
 
The Big Documentation Extravaganza
The Big Documentation ExtravaganzaThe Big Documentation Extravaganza
The Big Documentation ExtravaganzaStephan Schmidt
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Robert Lemke
 
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Bastian Feder
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2Hugo Hamon
 
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?Wong Hoi Sing Edison
 
The Naked Bundle - Tryout
The Naked Bundle - TryoutThe Naked Bundle - Tryout
The Naked Bundle - TryoutMatthias Noback
 
Php 5.6 From the Inside Out
Php 5.6 From the Inside OutPhp 5.6 From the Inside Out
Php 5.6 From the Inside OutFerenc Kovács
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkChristian Trabold
 
Open source projects with python
Open source projects with pythonOpen source projects with python
Open source projects with pythonroskakori
 
.NET @ apache.org
 .NET @ apache.org .NET @ apache.org
.NET @ apache.orgTed Husted
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Hugo Hamon
 
FLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtFLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtRobert Lemke
 
Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn WorkshopBastian Feder
 

Similar to The beautyandthebeast phpbat2010 (20)

DocBlox: your source matters @ #pfc11
DocBlox: your source matters @ #pfc11DocBlox: your source matters @ #pfc11
DocBlox: your source matters @ #pfc11
 
Living With Legacy Code
Living With Legacy CodeLiving With Legacy Code
Living With Legacy Code
 
Automating API Documentation
Automating API DocumentationAutomating API Documentation
Automating API Documentation
 
The Big Documentation Extravaganza
The Big Documentation ExtravaganzaThe Big Documentation Extravaganza
The Big Documentation Extravaganza
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0
 
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
 
PHP Development Tools
PHP  Development ToolsPHP  Development Tools
PHP Development Tools
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
 
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
 
Intro to-puppet
Intro to-puppetIntro to-puppet
Intro to-puppet
 
Ant vs Phing
Ant vs PhingAnt vs Phing
Ant vs Phing
 
The Naked Bundle - Tryout
The Naked Bundle - TryoutThe Naked Bundle - Tryout
The Naked Bundle - Tryout
 
Php 5.6 From the Inside Out
Php 5.6 From the Inside OutPhp 5.6 From the Inside Out
Php 5.6 From the Inside Out
 
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase frameworkTYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase framework
 
Ext 0523
Ext 0523Ext 0523
Ext 0523
 
Open source projects with python
Open source projects with pythonOpen source projects with python
Open source projects with python
 
.NET @ apache.org
 .NET @ apache.org .NET @ apache.org
.NET @ apache.org
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
FLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtFLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 Frankfurt
 
Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn Workshop
 

More from Bastian Feder

JQuery plugin development fundamentals
JQuery plugin development fundamentalsJQuery plugin development fundamentals
JQuery plugin development fundamentalsBastian Feder
 
Why documentation osidays
Why documentation osidaysWhy documentation osidays
Why documentation osidaysBastian Feder
 
Php unit the-mostunknownparts
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownpartsBastian Feder
 
PhpUnit - The most unknown Parts
PhpUnit - The most unknown PartsPhpUnit - The most unknown Parts
PhpUnit - The most unknown PartsBastian Feder
 
Introducing TDD to your project
Introducing TDD to your projectIntroducing TDD to your project
Introducing TDD to your projectBastian Feder
 
Php unit the-mostunknownparts
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownpartsBastian Feder
 
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Bastian Feder
 
Bubbles & Trees with jQuery
Bubbles & Trees with jQueryBubbles & Trees with jQuery
Bubbles & Trees with jQueryBastian Feder
 
Ajax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google SuggestAjax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google SuggestBastian Feder
 

More from Bastian Feder (13)

JQuery plugin development fundamentals
JQuery plugin development fundamentalsJQuery plugin development fundamentals
JQuery plugin development fundamentals
 
Why documentation osidays
Why documentation osidaysWhy documentation osidays
Why documentation osidays
 
Solid principles
Solid principlesSolid principles
Solid principles
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
Php unit the-mostunknownparts
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownparts
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
PhpUnit - The most unknown Parts
PhpUnit - The most unknown PartsPhpUnit - The most unknown Parts
PhpUnit - The most unknown Parts
 
Introducing TDD to your project
Introducing TDD to your projectIntroducing TDD to your project
Introducing TDD to your project
 
jQuery's Secrets
jQuery's SecretsjQuery's Secrets
jQuery's Secrets
 
Php unit the-mostunknownparts
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownparts
 
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1
 
Bubbles & Trees with jQuery
Bubbles & Trees with jQueryBubbles & Trees with jQuery
Bubbles & Trees with jQuery
 
Ajax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google SuggestAjax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google Suggest
 

Recently uploaded

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

The beautyandthebeast phpbat2010

  • 1. The Beauty and the Beast Bastian Feder PHPBCAT2010 papaya Software GmbH 01.05.2010
  • 2. Me, myself and I  application developer  PHP since 2001  JavaScript since 2002  papaya CMS seit 01.2008
  • 4. Agenda ● What is this phpDocumentor everyone is talking about? ● Doh! Too less space for a complete documentation! ● Nice so far! Are there tools supporting this thing? ● Where to find more information.
  • 5. What is this phpDocumentor? ● Automated documentation ● Identifies annotations (tags) ● Command line tool ● Written in PHP ● Converters render different formats (HTML, Smarty, DocBook, etc)
  • 6. phpDocumentor - tags ● A phpDocumentor tag is an annotation telling a parser what to do with the given information. ● Rendering template decides which information will be displayed.
  • 7. Tags - examples ● @package, @subpackage, @category ● @author, @license, @version ● @param, @return ● @access ● @see, @link, @uses ● @todo ● @example, @tutorial
  • 8. inline{} tags ● Display their information in the text flow /** * inline tags demonstration * * this function works heavily with {@link foo()} to rule the world. If I want * to use the characters "{@link" in a docblock, I just use "{@}link." If * I want the characters "{@*}" I use "{@}*}" */ function bar() { return; }
  • 9. DocBlock definition /** * This is an example short description of a phpDocumentor DocBlock. * * This example shall show how a DocBlock shall look like and what information are * to be displayed. * This text and the upper license will be displayed in the rendered documentation as the * so called long description of the DocBlock. * * @copyright 2002-2008 by papaya Software GmbH - All rights reserved. * @link http://www.papaya-cms.com/ * @license GNU General Public Licence (GPL) 2 http://www.gnu.org/copyleft/gpl.html * * You can redistribute and/or modify this script under the terms of the GNU General Public * License (GPL) version 2, provided that the copyright and license notes, including these * lines, remain unmodified. papaya is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * @package Papaya-Modules * @subpackage Free-Domains * @version $Id: connector_domains.php 19965 2010-04-11 12:23:29Z feder $ */
  • 10. DocBlock inheritence ● @author, @version, and @copyright are automatically inherited unless explicitly specified in the DocBlock ● @package and @subpackage are inherited unless explicitly specified in the DocBlock ● If there is no short description, the short description will be inherited. ● If there is no long description, the long description will be inherited. ● If there is a long description, and you still want to inherit the parent's description, use inline {@inheritdoc}
  • 11. Commandline options $> phpdoc -h -d --directory name of a directory(s) to parse directory1,directory2 -t --target path where to save the generated files -ti --title title of generated documentation, default is 'Generated Documentation' -pp --parseprivate parse @internal and elements marked private with @access. Use on/off, default off -o --output output information to use separated by ','. Format: output:converter:templatedir like "HTML:frames:phpedit" -c --useconfig Use a Config file in the users/ subdirectory for all command-line options ...
  • 12. User conifguration file ● Templates in subdir 'user' ● Covers complete configuration options ● Additional description each option $> phpdoc -c PATH/TO/myConf.ini
  • 14. Tutorials ● DocBook format ● Link in external documentation (inline{}) ● Enable rendering the tutorial: ● Existing subdir named „tutorials“ ● Comandline switch „-d“, „--directory“, „-f“ or „-- filename“ must contain the subdir ● Predefined structure: – tutorials/package/package.pkg – tutorials/package/subpackage/subpackage.pkg
  • 15. Tutorials – types ● Package tutorials ● File extension: .pkg ● Class tutorials ● File extension: .cls ● Procedural code tutorials ● File extension: .proc
  • 16. Tutorials – example annotation /** * FluentDOM implements a jQuery like replacement for DOMNodeList * * @version $Id: FluentDOM.php 338 2009-09-28 13:21:22Z lapis $ * @license http://www.opensource.org/licenses/mit-license.php The MIT License * @copyright Copyright (c) 2009 Bastian Feder, Thomas Weinert * * @tutorial FluentDOM.pkg * @package FluentDOM */
  • 17. Tutorials – example FluentDOM.pkg <refentry id="{@id}"> <refnamediv> <refname>User Guide for FluentDOM</refname> <refpurpose></refpurpose> </refnamediv> <refsynopsisdiv> <author>Bastian Feder</author> <author>Thomas Weinert</author> </refsynopsisdiv> {@toc} <refsect1 id="{@id intro}"> <title>FluentDOM</title> <para> FluentDOM ist a jQuery like fluent XML interface for the DOMDocument in PHP. </para> <para> The idea was born in a workshop of {@link http://schlitt.info Tobias Schlitt}, about the PHP XML extensions at the IPC Spring, in Berlin. He used this idea to show XPath samples in the session. </para> </refsect1> </refentry>
  • 19. Quality check ● Error log (errors.html in root of API documentation) ● Todo list (todolist.html in root of API documentation)
  • 20. SVN identifiers ● $Date: $ ● $Date: 2006-07-22 21:42:37 -0700 (Sat, 22 Jul 2006) $ ● $Revision: $ ● $Revision: 144 $ ● $Author: $ ● $Author: feder $ ● $headURL: $ ● $HeadURL: http://svn.papaya.local/svn/weisseliste/trunk/README $ ● $Id: $ ● $Id: content_assistant_step.php 19696 2008-08-05 15:52:41Z feder $
  • 21. SVN / CVS identifier (II) ● Location of 'config' – file: ● MacOsX/Linux: ~/.subversion/config ● WinXp: C:Dokumente und Einstellungen <USER>AnwendungsdatenSubversionconf ig
  • 22. SVN / CVS identifier (III) ● Add following lines to configuration file: [miscellany] global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store .project .cache .settings enable-auto-props = yes [auto-props] *.js = svn:eol-style=LF;svn:keywords=Id LastChangedDate LastChangedRevision URL *.css = svn:eol-style=LF;svn:keywords=Id LastChangedDate LastChangedRevision URL *.php = svn:eol-style=LF;svn:keywords=Id LastChangedDate LastChangedRevision URL *.html = svn:eol-style=LF;svn:mime-type=text/html;svn:keywords=Id URL *.htm = svn:eol-style=LF;svn:mime-type=text/html;svn:keywords=Id URL *.xsl = svn:eol-style=LF *.xml = svn:eol-style=LF *.xsd = svn:eol-style=LF *.sql = svn:eol-style=LF *.txt = svn:eol-style=LF
  • 23. Eclipse PDT – docu hints If you plan to instantiate a new object in your class, declare the name of the class to be instantitated as type of the class var you will use. /** * Example description for a public class var. * * @var base_plugin */ protected $basePluginObj;
  • 24. Eclipse PDT – docu hints (II) ● Once you declared the complete function DocBlock, Eclipse is able to show you these information in the tooltip of the function call. ● Try to hit F2 when the tooltip appears. This will set the focus to the tooltip and it can be resized to see the complete info.
  • 25. Eclipse PDT – docu hints (III) ● Magic methods ● Magic properties ● __clone() ● __set() ● __empty() ● __get() ● ... /** * FluentDOM implements a jQuery like replacement for DOMNodeList * * @property string $contentType Ouput type – text/xml or text/html * @property-read DOMDocument $document An instance of the current DOMDocument * @property-read DOMXPath $xpath An Instance of the current DOMXPath object * * @method bool empty() clears the current node list identified by a selector * @method DOMDocument clone() clones the current node list identified by a selector * * @package FluentDOM */
  • 26. Eclipse PDT – docu hints
  • 27. external Tools framework ● Enables Eclipse to run ‚stand-alone‘ applications ● Two broad classes of external tools are available: ● Ant build files ● Everything else
  • 29. How to integrate (II) ● Location points to the phpDocumentor installation ● Working Directory directory to store temporary data ● Arguments command line parameters to be passed to phpDocumentor '-c' defines the location of a configuration file '${project_loc}' Eclipse variable representing the location of the current selected project.
  • 30. How to integrate (III) ● Display in favorites menu ● Standard Input and Output
  • 32. Slides'n Feedback ● Sildes (http://www.slideshare.net/lapistano) ● Feedback ● Personal contact (conference@bastian-feder.de) ● Joind'in (http://joind.in/user/view/557)
  • 33. References ● phpDocumentor website @ pear.php.net (http://pear.php.net/package/PhpDocumentor/docs/1.4.4) ● phpDocumentor Manual (http://manual.phpdoc.org) ● FluentDOM (http://fluentdom.org) ● Eclipse website (http://eclipse-org/pdt) ● SVN keyword substitution (http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.advanced.props.special.keywords)
  • 34. License  This set of slides and the source code included in the download package is licensed under the Creative Commons Attribution- Noncommercial-Share Alike 2.0 Generic License http://creativecommons.org/licenses/by-nc-sa/2.0/deed.en