Skip to content

Commit

Permalink
Changed DocBlox into phpDocumentor
Browse files Browse the repository at this point in the history
  • Loading branch information
mvriel committed Jan 25, 2012
1 parent 64345cf commit 4d2dd3a
Show file tree
Hide file tree
Showing 227 changed files with 4,083 additions and 3,671 deletions.
60 changes: 30 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
README
======

What is DocBlox?
What is phpDocumentor?
----------------

DocBlox an application that is capable of analyzing your PHP source code and
phpDocumentor an application that is capable of analyzing your PHP source code and
DocBlock comments to generate a complete set of API Documentation.

Inspired by phpDocumentor and JavaDoc it continues to innovate and is up to date
Expand All @@ -13,24 +13,24 @@ with the latest technologies and PHP language features.
Features
--------

DocBlox sports the following:
phpDocumentor sports the following:

* *PHP 5.3 compatible*, full support for Namespaces, Closures and more is provided.
* *Shows any tag*, some tags add additional functionality to DocBlox (such as @link).
* *Shows any tag*, some tags add additional functionality to phpDocumentor (such as @link).
* *Processing speed*, Zend Framework experienced an 80% reduction in processing time compared to phpDocumentor.
* *Low memory usage*, peak memory usage for small projects is less than 20MB, medium projects 40MB and large frameworks 100MB.
* *Incremental parsing*, if you kept the Structure file from a previous run you get an additional performance boost of up
to 80% on top of the mentioned processing speed above.
* *Easy template building*, if you want to make a branding you only have to call 1 task and edit 3 files.
* *Basic command-line compatibility with phpDocumentor*, Docblox is an application in its own right but the
* *Basic command-line compatibility with phpDocumentor*, phpDocumentor is an application in its own right but the
basic phpDocumentor arguments, such as --directory, --file and --target, have been adopted.
* *Two-step process*, DocBlox first generates a XML file with your application structure before creating the output.
* *Two-step process*, phpDocumentor first generates a XML file with your application structure before creating the output.
If you'd like you can use that to power your own tools or formatters!

Requirements
------------

DocBlox requires the following:
phpDocumentor requires the following:

* PHP 5.2.6 or higher (might work on 5.2.x as well but this is not supported)
* iconv/ext, http://php.net/manual/en/book.iconv.php (is enabled by default since PHP 5.0.0)
Expand All @@ -40,92 +40,92 @@ DocBlox requires the following:

**Note:**
If you do not want to install the PEAR or Graphviz dependency you are encouraged to generate your own template and make sure that it does not contain anything related to `Graph`.
An easier solution might be to edit `data/templates/new_black/template.xml` file and remove every line containing the word `Graph` but this will be undone with every upgrade of DocBlox.
An easier solution might be to edit `data/templates/new_black/template.xml` file and remove every line containing the word `Graph` but this will be undone with every upgrade of phpDocumentor.

Please see the documentation about creating your own templates for more information.

Installation
------------

There are 2 ways to install DocBlox:
There are 2 ways to install phpDocumentor:

1. Via PEAR (recommended)
2. Directly from source (Github)

_*Please note* that it is required that the installation path of DocBlox does not
_*Please note* that it is required that the installation path of phpDocumentor does not
contain spaces. This is a requirement imposed by an external library (libxml)_

### PEAR (recommended)

1. DocBlox is hosted on its own PEAR channel which can be discovered using the following command:
1. phpDocumentor is hosted on its own PEAR channel which can be discovered using the following command:

$ pear channel-discover pear.docblox-project.org
$ pear channel-discover pear.phpdoc.org

2. After that it is a simple matter of invoking PEAR to install the application

$ pear install docblox/DocBlox
$ pear install phpdoc/phpDocumentor

### Directly from source (Github)

