Docs of Buxa\Code\Documentor

Buxa\Code\Documentor

Type
Abstract Class
Description
Code Documentor Tool for API Docs
Used Packages
Children
Implemented Interfaces
Constants
  • PATH_TEMPLATES
Properties
  • None
Inherited Properties
  • None
Methods
Inherited Methods
  • None
See
None
Links
None
Todo
None
Source
Buxa\Code\Documentor.php
Version
$Id$
Since
forever
Authors
None
Copyright
© 2008 Buxaprojects
Licence
GNU Public License

Properties

None

 

Methods

public final static array availableClassTags()

Description
Returns the supported class tags
Parameters
None
Returns
Available class tags
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final static array availableDrivers()

Description
Returns all supported drivers
Parameters
None
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final static array availableMethodTags()

Description
Returns the supported method tags
Parameters
None
Returns
Available method tags
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final static array availableOutputFormats()

Description
Returns all supported output formats
Parameters
None
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final static array availablePropertyTags()

Description
Returns the supported property tags
Parameters
None
Returns
Available property tags
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final static Documentor factory(string $driver)

Description
Creates a new instance of the documentor.
Parameters
$driver Language driver
Returns
Childclass object
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public abstract void generate()

Description
Generates the documentation
Parameters
None
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final array getClassesToIgnore()

Description
Returns the classes / interfaces to ignore
Parameters
None
Returns
Classes / interfaces to ignore
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void getGoogleAnalytics()

Description
None
Parameters
None
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final Logger getLogger()

Description
Returns the current logger
Parameters
None
Returns
Returns the logger if used, otherweise NULL
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final string getOutputFormat()

Description
Returns the output format
Parameters
None
Returns
Output format
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final array getPackagesToParse()

Description
Returns the packages to parse
Parameters
None
Returns
Packages to parse
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final string getPathToTemplate()

Description
Returns the path to the template
Parameters
None
Returns
Path to template
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final string getRootPackage()

Description
Returns the root package
Parameters
None
Returns
Root package
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final Dir getSourceDir()

Description
Returns the source directory
Parameters
None
Returns
source directory
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final Dir getTargetDir()

Description
Returns the target directory
Parameters
None
Returns
target directory
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final string getTemplate()

Description
Returns the template name
Parameters
None
Returns
Template name
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final string getTitle()

Description
Returns the title of the documentation
Parameters
None
Returns
Title of the documentation
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final string getVersion()

Description
Returns the version of the documentation
Parameters
None
Returns
Version of the documentation
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final bool isAlphabeticalOrder()

Description
Wheter ordering is alphabetical
Parameters
None
Returns
Alphabetical ordering
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final bool isCompressOutput()

Description
Returns true if the generated documentation has to be compressed
Parameters
None
Returns
True if the output should be compressed
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final bool isGenerateSourceCode()

Description
Returns true if source code must be generated
Parameters
None
Returns
True if source code has to be generated
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final bool isPublicOnly()

Description
Returns true if only public properties and methods should be parsed
Parameters
None
Returns
Parse only public methods
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setAlphabeticalOrder(bool $alphabeticalOrder = true)

Description
Order packages, classes, constants, properties and methods alphabetical
Parameters
$alphabeticalOrder Alphabetical order
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setClassesToIgnore(array $classes)

Description
Defines the classes / interfaces to ignore.
Parameters
$classes Classes to ignore (Example: array('Buxa\Color', 'Buxa\Code\*', '*\Exception'))
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setCompressOutput(bool $compressOutput = true)

Description
Compress the generated documentation output
Parameters
$compressOutput True if the output should be compressed
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setGenerateSourceCode(bool $generateSourceCode = true)

Description
Genarates source code if this option isset to true
Parameters
$generateSourceCode Source code generation
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setGoogleAnalytics(GoogleAnalytics $ga)

Description
Attaches a Google Analytics JavaScript to the output
Parameters
$ga Google Analytics
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setLogger(Logger $logger)

Description
Sets a logger, logger uses benchmark
Parameters
$logger Logger to use
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setOutputFormat(string $outputFormat)

Description
Sets the output format
Parameters
$outputFormat Output format
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setPackagesToParse(array $packages)

Description
Defines the packages to parse
Parameters
$packages Packages to parse
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setPublicOnly(bool $publicOnly = true)

Description
Only parse public properties and methods
Parameters
$publicOnly True if only public properties and methods should be parsed
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setRootPackage(string $rootPackage)

Description
Sets the root package
Parameters
$rootPackage Root package
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setSourceDir(string $path)

Description
Sets the source directory
Parameters
$path Source directory
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setTargetDir(string $path)

Description
Sets the target directory
Parameters
$path target directory
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setTemplate(string $template)

Description
Sets the template
Parameters
$template Template name
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setTitle(string $title)

Description
Sets the title of the documentation
Parameters
$title Title of the documentation
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

public final void setVersion(string $version)

Description
Sets the version of the documentation
Parameters
$version Version of the documentation
Returns
Void
Throws
None
See
None
Links
None
Todo
None
Since
forever
Authors
None

Example

<?php
// Autoloader for the Buxa Framework
require_once '../library/Buxa/Autoloader.php';
Buxa\Autoloader::register();

// Autoloader for your stuff
require_once '../library/YourStuff/Autoloader.php';
YourStuff\Autoloader::register();

// Load Packages
use Buxa\Code\Documentor;
use 
Buxa\Logger;
use 
Buxa\Gui\Component\Html\JavaScript\GoogleAnalytics;

// Setup Logger (optional)
$docLog = new Logger();
$docLog->addWriter(
      new 
Logger\Writer\HtmlOutput(Logger\Message::LEVEL_INFO)
);

// Setup Google Analytics (optional)
$ga = new GoogleAnalytics('UA-123456-7');

// Setup Documentor
$phpDoc Documentor::factory('php');
$phpDoc->setTitle('Buxa Framework');
$phpDoc->setVersion('1.2.3');
$phpDoc->setSourceDir('../library/Buxa');
$phpDoc->setTargetDir('../docs/Buxa');
$phpDoc->setRootPackage('Buxa');
$phpDoc->setPackagesToParse(array(
    
'Autoloader',
    
'Benchmark',
    
'Code',
    
'Color',
    
'File',
    
'Filter',
    
'Logger'
));
$phpDoc->setClassesToIgnore(array(
    
'*\Exception'
));
$phpDoc->setGenerateSourceCode(false); // Default false
$phpDoc->setAlphabeticalOrder(true); // Default: false
$phpDoc->setPublicOnly(true); // Default: true
$phpDoc->setCompressOutput(true); // Default: true
$phpDoc->setLogger($docLog); // Optional
$phpDoc->setGoogleAnalytics($ga); // Optional

// Run
$phpDoc->generate();
?>