From 4b877c21b881f2db6ad6119e9b3c5b4411afc70e Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel
Date: Mon, 10 Jan 2011 14:16:28 +0100
Subject: [PATCH] Start the documentation module.
---
components/lib/Components/Dependencies.php | 7 ++
.../lib/Components/Dependencies/Injector.php | 23 ++++++
components/lib/Components/Module/Document.php | 86 ++++++++++++++++++++++
.../Integration/Components/Module/DocumentTest.php | 47 ++++++++++++
4 files changed, 163 insertions(+)
create mode 100644 components/lib/Components/Module/Document.php
create mode 100644 components/test/Components/Integration/Components/Module/DocumentTest.php
diff --git a/components/lib/Components/Dependencies.php b/components/lib/Components/Dependencies.php
index bddd35a6d..725f148d3 100644
--- a/components/lib/Components/Dependencies.php
+++ b/components/lib/Components/Dependencies.php
@@ -67,6 +67,13 @@ interface Components_Dependencies
public function getRunnerDistribute();
/**
+ * Returns the documentation handler for a package.
+ *
+ * @return Components_Runner_Document The distribution handler.
+ */
+ public function getRunnerDocument();
+
+ /**
* Returns the installer for a package.
*
* @return Components_Runner_Installer The installer.
diff --git a/components/lib/Components/Dependencies/Injector.php b/components/lib/Components/Dependencies/Injector.php
index c31784ee9..ca384669e 100644
--- a/components/lib/Components/Dependencies/Injector.php
+++ b/components/lib/Components/Dependencies/Injector.php
@@ -38,6 +38,9 @@ implements Components_Dependencies
{
parent::__construct(new Horde_Injector_TopLevel());
$this->setInstance('Components_Dependencies', $this);
+ $this->bindFactory(
+ 'Horde_Cli', 'Components_Dependencies', 'createCli'
+ );
}
/**
@@ -83,6 +86,16 @@ implements Components_Dependencies
}
/**
+ * Returns the documentation handler for a package.
+ *
+ * @return Components_Runner_Document The distribution handler.
+ */
+ public function getRunnerDocument()
+ {
+ return $this->getInstance('Components_Runner_Document');
+ }
+
+ /**
* Returns the snapshot packaging handler for a package.
*
* @return Components_Runner_DevPackage The snapshot handler.
@@ -131,4 +144,14 @@ implements Components_Dependencies
{
return $this->getInstance('Components_Output');
}
+
+ /**
+ * Create the CLI handler.
+ *
+ * @return Horde_Cli The CLI handler.
+ */
+ public function createCli()
+ {
+ return Horde_Cli::init();
+ }
}
\ No newline at end of file
diff --git a/components/lib/Components/Module/Document.php b/components/lib/Components/Module/Document.php
new file mode 100644
index 000000000..a92697251
--- /dev/null
+++ b/components/lib/Components/Module/Document.php
@@ -0,0 +1,86 @@
+
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link http://pear.horde.org/index.php?package=Components
+ */
+
+/**
+ * Components_Module_Document:: generates HTML documentation for a
+ * component.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Horde
+ * @package Components
+ * @author Gunnar Wrobel