1. Download the latest released version from [http://www.docblox-project.org](http://www.docblox-project.org) or
1. Download the latest released version from [http://www.phpdoc.org](http://www.phpdoc.org) or
if you feel really adventurous you can try the latest unreleased.
2. Unzip the downloaded file to the intended destination location.
3. DocBlox comes without templates by default when manually installed, to install
3. phpDocumentor comes without templates by default when manually installed, to install
the default template call the template installer and install the `new_black`
template.

$ php {INSTALLATION_FOLDER}/bin/docblox.php template:install new_black -v 1.0.1
$ php {INSTALLATION_FOLDER}/bin/phpdoc.php template:install new_black -v 1.0.1

All other dependencies are included in the DocBlox package, so this is really it.
All other dependencies are included in the phpDocumentor package, so this is really it.
You might want to create a symbolic link or batch file from a location in your PATH
to make it easier to use but this is not required.

How to use DocBlox?
How to use phpDocumentor?
-------------------

The easiest way to run docblox is by running the following command when installed via PEAR:
The easiest way to run phpDocumentor is by running the following command when installed via PEAR:

$ docblox.php run -d <SOURCE_DIRECTORY> -t <TARGET_DIRECTORY>
$ phpdoc run -d <SOURCE_DIRECTORY> -t <TARGET_DIRECTORY>

or when you did a manual installation:

$ php {INSTALLATION_FOLDER}/bin/docblox.php run -d <SOURCE_DIRECTORY> -t <TARGET_DIRECTORY>
$ php {INSTALLATION_FOLDER}/bin/phpdoc.php run -d <SOURCE_DIRECTORY> -t <TARGET_DIRECTORY>

This command will parse the source code provided using the `-d` argument and
output it to the folder indicated by the `-t` argument.

DocBlox supports a whole range of options to configure the output of your documentation.
phpDocumentor supports a whole range of options to configure the output of your documentation.
You can execute the following command, or check our website, for a more detailed listing of available command line options.

$ docblox run -h
$ phpdoc run -h

Configuration file(s)
---------------------

DocBlox also supports the use of configuration files (named docblox.xml or docblox.dist.xml by default).
phpDocumentor also supports the use of configuration files (named phpdoc.xml or phpdoc.dist.xml by default).
Please consult the documentation to see the format and supported options.

Documentation
-------------

For more detailed information you can check our online documentation at [http://www.docblox-project.org/documentation](http://www.docblox-project.org/documentation).
For more detailed information you can check our online documentation at [http://docs.phpdoc.org](http://docs.phpdoc.org).

Known issues
------------

1. Search does not work / is not available when accessing the documentation locally from Google Chrome.
Google Chrome blocks access to local files (and thus the search index) using Javascript when working
with local files (file://); it is not possible for us to fix this.
2. DocBlox must be installed in a path without spaces due to restrictions in libxml. The XSL transformation
2. phpDocumentor must be installed in a path without spaces due to restrictions in libxml. The XSL transformation
will throw all kinds of odd warnings if the path contains spaces.

Contact
-------

To come in contact is actually dead simple and can be done in a variety of ways.

* Twitter: [@DocBlox](http://twitter.com/docblox)
* Website: [http://www.docblox-project.org](http://www.docblox-project.org)
* IRC: Freenode, #docblox
* Github: [http://www.github.com/mvriel/docblox](http://www.github.com/mvriel/docblox)
* Twitter: [@phpDocumentor](http://twitter.com/phpdocumentor)
* Website: [http://www.phpdoc.org](http://www.phpdoc.org)
* IRC: Freenode, #phpdocumentor
* Github: [http://www.github.com/phpdocumentor/phpdocumentor2](http://www.github.com/phpdocumentor/phpdocumentor2)
* E-mail: [mike.vanriel@naenius.com](mailto:mike.vanriel@naenius.com)
10 changes: 5 additions & 5 deletions bin/parse.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env php
<?php
/**
* DocBlox
* phpDocumentor
*
* @category DocBlox
* @category phpDocumentor
* @package CLI
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
*/

// if the file exists then this is not a PEAR install; otherwise pick it up
// from the path
if (file_exists(dirname(__FILE__) . '/docblox.php')) {
passthru('php '.dirname(__FILE__).'/docblox.php project:parse '.implode(' ', array_slice($argv, 1)));
if (file_exists(dirname(__FILE__) . '/phpdoc.php')) {
passthru('php '.dirname(__FILE__).'/phpdoc.php project:parse '.implode(' ', array_slice($argv, 1)));
} else {
passthru('docblox project:parse '.implode(' ', array_slice($argv, 1)));
passthru('phpdoc project:parse '.implode(' ', array_slice($argv, 1)));
}
2 changes: 1 addition & 1 deletion bin/docblox.bat → bin/phpdoc.bat
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ GOTO RUN
:USE_PEAR_PATH
set PHPBIN=%PHP_PEAR_PHP_BIN%
:RUN
"%PHPBIN%" "%PHP_PEAR_BIN_DIR%\docblox.php" %*
"%PHPBIN%" "%PHP_PEAR_BIN_DIR%\phpdoc.php" %*
28 changes: 14 additions & 14 deletions bin/docblox.php → bin/phpdoc.php
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env php
<?php
/**
* DocBlox
* phpDocumentor
*
* @category DocBlox
* @category phpDocumentor
* @package CLI
* @author Mike van Riel <mike.vanriel@naenius.com>
* @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://docblox-project.org
* @link http://phpdoc.org
*/

// check whether xhprof is loaded
Expand All @@ -28,28 +28,28 @@
// we did not install via PEAR
$bootstrap_folder = (strpos('@php_dir@', '@php_dir') === 0)
? dirname(__FILE__) . '/../src'
: '@php_dir@/DocBlox/src';
: '@php_dir@/phpDocumentor/src';

require($bootstrap_folder . '/DocBlox/Bootstrap.php');
require($bootstrap_folder . '/phpDocumentor/Bootstrap.php');

$autoloader = DocBlox_Bootstrap::createInstance()->registerAutoloader();
$autoloader = phpDocumentor_Bootstrap::createInstance()->registerAutoloader();

$task_name = ($_SERVER['argc'] == 1) ? false : $_SERVER['argv'][1];
$runner = new DocBlox_Task_Runner($task_name, 'project:run');
$runner = new phpDocumentor_Task_Runner($task_name, 'project:run');
$task = $runner->getTask();

if (!$task->getQuiet() && (!$task->getProgressbar())) {
DocBlox_Core_Abstract::renderVersion();
phpDocumentor_Core_Abstract::renderVersion();
} else {
DocBlox_Core_Abstract::config()->logging->level = 'quiet';
phpDocumentor_Core_Abstract::config()->logging->level = 'quiet';
}
if ($task->getVerbose()) {
DocBlox_Core_Abstract::config()->logging->level = 'debug';
phpDocumentor_Core_Abstract::config()->logging->level = 'debug';
}

// the plugins are registered here because the DocBlox_Task can load a
// the plugins are registered here because the phpDocumentor_Task can load a
// custom configuration; which is needed by this registration
DocBlox_Bootstrap::createInstance()->registerPlugins($autoloader);
phpDocumentor_Bootstrap::createInstance()->registerPlugins($autoloader);

try {
$task->execute();
Expand All @@ -68,8 +68,8 @@
$xhprof_data = xhprof_disable();
if ($xhprof_data !== null) {
$xhprof_runs = new XHProfRuns_Default();
$run_id = $xhprof_runs->save_run($xhprof_data, 'docblox');
$profiler_url = sprintf('index.php?run=%s&source=%s', $run_id, 'docblox');
$run_id = $xhprof_runs->save_run($xhprof_data, 'phpdoc');
$profiler_url = sprintf('index.php?run=%s&source=%s', $run_id, 'phpdoc');
echo 'Profile can be found at: ' . $profiler_url . PHP_EOL;
}
}
Expand Down
10 changes: 5 additions & 5 deletions bin/transform.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env php
<?php
/**
* DocBlox
* phpDocumentor
*
* @category DocBlox
* @category phpDocumentor
* @package CLI
* @copyright Copyright (c) 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
*/

// if the file exists then this is not a PEAR install; otherwise pick it up
// from the path
if (file_exists(dirname(__FILE__) . '/docblox.php')) {
passthru('php '.dirname(__FILE__) . '/docblox.php project:transform ' . implode(' ', array_slice($argv, 1)));
if (file_exists(dirname(__FILE__) . '/phpdoc.php')) {
passthru('php '.dirname(__FILE__) . '/phpdoc.php project:transform ' . implode(' ', array_slice($argv, 1)));
} else {
passthru('docblox project:transform ' . implode(' ', array_slice($argv, 1)));
passthru('phpdoc project:transform ' . implode(' ', array_slice($argv, 1)));
}
38 changes: 19 additions & 19 deletions bin/utils/package.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function createPackager($original_file, $options = array())
'packagefile' => 'package.xml',
'filelistgenerator' => 'file',
'simpleoutput' => true,
'baseinstalldir' => '/DocBlox',
'baseinstalldir' => '/phpDocumentor',
'packagedirectory' => dirname(__FILE__).'/../../',
'clearcontents' => true,
'ignore' => array(
Expand All @@ -24,16 +24,16 @@ function createPackager($original_file, $options = array())
'src/XHProf/*', // Profiling package
),
'exceptions' => array(
'bin/docblox.php' => 'script',
'bin/docblox.bat' => 'script',
'docblox.dist.xml' => 'php',
'bin/phpdoc.php' => 'script',
'bin/phpdoc.bat' => 'script',
'phpdoc.dist.xml' => 'php',
'LICENSE' => 'php',
'phpunit.xml.dist' => 'php',
'README' => 'php',
),
'installexceptions' => array(
'bin/docblox.php' => '/',
'bin/docblox.bat' => '/'
'bin/phpdoc.php' => '/',
'bin/phpdoc.bat' => '/'
),
'dir_roles' => array(
'bin' => 'php',
Expand All @@ -47,47 +47,47 @@ function createPackager($original_file, $options = array())
$packagexml = PEAR_PackageFileManager2::importOptions($original_file, $options);
$packagexml->setPackageType('php');

$packagexml->setPackage('DocBlox');
$packagexml->setPackage('phpDocumentor');
$packagexml->setSummary('PHP 5.3 compatible API Documentation generator aimed at projects of all sizes and Continuous Integration');
$packagexml->setDescription(<<<DESC
DocBlox is a Documentation Generation Application (DGA) for use with PHP applications.
phpDocumentor is a Documentation Generation Application (DGA) for use with PHP applications.
It is capable of transforming the comments in your source code into a full API reference document.
DocBlox is build to be PHP 5.3 compatible, fast, having a low memory consumption and easily integratable into Continuous Integration.
phpDocumentor is build to be PHP 5.3 compatible, fast, having a low memory consumption and easily integratable into Continuous Integration.
DESC
);
$packagexml->setChannel('pear.docblox-project.org');
$packagexml->setChannel('pear.phpdoc.org');
$packagexml->setNotes('Please see the CHANGELOG in the root of the application for the latest changes');

$packagexml->setPhpDep('5.2.4');
$packagexml->setPearinstallerDep('1.4.0');
$packagexml->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net', '1.4.0');
$packagexml->addPackageDepWithChannel('required', 'DocBlox_Template_new_black', 'pear.docblox-project.org', '1.0.0');
$packagexml->addPackageDepWithChannel('required', 'phpDocumentor_Template_new_black', 'pear.phpdoc.org', '1.0.0');
$packagexml->addPackageDepWithChannel('optional', 'PEAR_PackageFileManager2', 'pear.php.net', '1.0.2');

$packagexml->addReplacement('bin/docblox.php', 'pear-config', '/usr/bin/env php', 'php_bin');
$packagexml->addReplacement('bin/phpdoc.php', 'pear-config', '/usr/bin/env php', 'php_bin');
$packagexml->addGlobalReplacement('pear-config', '@php_bin@', 'php_bin');
$packagexml->addReplacement('bin/docblox.php', 'pear-config', '@php_dir@', 'php_dir');
$packagexml->addReplacement('bin/phpdoc.php', 'pear-config', '@php_dir@', 'php_dir');

$packagexml->addMaintainer('lead', 'mvriel', 'Mike van Riel', 'mike.vanriel@naenius.com');
$packagexml->setLicense('MIT', 'http://www.opensource.org/licenses/mit-license.html');

// Add this as a release, and generate XML content
$packagexml->addRelease();
$packagexml->setOSInstallCondition('windows');
$packagexml->addInstallAs('bin/docblox.bat', 'docblox.bat');
$packagexml->addInstallAs('bin/docblox.php', 'docblox.php');
$packagexml->addInstallAs('bin/phpdoc.bat', 'phpdoc.bat');
$packagexml->addInstallAs('bin/phpdoc.php', 'phpdoc.php');

$packagexml->addRelease();
$packagexml->addInstallAs('bin/docblox.php', 'docblox');
$packagexml->addIgnoreToRelease('bin/docblox.bat');
$packagexml->addInstallAs('bin/phpdoc.php', 'phpdoc');
$packagexml->addIgnoreToRelease('bin/phpdoc.bat');

return $packagexml;
}


echo 'DocBlox PEAR Packager v1.0'.PHP_EOL;
echo 'phpDocumentor PEAR Packager v1.0'.PHP_EOL;

if ($argc < 3)
{
Expand All @@ -97,7 +97,7 @@ function createPackager($original_file, $options = array())
php package.php [version] [stability] [make|nothing]
Description:
The DocBlox packager generates a package.xml file and accompanying package.
The phpDocumentor packager generates a package.xml file and accompanying package.
By specifying the version and stability you can tell the packager which version to package.
A file will only be generated if the third parameter is the word 'make'; otherwise the output will be send to
Expand Down
Loading

0 comments on commit 4d2dd3a

Please sign in to comment.