--- /dev/null
+<?php //Need to fix the template type recognition in components. ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title><?php echo 'Component: "' . $package->getName() . '": ' . $package->getSummary(); ?></title>
+
+ <link href="http://dev.horde.org/routes/stylesheets/screen.css" media="screen" rel="stylesheet" type="text/css" />
+
+</head>
+<body id="contents_home">
+ <div id="wrapper">
+
+ <div id="header" class="clr">
+ <div id="logo" class="left">
+ <span>
+ <img alt="Horde/Routes" src="http://dev.horde.org/routes/images/common/logo.gif" />
+ </span>
+ </div>
+ <ul id="nav" class="right">
+ <li>Home</li>
+ <li><a href="install.html">Install</a></li>
+ </ul>
+ </div>
+
+ <div id="content" class="clr">
+
+ <h1>Component "<?php echo $package->getName(); ?>"</h1>
+
+ <div id="main">
+ <p class="top">
+ <?php echo $package->getDescription(); ?>
+ </p>
+ </div> <!-- /main -->
+
+ <div id="sidebar">
+ <div class="side_item">
+ <h4>Latest Version</h4>
+ <p><a href="install.html">Version <?php echo $package->getVersion(); ?></a></p>
+ <div class="side_bottom"> </div>
+ </div>
+
+ <div class="side_item">
+ <h4>Developers</h4>
+ <?php foreach ($package->getLeads() as $lead): ?>
+ <p>
+ <a href="mailto:<?php echo $lead['email']; ?>"><?php echo $lead['name'] ?></a>
+ </p>
+ <?php endforeach; ?>
+
+ <div class="side_bottom"> </div>
+ </div>
+
+ <div class="side_item">
+ <h4>License</h4>
+ <p>
+ <?php echo $package->getName(); ?> is free software, covered by a standard <a href="<?php $loc = $package->getLicenseLocation(); echo $loc['uri']; ?>"><?php echo $package->getLicense(); ?></a>.
+ </p>
+ <div class="side_bottom"> </div>
+ </div>
+</div>
+
+
+ </div>
+
+ <div id="footer" class="clr">
+ <span class="right">
+ <?php echo $package->getName();?> is part of the <a href="http://www.horde.org">Horde Project</a>.
+ </span>
+ </div>
+
+
+
+ </div>
+</body>
+</html>
--- /dev/null
+<?php //Need to fix the template type recognition in components. ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title><?php echo 'Component: "' . $package->getName() . '": Installation'; ?></title>
+
+ <link href="http://dev.horde.org/routes/stylesheets/screen.css" media="screen" rel="stylesheet" type="text/css" />
+
+</head>
+<body id="contents_home">
+ <div id="wrapper">
+
+ <div id="header" class="clr">
+ <div id="logo" class="left">
+ <span>
+ <img alt="Horde/Routes" src="http://dev.horde.org/routes/images/common/logo.gif" />
+ </span>
+ </div>
+ <ul id="nav" class="right">
+ <li><a href="index.html">Home</a></li>
+ <li>Install</li>
+ </ul>
+ </div>
+
+ <div id="content" class="clr">
+
+ <h1>Installation"</h1>
+
+ <div id="main">
+ <p class="top">
+ <pre>
+ <?php echo 'pear install horde/' . $package->getName(); ?>
+ </pre>
+ </p>
+ </div> <!-- /main -->
+
+ <div id="sidebar">
+ <div class="side_item">
+ <h4>Latest Version</h4>
+ <p><a href="install.html">Version <?php echo $package->getVersion(); ?></a></p>
+ <div class="side_bottom"> </div>
+ </div>
+
+ <div class="side_item">
+ <h4>Developers</h4>
+ <?php foreach ($package->getLeads() as $lead): ?>
+ <p>
+ <a href="mailto:<?php echo $lead['email']; ?>"><?php echo $lead['name'] ?></a>
+ </p>
+ <?php endforeach; ?>
+
+ <div class="side_bottom"> </div>
+ </div>
+
+ <div class="side_item">
+ <h4>License</h4>
+ <p>
+ <?php echo $package->getName(); ?> is free software, covered by a standard <a href="<?php $loc = $package->getLicenseLocation(); echo $loc['uri']; ?>"><?php echo $package->getLicense(); ?></a>.
+ </p>
+ <div class="side_bottom"> </div>
+ </div>
+</div>
+
+
+ </div>
+
+ <div id="footer" class="clr">
+ <span class="right">
+ <?php echo $package->getName();?> is part of the <a href="http://www.horde.org">Horde Project</a>.
+ </span>
+ </div>
+
+
+
+ </div>
+</body>
+</html>
}
/**
+ * Return the license location for this package.
+ *
+ * @return string The package license location.
+ */
+ public function getLicenseLocation()
+ {
+ return $this->_getPackageFile()->getLicenseLocation();
+ }
+
+ /**
* Return the summary for this package.
*
* @return string The package summary.
}
/**
+ * Return the leads for this package.
+ *
+ * @return string The package leads.
+ */
+ public function getLeads()
+ {
+ return $this->_getPackageFile()->getLeads();
+ }
+
+ /**
+ * Return the maintainers for this package.
+ *
+ * @return string The package maintainers.
+ */
+ public function getMaintainers()
+ {
+ return $this->_getPackageFile()->getMaintainers();
+ }
+
+ /**
* Return the list of files that should be installed for this package.
*
* @return array The file list.
--- /dev/null
+<?php
+/**
+ * Components_Runner_Document:: generates documentation for a component.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package Components
+ * @author Gunnar Wrobel <wrobel@pardus.de>
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link http://pear.horde.org/index.php?package=Components
+ */
+
+/**
+ * Components_Runner_Document:: generates documentation for a component.
+ *
+ * Copyright 2011 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 <wrobel@pardus.de>
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link http://pear.horde.org/index.php?package=Components
+ */
+class Components_Runner_Document
+{
+ /**
+ * The configuration for the current job.
+ *
+ * @var Components_Config
+ */
+ private $_config;
+
+ /**
+ * The application configuration.
+ *
+ * @var Components_Config_Application
+ */
+ private $_config_application;
+
+ /**
+ * The factory for PEAR dependencies.
+ *
+ * @var Components_Pear_Factory
+ */
+ private $_factory;
+
+ /**
+ * Constructor.
+ *
+ * @param Components_Config $config The configuration for the current job.
+ * @param Components_Config_Application $cfgapp The application
+ * configuration.
+ * @param Components_Pear_Factory $factory The factory for PEAR
+ * dependencies.
+ */
+ public function __construct(
+ Components_Config $config,
+ Components_Config_Application $cfgapp,
+ Components_Pear_Factory $factory
+ ) {
+ $this->_config = $config;
+ $this->_config_application = $cfgapp;
+ $this->_factory = $factory;
+ }
+
+ public function run()
+ {
+ $options = $this->_config->getOptions();
+ $arguments = $this->_config->getArguments();
+
+ if (!isset($options['pearrc'])) {
+ $package = $this->_factory->createPackageForDefaultLocation(
+ $arguments[0] . DIRECTORY_SEPARATOR . 'package.xml'
+ );
+ } else {
+ $package = $this->_factory->createPackageForInstallLocation(
+ $arguments[0] . DIRECTORY_SEPARATOR . 'package.xml',
+ $options['pearrc']
+ );
+ }
+
+ $build_template = new Components_Helper_Templates_Directory(
+ $this->_config_application->getTemplateDirectory(),
+ $options['document']
+ );
+ $build_template->write(
+ array('package' => $package)
+ );
+
+ }
+}
->when('calling the package with the help option')
->then('the help will contain the option', '-O\s*DOCUMENT,\s*--document=DOCUMENT');
}
+
+ /**
+ * @scenario
+ */
+ public function theTheOOptionGeneratesHtmlDocumentation()
+ {
+ $this->given('the default Components setup')
+ ->when('calling the package with the document option and a path to a Horde framework component')
+ ->then('the package documentation will be generated at the indicated location');
+ }
}
\ No newline at end of file
);
$world['output'] = $this->_callUnstrictComponents();
break;
+ case 'calling the package with the document option and a path to a Horde framework component':
+ $_SERVER['argv'] = array(
+ 'horde-components',
+ '--templatedir=' . dirname(__FILE__) . '/fixture/templates/html',
+ '--document=' . $this->_getTemporaryDirectory(),
+ dirname(__FILE__) . '/fixture/framework/Install'
+ );
+ $world['output'] = $this->_callUnstrictComponents();
+ break;
default:
return $this->notImplemented($action);
}
)
);
break;
+ case 'the package documentation will be generated at the indicated location':
+ $this->assertTrue(
+ file_exists(
+ $this->_temp_dir . DIRECTORY_SEPARATOR
+ . 'index.html'
+ )
+ );
+ $this->assertTrue(
+ file_exists(
+ $this->_temp_dir . DIRECTORY_SEPARATOR
+ . 'install.html'
+ )
+ );
+ break;
case 'the output should indicate an invalid package.xml':
$this->assertContains(
'PEAR_Packagefile_v2::toTgz: invalid package.xml',
--- /dev/null
+<?php //Need to fix the template type recognition in components. ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title><?php echo 'Component: "' . $package->getName() . '": ' . $package->getSummary(); ?></title>
+
+ <link href="http://dev.horde.org/routes/stylesheets/screen.css" media="screen" rel="stylesheet" type="text/css" />
+
+</head>
+<body id="contents_home">
+ <div id="wrapper">
+
+ <div id="header" class="clr">
+ <div id="logo" class="left">
+ <span>
+ <img alt="Horde/Routes" src="http://dev.horde.org/routes/images/common/logo.gif" />
+ </span>
+ </div>
+ <ul id="nav" class="right">
+ <li>Home</li>
+ <li><a href="install.html">Install</a></li>
+ </ul>
+ </div>
+
+ <div id="content" class="clr">
+
+ <h1>Component "<?php echo $package->getName(); ?>"</h1>
+
+ <div id="main">
+ <p class="top">
+ <?php echo $package->getDescription(); ?>
+ </p>
+ </div> <!-- /main -->
+
+ <div id="sidebar">
+ <div class="side_item">
+ <h4>Latest Version</h4>
+ <p><a href="install.html">Version <?php echo $package->getVersion(); ?></a></p>
+ <div class="side_bottom"> </div>
+ </div>
+
+ <div class="side_item">
+ <h4>Developers</h4>
+ <?php foreach ($package->getLeads() as $lead): ?>
+ <p>
+ <a href="mailto:<?php echo $lead['email']; ?>"><?php echo $lead['name'] ?></a>
+ </p>
+ <?php endforeach; ?>
+
+ <div class="side_bottom"> </div>
+ </div>
+
+ <div class="side_item">
+ <h4>License</h4>
+ <p>
+ <?php echo $package->getName(); ?> is free software, covered by a standard <a href="<?php $loc = $package->getLicenseLocation(); echo $loc['uri']; ?>"><?php echo $package->getLicense(); ?></a>.
+ </p>
+ <div class="side_bottom"> </div>
+ </div>
+</div>
+
+
+ </div>
+
+ <div id="footer" class="clr">
+ <span class="right">
+ <?php echo $package->getName();?> is part of the <a href="http://www.horde.org">Horde Project</a>.
+ </span>
+ </div>
+
+
+
+ </div>
+</body>
+</html>
--- /dev/null
+<?php //Need to fix the template type recognition in components. ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title><?php echo 'Component: "' . $package->getName() . '": Installation'; ?></title>
+
+ <link href="http://dev.horde.org/routes/stylesheets/screen.css" media="screen" rel="stylesheet" type="text/css" />
+
+</head>
+<body id="contents_home">
+ <div id="wrapper">
+
+ <div id="header" class="clr">
+ <div id="logo" class="left">
+ <span>
+ <img alt="Horde/Routes" src="http://dev.horde.org/routes/images/common/logo.gif" />
+ </span>
+ </div>
+ <ul id="nav" class="right">
+ <li><a href="index.html">Home</a></li>
+ <li>Install</li>
+ </ul>
+ </div>
+
+ <div id="content" class="clr">
+
+ <h1>Installation"</h1>
+
+ <div id="main">
+ <p class="top">
+ <pre>
+ <?php echo 'pear install horde/' . $package->getName(); ?>
+ </pre>
+ </p>
+ </div> <!-- /main -->
+
+ <div id="sidebar">
+ <div class="side_item">
+ <h4>Latest Version</h4>
+ <p><a href="install.html">Version <?php echo $package->getVersion(); ?></a></p>
+ <div class="side_bottom"> </div>
+ </div>
+
+ <div class="side_item">
+ <h4>Developers</h4>
+ <?php foreach ($package->getLeads() as $lead): ?>
+ <p>
+ <a href="mailto:<?php echo $lead['email']; ?>"><?php echo $lead['name'] ?></a>
+ </p>
+ <?php endforeach; ?>
+
+ <div class="side_bottom"> </div>
+ </div>
+
+ <div class="side_item">
+ <h4>License</h4>
+ <p>
+ <?php echo $package->getName(); ?> is free software, covered by a standard <a href="<?php $loc = $package->getLicenseLocation(); echo $loc['uri']; ?>"><?php echo $package->getLicense(); ?></a>.
+ </p>
+ <div class="side_bottom"> </div>
+ </div>
+</div>
+
+
+ </div>
+
+ <div id="footer" class="clr">
+ <span class="right">
+ <?php echo $package->getName();?> is part of the <a href="http://www.horde.org">Horde Project</a>.
+ </span>
+ </div>
+
+
+
+ </div>
+</body>
+</html>