Renamed Element to Components within the package.
authorGunnar Wrobel <p@rdus.de>
Mon, 6 Sep 2010 03:38:50 +0000 (05:38 +0200)
committerGunnar Wrobel <p@rdus.de>
Mon, 6 Sep 2010 10:46:57 +0000 (12:46 +0200)
52 files changed:
components/data/hudson-component-build.xml.template [new file with mode: 0644]
components/data/hudson-component-config.xml.template [new file with mode: 0644]
components/data/hudson-component-phpunit.xml.template [new file with mode: 0644]
components/data/hudson-element-build.xml.template [deleted file]
components/data/hudson-element-config.xml.template [deleted file]
components/data/hudson-element-phpunit.xml.template [deleted file]
components/lib/Components.php [new file with mode: 0644]
components/lib/Components/Config.php [new file with mode: 0644]
components/lib/Components/Config/Cli.php [new file with mode: 0644]
components/lib/Components/Configs.php [new file with mode: 0644]
components/lib/Components/Constants.php [new file with mode: 0644]
components/lib/Components/Exception.php [new file with mode: 0644]
components/lib/Components/Module.php [new file with mode: 0644]
components/lib/Components/Module/CiSetup.php [new file with mode: 0644]
components/lib/Components/Module/DevPackage.php [new file with mode: 0644]
components/lib/Components/Module/Installer.php [new file with mode: 0644]
components/lib/Components/Module/PearPackageXml.php [new file with mode: 0644]
components/lib/Components/Modules.php [new file with mode: 0644]
components/lib/Horde/Element.php [deleted file]
components/lib/Horde/Element/Config.php [deleted file]
components/lib/Horde/Element/Config/Cli.php [deleted file]
components/lib/Horde/Element/Configs.php [deleted file]
components/lib/Horde/Element/Constants.php [deleted file]
components/lib/Horde/Element/Exception.php [deleted file]
components/lib/Horde/Element/Module.php [deleted file]
components/lib/Horde/Element/Module/CiSetup.php [deleted file]
components/lib/Horde/Element/Module/DevPackage.php [deleted file]
components/lib/Horde/Element/Module/Installer.php [deleted file]
components/lib/Horde/Element/Module/PearPackageXml.php [deleted file]
components/lib/Horde/Element/Modules.php [deleted file]
components/script/horde-components.php [new file with mode: 0755]
components/script/horde-element.php [deleted file]
components/test/Components/AllTests.php [new file with mode: 0644]
components/test/Components/Autoload.php [new file with mode: 0644]
components/test/Components/Integration/ElementTest.php [new file with mode: 0644]
components/test/Components/StoryTestCase.php [new file with mode: 0644]
components/test/Components/Stub/Parser.php [new file with mode: 0644]
components/test/Components/fixture/empty/package.xml [new file with mode: 0644]
components/test/Components/fixture/simple/lib/New.php [new file with mode: 0644]
components/test/Components/fixture/simple/lib/Second.php [new file with mode: 0644]
components/test/Components/fixture/simple/package.xml [new file with mode: 0644]
components/test/Components/phpunit.xml [new file with mode: 0644]
components/test/Horde/Element/AllTests.php [deleted file]
components/test/Horde/Element/Autoload.php [deleted file]
components/test/Horde/Element/Integration/ElementTest.php [deleted file]
components/test/Horde/Element/StoryTestCase.php [deleted file]
components/test/Horde/Element/Stub/Parser.php [deleted file]
components/test/Horde/Element/fixture/empty/package.xml [deleted file]
components/test/Horde/Element/fixture/simple/lib/New.php [deleted file]
components/test/Horde/Element/fixture/simple/lib/Second.php [deleted file]
components/test/Horde/Element/fixture/simple/package.xml [deleted file]
components/test/Horde/Element/phpunit.xml [deleted file]

diff --git a/components/data/hudson-component-build.xml.template b/components/data/hudson-component-build.xml.template
new file mode 100644 (file)
index 0000000..6e711f2
--- /dev/null
@@ -0,0 +1,90 @@
+<project name="Kolab_Config" default="build" basedir=".">
+ <property name="tooldir" location="${basedir}/../../%1$s"/>
+
+ <target name="clean">
+  <!-- Clean up -->
+  <delete dir="build"/>
+
+  <!-- Create build directories -->
+  <mkdir dir="${basedir}/build/api"/>
+  <mkdir dir="${basedir}/build/code-browser"/>
+  <mkdir dir="${basedir}/build/coverage"/>
+  <mkdir dir="${basedir}/build/logs"/>
+  <mkdir dir="${basedir}/build/pdepend"/>
+ </target>
+
+ <!-- Run unit tests and generate junit.xml and clover.xml -->
+ <target name="phpunit">
+  <exec executable="php" failonerror="true">
+    <arg line="-c php.ini ${tooldir}/phpunit" />
+  </exec>
+ </target>
+
+ <!-- Run pdepend, phpmd, phpcpd, and phpcs in parallel -->
+ <target name="parallelTasks">
+  <parallel>
+   <antcall target="pdepend"/>
+   <antcall target="phpmd"/>
+   <antcall target="phpcpd"/>
+   <antcall target="phpcs"/>
+   <antcall target="phpdoc"/>
+  </parallel>
+ </target>
+
+ <!-- Generate jdepend.xml and software metrics charts -->
+ <target name="pdepend">
+  <exec executable="php">
+   <arg line="-c php.ini ${tooldir}/pdepend
+              --jdepend-xml=${basedir}/build/logs/jdepend.xml
+              --jdepend-chart=${basedir}/build/pdepend/dependencies.svg
+              --overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg
+              lib" />
+  </exec>
+ </target>
+
+ <!-- Generate pmd.xml -->
+ <target name="phpmd">
+  <exec executable="php">
+   <arg line="-c php.ini ${tooldir}/phpmd
+              lib xml codesize,unusedcode --reportfile ${basedir}/build/logs/pmd.xml" />
+  </exec>
+ </target>
+
+ <!-- Generate pmd-cpd.xml -->
+ <target name="phpcpd">
+  <exec executable="php">
+   <arg line="-c php.ini ${tooldir}/phpcpd
+              --log-pmd ${basedir}/build/logs/pmd-cpd.xml lib" />
+  </exec>
+ </target>
+
+ <!-- Generate checkstyle.xml -->
+ <target name="phpcs">
+  <exec executable="php" output="/dev/null">
+   <arg line="-c php.ini ${tooldir}/phpcs
+              --report=checkstyle
+              --report-file=${basedir}/build/logs/checkstyle.xml
+              --standard=Horde
+              lib" />
+  </exec>
+ </target>
+
+ <!-- Generate API documentation -->
+ <target name="phpdoc">
+  <exec executable="php">
+   <arg line="-c php.ini ${tooldir}/phpdoc --
+              -d lib -t build/api" />
+  </exec>
+ </target>
+
+ <target name="phpcb">
+  <exec executable="php">
+   <arg line="-c php.ini ${tooldir}/phpcb
+              --log=${basedir}/build/logs
+              --source=${basedir}/lib
+              --output=${basedir}/build/code-browser" />
+  </exec>
+ </target>
+
+ <target name="build" depends="clean,pdepend,phpcpd,phpcs,phpdoc,phpmd,phpunit,phpcb"/>
+</project>
diff --git a/components/data/hudson-component-config.xml.template b/components/data/hudson-component-config.xml.template
new file mode 100644 (file)
index 0000000..5ab789d
--- /dev/null
@@ -0,0 +1,264 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<project>
+  <actions/>
+  <description>%4$s</description>
+  <logRotator>
+    <daysToKeep>5</daysToKeep>
+    <numToKeep>10</numToKeep>
+    <artifactDaysToKeep>-1</artifactDaysToKeep>
+    <artifactNumToKeep>-1</artifactNumToKeep>
+  </logRotator>
+  <keepDependencies>false</keepDependencies>
+  <properties/>
+  <scm class="hudson.scm.NullSCM"/>
+  <canRoam>true</canRoam>
+  <disabled>false</disabled>
+  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
+  <triggers class="vector"/>
+  <concurrentBuild>false</concurrentBuild>
+  <builders>
+    <hudson.tasks.Shell>
+      <command>cp -r ${WORKSPACE}/../../%2$s/workspace/%1$s/* ${WORKSPACE}/
+echo &quot;include_path = \&quot;.:${WORKSPACE}/../../%3$s/php\&quot;&quot; &gt; ${WORKSPACE}/php.ini
+rm -rf ${WORKSPACE}/deps
+mkdir ${WORKSPACE}/deps
+php -c php.ini ${WORKSPACE}/../../%3$s/horde-element --install=${WORKSPACE}/deps ${WORKSPACE}/../../%2$s/workspace/%1$s
+php -c php.ini ${WORKSPACE}/../../%3$s/horde-element --ciprebuild=${WORKSPACE} ${WORKSPACE}/../../%2$s/workspace/%1$s
+echo &quot;include_path = \&quot;.:${WORKSPACE}/lib:${WORKSPACE}/deps/pear/php:${WORKSPACE}/../../%3$s/php\&quot;&quot; &gt; ${WORKSPACE}/php.ini
+    </command>
+    </hudson.tasks.Shell>
+    <hudson.tasks.Ant>
+      <targets></targets>
+    </hudson.tasks.Ant>
+  </builders>
+  <publishers>
+    <hudson.plugins.pmd.PmdPublisher>
+      <threshold></threshold>
+      <newThreshold></newThreshold>
+      <failureThreshold></failureThreshold>
+      <newFailureThreshold></newFailureThreshold>
+      <healthy></healthy>
+      <unHealthy></unHealthy>
+      <pluginName>[PMD] </pluginName>
+      <thresholdLimit>low</thresholdLimit>
+      <defaultEncoding></defaultEncoding>
+      <useDeltaValues>false</useDeltaValues>
+      <canRunOnFailed>false</canRunOnFailed>
+      <pattern>build/logs/pmd.xml</pattern>
+    </hudson.plugins.pmd.PmdPublisher>
+    <hudson.plugins.checkstyle.CheckStylePublisher>
+      <threshold></threshold>
+      <newThreshold></newThreshold>
+      <failureThreshold></failureThreshold>
+      <newFailureThreshold></newFailureThreshold>
+      <healthy></healthy>
+      <unHealthy></unHealthy>
+      <pluginName>[CHECKSTYLE] </pluginName>
+      <thresholdLimit>low</thresholdLimit>
+      <defaultEncoding></defaultEncoding>
+      <useDeltaValues>false</useDeltaValues>
+      <canRunOnFailed>false</canRunOnFailed>
+      <pattern>build/logs/checkstyle.xml</pattern>
+    </hudson.plugins.checkstyle.CheckStylePublisher>
+    <hudson.plugins.dry.DryPublisher>
+      <threshold></threshold>
+      <newThreshold></newThreshold>
+      <failureThreshold></failureThreshold>
+      <newFailureThreshold></newFailureThreshold>
+      <healthy></healthy>
+      <unHealthy></unHealthy>
+      <pluginName>[DRY] </pluginName>
+      <thresholdLimit>low</thresholdLimit>
+      <defaultEncoding></defaultEncoding>
+      <useDeltaValues>false</useDeltaValues>
+      <canRunOnFailed>false</canRunOnFailed>
+      <pattern>build/logs/pmd-cpd.xml</pattern>
+      <highThreshold>50</highThreshold>
+      <normalThreshold>25</normalThreshold>
+    </hudson.plugins.dry.DryPublisher>
+    <hudson.plugins.jdepend.JDependRecorder>
+      <configuredJDependFile>build/logs/jdepend.xml</configuredJDependFile>
+    </hudson.plugins.jdepend.JDependRecorder>
+    <hudson.plugins.clover.CloverPublisher>
+      <cloverReportDir>build/logs</cloverReportDir>
+      <cloverReportFileName>clover.xml</cloverReportFileName>
+      <healthyTarget>
+        <methodCoverage>70</methodCoverage>
+        <conditionalCoverage>80</conditionalCoverage>
+        <statementCoverage>80</statementCoverage>
+      </healthyTarget>
+      <unhealthyTarget/>
+      <failingTarget/>
+    </hudson.plugins.clover.CloverPublisher>
+    <hudson.plugins.violations.ViolationsPublisher>
+      <config>
+        <suppressions class="tree-set">
+          <no-comparator/>
+        </suppressions>
+        <typeConfigs>
+          <no-comparator/>
+          <entry>
+            <string>checkstyle</string>
+            <hudson.plugins.violations.TypeConfig>
+              <type>checkstyle</type>
+              <min>10</min>
+              <max>999</max>
+              <unstable>999</unstable>
+              <usePattern>false</usePattern>
+              <pattern>build/logs/checkstyle.xml</pattern>
+            </hudson.plugins.violations.TypeConfig>
+          </entry>
+          <entry>
+            <string>cpd</string>
+            <hudson.plugins.violations.TypeConfig>
+              <type>cpd</type>
+              <min>10</min>
+              <max>999</max>
+              <unstable>999</unstable>
+              <usePattern>false</usePattern>
+              <pattern>build/logs/pmd-cpd.xml</pattern>
+            </hudson.plugins.violations.TypeConfig>
+          </entry>
+          <entry>
+            <string>findbugs</string>
+            <hudson.plugins.violations.TypeConfig>
+              <type>findbugs</type>
+              <min>10</min>
+              <max>999</max>
+              <unstable>999</unstable>
+              <usePattern>false</usePattern>
+              <pattern></pattern>
+            </hudson.plugins.violations.TypeConfig>
+          </entry>
+          <entry>
+            <string>fxcop</string>
+            <hudson.plugins.violations.TypeConfig>
+              <type>fxcop</type>
+              <min>10</min>
+              <max>999</max>
+              <unstable>999</unstable>
+              <usePattern>false</usePattern>
+              <pattern></pattern>
+            </hudson.plugins.violations.TypeConfig>
+          </entry>
+          <entry>
+            <string>gendarme</string>
+            <hudson.plugins.violations.TypeConfig>
+              <type>gendarme</type>
+              <min>10</min>
+              <max>999</max>
+              <unstable>999</unstable>
+              <usePattern>false</usePattern>
+              <pattern></pattern>
+            </hudson.plugins.violations.TypeConfig>
+          </entry>
+          <entry>
+            <string>jcreport</string>
+            <hudson.plugins.violations.TypeConfig>
+              <type>jcreport</type>
+              <min>10</min>
+              <max>999</max>
+              <unstable>999</unstable>
+              <usePattern>false</usePattern>
+              <pattern></pattern>
+            </hudson.plugins.violations.TypeConfig>
+          </entry>
+          <entry>
+            <string>jslint</string>
+            <hudson.plugins.violations.TypeConfig>
+              <type>jslint</type>
+              <min>10</min>
+              <max>999</max>
+              <unstable>999</unstable>
+              <usePattern>false</usePattern>
+              <pattern></pattern>
+            </hudson.plugins.violations.TypeConfig>
+          </entry>
+          <entry>
+            <string>pmd</string>
+            <hudson.plugins.violations.TypeConfig>
+              <type>pmd</type>
+              <min>10</min>
+              <max>999</max>
+              <unstable>999</unstable>
+              <usePattern>false</usePattern>
+              <pattern>build/logs/pmd.xml</pattern>
+            </hudson.plugins.violations.TypeConfig>
+          </entry>
+          <entry>
+            <string>pylint</string>
+            <hudson.plugins.violations.TypeConfig>
+              <type>pylint</type>
+              <min>10</min>
+              <max>999</max>
+              <unstable>999</unstable>
+              <usePattern>false</usePattern>
+              <pattern></pattern>
+            </hudson.plugins.violations.TypeConfig>
+          </entry>
+          <entry>
+            <string>simian</string>
+            <hudson.plugins.violations.TypeConfig>
+              <type>simian</type>
+              <min>10</min>
+              <max>999</max>
+              <unstable>999</unstable>
+              <usePattern>false</usePattern>
+              <pattern></pattern>
+            </hudson.plugins.violations.TypeConfig>
+          </entry>
+          <entry>
+            <string>stylecop</string>
+            <hudson.plugins.violations.TypeConfig>
+              <type>stylecop</type>
+              <min>10</min>
+              <max>999</max>
+              <unstable>999</unstable>
+              <usePattern>false</usePattern>
+              <pattern></pattern>
+            </hudson.plugins.violations.TypeConfig>
+          </entry>
+        </typeConfigs>
+        <limit>100</limit>
+        <sourcePathPattern></sourcePathPattern>
+        <fauxProjectPath></fauxProjectPath>
+        <encoding>default</encoding>
+      </config>
+    </hudson.plugins.violations.ViolationsPublisher>
+    <htmlpublisher.HtmlPublisher>
+      <reportTargets>
+        <htmlpublisher.HtmlPublisherTarget>
+          <reportName>API Documentation</reportName>
+          <reportDir>build/api</reportDir>
+          <reportFiles>index.html</reportFiles>
+          <keepAll>false</keepAll>
+          <wrapperName>htmlpublisher-wrapper.html</wrapperName>
+        </htmlpublisher.HtmlPublisherTarget>
+        <htmlpublisher.HtmlPublisherTarget>
+          <reportName>Code Browser</reportName>
+          <reportDir>build/code-browser</reportDir>
+          <reportFiles>index.html</reportFiles>
+          <keepAll>false</keepAll>
+          <wrapperName>htmlpublisher-wrapper.html</wrapperName>
+        </htmlpublisher.HtmlPublisherTarget>
+        <htmlpublisher.HtmlPublisherTarget>
+          <reportName>Code Coverage</reportName>
+          <reportDir>build/coverage</reportDir>
+          <reportFiles>index.html</reportFiles>
+          <keepAll>false</keepAll>
+          <wrapperName>htmlpublisher-wrapper.html</wrapperName>
+        </htmlpublisher.HtmlPublisherTarget>
+      </reportTargets>
+    </htmlpublisher.HtmlPublisher>
+    <com.thalesgroup.hudson.plugins.xunit.XUnitPublisher>
+      <types>
+        <com.thalesgroup.dtkit.metrics.hudson.model.PHPUnitHudsonTestType>
+          <pattern>build/logs/junit.xml</pattern>
+          <faildedIfNotNew>true</faildedIfNotNew>
+          <deleteOutputFiles>true</deleteOutputFiles>
+        </com.thalesgroup.dtkit.metrics.hudson.model.PHPUnitHudsonTestType>
+      </types>
+    </com.thalesgroup.hudson.plugins.xunit.XUnitPublisher>
+  </publishers>
+  <buildWrappers/>
+</project>
diff --git a/components/data/hudson-component-phpunit.xml.template b/components/data/hudson-component-phpunit.xml.template
new file mode 100644 (file)
index 0000000..5a7fa06
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<phpunit backupGlobals="false"
+         backupStaticAttributes="false"
+         syntaxCheck="false">
+  <testsuites>
+    <testsuite name="Horde_%1$s_AllTests">
+      <directory suffix="AllTests.php">test/Horde/%2$s</directory>
+    </testsuite>
+  </testsuites>
+
+  <logging>
+    <log type="coverage-html" target="build/coverage" title="%1$s"
+         charset="UTF-8" yui="true" highlight="true"
+         lowUpperBound="35" highLowerBound="80"/>
+    <log type="coverage-clover" target="build/logs/clover.xml"/>
+    <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
+  </logging>
+
+  <filter>
+    <whitelist addUncoveredFilesFromWhitelist="true">
+      <directory suffix=".php">lib</directory>
+    </whitelist>
+  </filter>
+</phpunit>
diff --git a/components/data/hudson-element-build.xml.template b/components/data/hudson-element-build.xml.template
deleted file mode 100644 (file)
index 6e711f2..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-<project name="Kolab_Config" default="build" basedir=".">
- <property name="tooldir" location="${basedir}/../../%1$s"/>
-
- <target name="clean">
-  <!-- Clean up -->
-  <delete dir="build"/>
-
-  <!-- Create build directories -->
-  <mkdir dir="${basedir}/build/api"/>
-  <mkdir dir="${basedir}/build/code-browser"/>
-  <mkdir dir="${basedir}/build/coverage"/>
-  <mkdir dir="${basedir}/build/logs"/>
-  <mkdir dir="${basedir}/build/pdepend"/>
- </target>
-
- <!-- Run unit tests and generate junit.xml and clover.xml -->
- <target name="phpunit">
-  <exec executable="php" failonerror="true">
-    <arg line="-c php.ini ${tooldir}/phpunit" />
-  </exec>
- </target>
-
- <!-- Run pdepend, phpmd, phpcpd, and phpcs in parallel -->
- <target name="parallelTasks">
-  <parallel>
-   <antcall target="pdepend"/>
-   <antcall target="phpmd"/>
-   <antcall target="phpcpd"/>
-   <antcall target="phpcs"/>
-   <antcall target="phpdoc"/>
-  </parallel>
- </target>
-
- <!-- Generate jdepend.xml and software metrics charts -->
- <target name="pdepend">
-  <exec executable="php">
-   <arg line="-c php.ini ${tooldir}/pdepend
-              --jdepend-xml=${basedir}/build/logs/jdepend.xml
-              --jdepend-chart=${basedir}/build/pdepend/dependencies.svg
-              --overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg
-              lib" />
-  </exec>
- </target>
-
- <!-- Generate pmd.xml -->
- <target name="phpmd">
-  <exec executable="php">
-   <arg line="-c php.ini ${tooldir}/phpmd
-              lib xml codesize,unusedcode --reportfile ${basedir}/build/logs/pmd.xml" />
-  </exec>
- </target>
-
- <!-- Generate pmd-cpd.xml -->
- <target name="phpcpd">
-  <exec executable="php">
-   <arg line="-c php.ini ${tooldir}/phpcpd
-              --log-pmd ${basedir}/build/logs/pmd-cpd.xml lib" />
-  </exec>
- </target>
-
- <!-- Generate checkstyle.xml -->
- <target name="phpcs">
-  <exec executable="php" output="/dev/null">
-   <arg line="-c php.ini ${tooldir}/phpcs
-              --report=checkstyle
-              --report-file=${basedir}/build/logs/checkstyle.xml
-              --standard=Horde
-              lib" />
-  </exec>
- </target>
-
- <!-- Generate API documentation -->
- <target name="phpdoc">
-  <exec executable="php">
-   <arg line="-c php.ini ${tooldir}/phpdoc --
-              -d lib -t build/api" />
-  </exec>
- </target>
-
- <target name="phpcb">
-  <exec executable="php">
-   <arg line="-c php.ini ${tooldir}/phpcb
-              --log=${basedir}/build/logs
-              --source=${basedir}/lib
-              --output=${basedir}/build/code-browser" />
-  </exec>
- </target>
-
- <target name="build" depends="clean,pdepend,phpcpd,phpcs,phpdoc,phpmd,phpunit,phpcb"/>
-</project>
diff --git a/components/data/hudson-element-config.xml.template b/components/data/hudson-element-config.xml.template
deleted file mode 100644 (file)
index 5ab789d..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<project>
-  <actions/>
-  <description>%4$s</description>
-  <logRotator>
-    <daysToKeep>5</daysToKeep>
-    <numToKeep>10</numToKeep>
-    <artifactDaysToKeep>-1</artifactDaysToKeep>
-    <artifactNumToKeep>-1</artifactNumToKeep>
-  </logRotator>
-  <keepDependencies>false</keepDependencies>
-  <properties/>
-  <scm class="hudson.scm.NullSCM"/>
-  <canRoam>true</canRoam>
-  <disabled>false</disabled>
-  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
-  <triggers class="vector"/>
-  <concurrentBuild>false</concurrentBuild>
-  <builders>
-    <hudson.tasks.Shell>
-      <command>cp -r ${WORKSPACE}/../../%2$s/workspace/%1$s/* ${WORKSPACE}/
-echo &quot;include_path = \&quot;.:${WORKSPACE}/../../%3$s/php\&quot;&quot; &gt; ${WORKSPACE}/php.ini
-rm -rf ${WORKSPACE}/deps
-mkdir ${WORKSPACE}/deps
-php -c php.ini ${WORKSPACE}/../../%3$s/horde-element --install=${WORKSPACE}/deps ${WORKSPACE}/../../%2$s/workspace/%1$s
-php -c php.ini ${WORKSPACE}/../../%3$s/horde-element --ciprebuild=${WORKSPACE} ${WORKSPACE}/../../%2$s/workspace/%1$s
-echo &quot;include_path = \&quot;.:${WORKSPACE}/lib:${WORKSPACE}/deps/pear/php:${WORKSPACE}/../../%3$s/php\&quot;&quot; &gt; ${WORKSPACE}/php.ini
-    </command>
-    </hudson.tasks.Shell>
-    <hudson.tasks.Ant>
-      <targets></targets>
-    </hudson.tasks.Ant>
-  </builders>
-  <publishers>
-    <hudson.plugins.pmd.PmdPublisher>
-      <threshold></threshold>
-      <newThreshold></newThreshold>
-      <failureThreshold></failureThreshold>
-      <newFailureThreshold></newFailureThreshold>
-      <healthy></healthy>
-      <unHealthy></unHealthy>
-      <pluginName>[PMD] </pluginName>
-      <thresholdLimit>low</thresholdLimit>
-      <defaultEncoding></defaultEncoding>
-      <useDeltaValues>false</useDeltaValues>
-      <canRunOnFailed>false</canRunOnFailed>
-      <pattern>build/logs/pmd.xml</pattern>
-    </hudson.plugins.pmd.PmdPublisher>
-    <hudson.plugins.checkstyle.CheckStylePublisher>
-      <threshold></threshold>
-      <newThreshold></newThreshold>
-      <failureThreshold></failureThreshold>
-      <newFailureThreshold></newFailureThreshold>
-      <healthy></healthy>
-      <unHealthy></unHealthy>
-      <pluginName>[CHECKSTYLE] </pluginName>
-      <thresholdLimit>low</thresholdLimit>
-      <defaultEncoding></defaultEncoding>
-      <useDeltaValues>false</useDeltaValues>
-      <canRunOnFailed>false</canRunOnFailed>
-      <pattern>build/logs/checkstyle.xml</pattern>
-    </hudson.plugins.checkstyle.CheckStylePublisher>
-    <hudson.plugins.dry.DryPublisher>
-      <threshold></threshold>
-      <newThreshold></newThreshold>
-      <failureThreshold></failureThreshold>
-      <newFailureThreshold></newFailureThreshold>
-      <healthy></healthy>
-      <unHealthy></unHealthy>
-      <pluginName>[DRY] </pluginName>
-      <thresholdLimit>low</thresholdLimit>
-      <defaultEncoding></defaultEncoding>
-      <useDeltaValues>false</useDeltaValues>
-      <canRunOnFailed>false</canRunOnFailed>
-      <pattern>build/logs/pmd-cpd.xml</pattern>
-      <highThreshold>50</highThreshold>
-      <normalThreshold>25</normalThreshold>
-    </hudson.plugins.dry.DryPublisher>
-    <hudson.plugins.jdepend.JDependRecorder>
-      <configuredJDependFile>build/logs/jdepend.xml</configuredJDependFile>
-    </hudson.plugins.jdepend.JDependRecorder>
-    <hudson.plugins.clover.CloverPublisher>
-      <cloverReportDir>build/logs</cloverReportDir>
-      <cloverReportFileName>clover.xml</cloverReportFileName>
-      <healthyTarget>
-        <methodCoverage>70</methodCoverage>
-        <conditionalCoverage>80</conditionalCoverage>
-        <statementCoverage>80</statementCoverage>
-      </healthyTarget>
-      <unhealthyTarget/>
-      <failingTarget/>
-    </hudson.plugins.clover.CloverPublisher>
-    <hudson.plugins.violations.ViolationsPublisher>
-      <config>
-        <suppressions class="tree-set">
-          <no-comparator/>
-        </suppressions>
-        <typeConfigs>
-          <no-comparator/>
-          <entry>
-            <string>checkstyle</string>
-            <hudson.plugins.violations.TypeConfig>
-              <type>checkstyle</type>
-              <min>10</min>
-              <max>999</max>
-              <unstable>999</unstable>
-              <usePattern>false</usePattern>
-              <pattern>build/logs/checkstyle.xml</pattern>
-            </hudson.plugins.violations.TypeConfig>
-          </entry>
-          <entry>
-            <string>cpd</string>
-            <hudson.plugins.violations.TypeConfig>
-              <type>cpd</type>
-              <min>10</min>
-              <max>999</max>
-              <unstable>999</unstable>
-              <usePattern>false</usePattern>
-              <pattern>build/logs/pmd-cpd.xml</pattern>
-            </hudson.plugins.violations.TypeConfig>
-          </entry>
-          <entry>
-            <string>findbugs</string>
-            <hudson.plugins.violations.TypeConfig>
-              <type>findbugs</type>
-              <min>10</min>
-              <max>999</max>
-              <unstable>999</unstable>
-              <usePattern>false</usePattern>
-              <pattern></pattern>
-            </hudson.plugins.violations.TypeConfig>
-          </entry>
-          <entry>
-            <string>fxcop</string>
-            <hudson.plugins.violations.TypeConfig>
-              <type>fxcop</type>
-              <min>10</min>
-              <max>999</max>
-              <unstable>999</unstable>
-              <usePattern>false</usePattern>
-              <pattern></pattern>
-            </hudson.plugins.violations.TypeConfig>
-          </entry>
-          <entry>
-            <string>gendarme</string>
-            <hudson.plugins.violations.TypeConfig>
-              <type>gendarme</type>
-              <min>10</min>
-              <max>999</max>
-              <unstable>999</unstable>
-              <usePattern>false</usePattern>
-              <pattern></pattern>
-            </hudson.plugins.violations.TypeConfig>
-          </entry>
-          <entry>
-            <string>jcreport</string>
-            <hudson.plugins.violations.TypeConfig>
-              <type>jcreport</type>
-              <min>10</min>
-              <max>999</max>
-              <unstable>999</unstable>
-              <usePattern>false</usePattern>
-              <pattern></pattern>
-            </hudson.plugins.violations.TypeConfig>
-          </entry>
-          <entry>
-            <string>jslint</string>
-            <hudson.plugins.violations.TypeConfig>
-              <type>jslint</type>
-              <min>10</min>
-              <max>999</max>
-              <unstable>999</unstable>
-              <usePattern>false</usePattern>
-              <pattern></pattern>
-            </hudson.plugins.violations.TypeConfig>
-          </entry>
-          <entry>
-            <string>pmd</string>
-            <hudson.plugins.violations.TypeConfig>
-              <type>pmd</type>
-              <min>10</min>
-              <max>999</max>
-              <unstable>999</unstable>
-              <usePattern>false</usePattern>
-              <pattern>build/logs/pmd.xml</pattern>
-            </hudson.plugins.violations.TypeConfig>
-          </entry>
-          <entry>
-            <string>pylint</string>
-            <hudson.plugins.violations.TypeConfig>
-              <type>pylint</type>
-              <min>10</min>
-              <max>999</max>
-              <unstable>999</unstable>
-              <usePattern>false</usePattern>
-              <pattern></pattern>
-            </hudson.plugins.violations.TypeConfig>
-          </entry>
-          <entry>
-            <string>simian</string>
-            <hudson.plugins.violations.TypeConfig>
-              <type>simian</type>
-              <min>10</min>
-              <max>999</max>
-              <unstable>999</unstable>
-              <usePattern>false</usePattern>
-              <pattern></pattern>
-            </hudson.plugins.violations.TypeConfig>
-          </entry>
-          <entry>
-            <string>stylecop</string>
-            <hudson.plugins.violations.TypeConfig>
-              <type>stylecop</type>
-              <min>10</min>
-              <max>999</max>
-              <unstable>999</unstable>
-              <usePattern>false</usePattern>
-              <pattern></pattern>
-            </hudson.plugins.violations.TypeConfig>
-          </entry>
-        </typeConfigs>
-        <limit>100</limit>
-        <sourcePathPattern></sourcePathPattern>
-        <fauxProjectPath></fauxProjectPath>
-        <encoding>default</encoding>
-      </config>
-    </hudson.plugins.violations.ViolationsPublisher>
-    <htmlpublisher.HtmlPublisher>
-      <reportTargets>
-        <htmlpublisher.HtmlPublisherTarget>
-          <reportName>API Documentation</reportName>
-          <reportDir>build/api</reportDir>
-          <reportFiles>index.html</reportFiles>
-          <keepAll>false</keepAll>
-          <wrapperName>htmlpublisher-wrapper.html</wrapperName>
-        </htmlpublisher.HtmlPublisherTarget>
-        <htmlpublisher.HtmlPublisherTarget>
-          <reportName>Code Browser</reportName>
-          <reportDir>build/code-browser</reportDir>
-          <reportFiles>index.html</reportFiles>
-          <keepAll>false</keepAll>
-          <wrapperName>htmlpublisher-wrapper.html</wrapperName>
-        </htmlpublisher.HtmlPublisherTarget>
-        <htmlpublisher.HtmlPublisherTarget>
-          <reportName>Code Coverage</reportName>
-          <reportDir>build/coverage</reportDir>
-          <reportFiles>index.html</reportFiles>
-          <keepAll>false</keepAll>
-          <wrapperName>htmlpublisher-wrapper.html</wrapperName>
-        </htmlpublisher.HtmlPublisherTarget>
-      </reportTargets>
-    </htmlpublisher.HtmlPublisher>
-    <com.thalesgroup.hudson.plugins.xunit.XUnitPublisher>
-      <types>
-        <com.thalesgroup.dtkit.metrics.hudson.model.PHPUnitHudsonTestType>
-          <pattern>build/logs/junit.xml</pattern>
-          <faildedIfNotNew>true</faildedIfNotNew>
-          <deleteOutputFiles>true</deleteOutputFiles>
-        </com.thalesgroup.dtkit.metrics.hudson.model.PHPUnitHudsonTestType>
-      </types>
-    </com.thalesgroup.hudson.plugins.xunit.XUnitPublisher>
-  </publishers>
-  <buildWrappers/>
-</project>
diff --git a/components/data/hudson-element-phpunit.xml.template b/components/data/hudson-element-phpunit.xml.template
deleted file mode 100644 (file)
index 5a7fa06..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit backupGlobals="false"
-         backupStaticAttributes="false"
-         syntaxCheck="false">
-  <testsuites>
-    <testsuite name="Horde_%1$s_AllTests">
-      <directory suffix="AllTests.php">test/Horde/%2$s</directory>
-    </testsuite>
-  </testsuites>
-
-  <logging>
-    <log type="coverage-html" target="build/coverage" title="%1$s"
-         charset="UTF-8" yui="true" highlight="true"
-         lowUpperBound="35" highLowerBound="80"/>
-    <log type="coverage-clover" target="build/logs/clover.xml"/>
-    <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
-  </logging>
-
-  <filter>
-    <whitelist addUncoveredFilesFromWhitelist="true">
-      <directory suffix=".php">lib</directory>
-    </whitelist>
-  </filter>
-</phpunit>
diff --git a/components/lib/Components.php b/components/lib/Components.php
new file mode 100644 (file)
index 0000000..70816d7
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+/**
+ * The Horde_Element:: class is the entry point for the various Horde
+ * element actions provided by the package.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * The Horde_Element:: class is the entry point for the various Horde
+ * element actions provided by the package.
+ *
+ * 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  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element
+{
+    /**
+     * The main entry point for the application.
+     *
+     * @param array $parameters A list of named configuration parameters.
+     * <pre>
+     * 'cli'        - (array)  CLI configuration parameters.
+     *   'parser'   - (array)  Parser configuration parameters.
+     *     'class'  - (string) The class name of the parser to use.
+     * </pre>
+     */
+    static public function main(array $parameters = array())
+    {
+        $parser = self::_prepareParser($parameters);
+        $config = self::_prepareConfig($parser);
+        $modules = self::_prepareModules();
+        $config->handleModules($modules);
+        try {
+            self::_validateArguments($config);
+        } catch (Horde_Element_Exception $e) {
+            $parser->parserError($e->getMessage());
+            return;
+        }
+        foreach ($modules as $module) {
+            $module->handle($config);
+        }
+    }
+
+    static private function _prepareParser(array $parameters = array())
+    {
+        if (empty($parameters['cli']['parser']['class'])) {
+            $parser_class = 'Horde_Argv_Parser';
+        } else {
+            $parser_class = $parameters['cli']['parser']['class'];
+        }
+        return new $parser_class(
+            array(
+                'usage' => '%prog ' . _("[options] PACKAGE_PATH")
+            )
+        );
+    }
+
+    static private function _prepareConfig(Horde_Argv_Parser $parser)
+    {
+        $config = new Horde_Element_Configs();
+        $config->addConfigurationType(
+            new Horde_Element_Config_Cli(
+                $parser
+            )
+        );
+        return $config;
+    }
+
+    static private function _prepareModules()
+    {
+        $modules = new Horde_Element_Modules();
+        $modules->addModulesFromDirectory(dirname(__FILE__) . '/Element/Module');
+        return $modules;
+    }
+
+    static private function _validateArguments(Horde_Element_Config $config)
+    {
+        $arguments = $config->getArguments();
+        if (empty($arguments[0])) {
+            throw new Horde_Element_Exception('Please specify the path of the PEAR package!');
+        }
+
+        if (!is_dir($arguments[0])) {
+            throw new Horde_Element_Exception(sprintf('%s specifies no directory!', $arguments[0]));
+        }
+
+        if (!file_exists($arguments[0] . '/package.xml')) {
+            throw new Horde_Element_Exception(sprintf('There is no package.xml at %s!', $arguments[0]));
+        }
+    }
+}
\ No newline at end of file
diff --git a/components/lib/Components/Config.php b/components/lib/Components/Config.php
new file mode 100644 (file)
index 0000000..da22e46
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Horde_Element_Config:: interface represents a configuration type for the Horde
+ * element tool.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * Horde_Element_Config:: interface represents a configuration type for the Horde
+ * element tool.
+ *
+ * Copyright 2009-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  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+interface Horde_Element_Config
+{
+    /**
+     * Provide each configuration handler with the list of supported modules.
+     *
+     * @param Horde_Element_Modules $modules A list of modules.
+     * @return NULL
+     */
+    public function handleModules(Horde_Element_Modules $modules);
+
+    /**
+     * Return the options provided by the configuration handlers.
+     *
+     * @return array An array of options.
+     */
+    public function getOptions();
+
+    /**
+     * Return the arguments provided by the configuration handlers.
+     *
+     * @return array An array of arguments.
+     */
+    public function getArguments();
+}
\ No newline at end of file
diff --git a/components/lib/Components/Config/Cli.php b/components/lib/Components/Config/Cli.php
new file mode 100644 (file)
index 0000000..6f63f94
--- /dev/null
@@ -0,0 +1,119 @@
+<?php
+/**
+ * Horde_Element_Config_Cli:: class provides the command line interface for the Horde
+ * element tool.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * Horde_Element_Config_Cli:: class provides the command line interface for the Horde
+ * element tool.
+ *
+ * Copyright 2009-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  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element_Config_Cli
+implements Horde_Element_Config
+{
+    /**
+     * The command line argument parser.
+     *
+     * @var Horde_Argv_Parser
+     */
+    private $_parser;
+
+    /**
+     * The options parsed from the command line.
+     *
+     * @var array
+     */
+    private $_options;
+
+    /**
+     * Any additional arguments parsed from the command line.
+     *
+     * @var array
+     */
+    private $_arguments;
+
+    /**
+     * Constructor.
+     *
+     */
+    public function __construct(
+        Horde_Argv_Parser $parser
+    ) {
+        $this->_parser = $parser;
+    }
+
+    /**
+     * Load the options for the list of supported modules.
+     *
+     * @param Horde_Element_Modules $modules A list of modules.
+     * @return NULL
+     */
+    public function handleModules(Horde_Element_Modules $modules)
+    {
+        foreach ($modules as $module) {
+            $this->_addOptionsFromModule($this->_parser, $module);
+        }
+
+        list($this->_options, $this->_arguments) = $this->_parser->parseArgs();
+    }
+
+    /**
+     * Return the options parsed from the command line.
+     *
+     * @return Horde_Argv_Values The option values.
+     */
+    public function getOptions()
+    {
+        return $this->_options;
+    }
+
+    /**
+     * Return the arguments parsed from the command line.
+     *
+     * @return array An array of arguments.
+     */
+    public function getArguments()
+    {
+        return $this->_arguments;
+    }
+
+    /**
+     * Add an option group from the provided module to the parser.
+     *
+     * @param Horde_Argv_Parser $parser The parser.
+     * @param Horde_Element_Module   $module The module providing the option group.
+     *
+     * @return NULL
+     */
+    private function _addOptionsFromModule($parser, $module)
+    {
+        $group = new Horde_Argv_OptionGroup(
+            $parser,
+            $module->getOptionGroupTitle(),
+            $module->getOptionGroupDescription()
+        );
+        foreach ($module->getOptionGroupOptions() as $option) {
+            $group->addOption($option);
+        }
+        $parser->addOptionGroup($group);
+    }
+}
diff --git a/components/lib/Components/Configs.php b/components/lib/Components/Configs.php
new file mode 100644 (file)
index 0000000..ee5a072
--- /dev/null
@@ -0,0 +1,108 @@
+<?php
+/**
+ * Horde_Element_Configs:: class represents configuration for the
+ * Horde element tool.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * Horde_Element_Configs:: class represents configuration for the
+ * Horde element tool.
+ *
+ * Copyright 2009-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  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element_Configs
+implements Horde_Element_Config
+{
+
+    /**
+     * The different configuration handlers.
+     *
+     * @var array
+     */
+    private $_configs;
+
+    /**
+     * Constructor.
+     */
+    public function __construct() {
+        $this->_configs = array();
+    }
+
+    /**
+     * Add a configuration type to the configuration handler.
+     *
+     * @param Horde_Element_Config $type The configuration type.
+     *
+     * @return NULL
+     */
+    public function addConfigurationType(Horde_Element_Config $type) {
+        $this->_configs[] = $type;
+    }
+
+    /**
+     * Provide each configuration handler with the list of supported modules.
+     *
+     * @param Horde_Element_Modules $modules A list of modules.
+     * @return NULL
+     */
+    public function handleModules(Horde_Element_Modules $modules)
+    {
+        foreach ($this->_configs as $config) {
+            $config->handleModules($modules);
+        }
+    }
+
+    /**
+     * Return the options provided by the configuration handlers.
+     *
+     * @return array An array of options.
+     */
+    public function getOptions()
+    {
+        $options = array();
+        foreach ($this->_configs as $config) {
+            if (count($config->getOptions()) !== 0) {
+                $config_options = array();
+                foreach ($config->getOptions() as $name => $option) {
+                    $config_options[$name] = $option;
+                }
+                $options = array_merge($options, $config_options);
+            }
+        }
+        return $options;
+    }
+
+    /**
+     * Return the arguments provided by the configuration handlers.
+     *
+     * @return array An array of arguments.
+     */
+    public function getArguments()
+    {
+        $arguments = array();
+        foreach ($this->_configs as $config) {
+            $config_arguments = $config->getArguments();
+            if (!empty($config_arguments)) {
+                $arguments = array_merge($arguments, $config_arguments);
+            }
+        }
+        return $arguments;
+    }
+}
\ No newline at end of file
diff --git a/components/lib/Components/Constants.php b/components/lib/Components/Constants.php
new file mode 100644 (file)
index 0000000..42f8e9f
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Horde_Element_Constants:: provides the constants for this package.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * Horde_Element_Constants:: provides the constants for this package.
+ *
+ * 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  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element_Constants
+{
+    const DATA_DIR = '@data_dir@';
+
+    static public function getDataDirectory()
+    {
+        if (strpos(self::DATA_DIR, '@data_dir') === 0) {
+            return join(
+                DIRECTORY_SEPARATOR,
+                array(dirname(__FILE__), '..', '..', '..', 'data')
+            );
+        }
+        return self::DATA_DIR . DIRECTORY_SEPARATOR . 'Element';
+    }
+}
diff --git a/components/lib/Components/Exception.php b/components/lib/Components/Exception.php
new file mode 100644 (file)
index 0000000..115b70a
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/**
+ * This class provides the standard error class for the Element package.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * This class provides the standard error class for the Element package.
+ *
+ * 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  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element_Exception
+extends Exception
+{
+}
diff --git a/components/lib/Components/Module.php b/components/lib/Components/Module.php
new file mode 100644 (file)
index 0000000..43a9862
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Horde_Element_Module:: represents a task for a Horde element.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * Horde_Element_Module:: represents a task for a Horde element.
+ *
+ * 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  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+interface Horde_Element_Module
+{
+    public function getOptionGroupTitle();
+
+    public function getOptionGroupDescription();
+
+    public function getOptionGroupOptions();
+
+    public function handle(Horde_Element_Config $config);
+
+    public function run(Horde_Element_Config $config);
+}
\ No newline at end of file
diff --git a/components/lib/Components/Module/CiSetup.php b/components/lib/Components/Module/CiSetup.php
new file mode 100644 (file)
index 0000000..7860466
--- /dev/null
@@ -0,0 +1,139 @@
+<?php
+/**
+ * Horde_Element_Module_CiSetup:: generates the configuration for Hudson based
+ * continuous integration of a Horde PEAR package.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * Horde_Element_Module_CiSetup:: generates the configuration for Hudson based
+ * continuous integration of a Horde PEAR package.
+ *
+ * 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  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element_Module_CiSetup
+implements Horde_Element_Module
+{
+    public function getOptionGroupTitle()
+    {
+        return 'Continuous Integration Setup';
+    }
+
+    public function getOptionGroupDescription()
+    {
+        return 'This module generates the configuration for Hudson based continuous integration of a Horde PEAR package.';
+    }
+
+    public function getOptionGroupOptions()
+    {
+        return array(
+            new Horde_Argv_Option(
+                '-c',
+                '--cisetup',
+                array(
+                    'action' => 'store',
+                    'help'   => 'generate the basic Hudson project configuration for a Horde PEAR package in CISETUP'
+                )
+            ),
+            new Horde_Argv_Option(
+                '-C',
+                '--ciprebuild',
+                array(
+                    'action' => 'store',
+                    'help'   => 'generate the Hudson build configuration for a Horde PEAR package in CIPREBUILD'
+                )
+            ),
+            new Horde_Argv_Option(
+                '-T',
+                '--toolsdir',
+                array(
+                    'action' => 'store',
+                    'help'   => 'the path to the PEAR installation holding the required analysis tools'
+                )
+            ),
+        );
+    }
+
+    public function handle(Horde_Element_Config $config)
+    {
+        $options = $config->getOptions();
+        if (!empty($options['cisetup']) | !empty($options['ciprebuild'])) {
+            $this->run($config);
+        }
+    }
+
+    public function run(Horde_Element_Config $config)
+    {
+        $options = $config->getOptions();
+
+        $pear = new PEAR();
+        $pear->setErrorHandling(PEAR_ERROR_DIE);
+
+        $arguments = $config->getArguments();
+        $pkgfile = $arguments[0] . DIRECTORY_SEPARATOR . 'package.xml';
+        $name = basename($arguments[0]);
+        if (basename(dirname($arguments[0])) == 'framework') {
+            $origin = 'framework' . DIRECTORY_SEPARATOR . $name;
+        } else {
+            $origin = $name;
+        }
+        $test_path = strtr($name, '_', '/');
+
+        $pkg     = new PEAR_PackageFile(new PEAR_Config());
+        $pf      = $pkg->fromPackageFile($pkgfile, PEAR_VALIDATE_NORMAL);
+        $description = $pf->getDescription();
+
+        if (!isset($options['toolsdir'])) {
+            $options['toolsdir'] = 'php-hudson-tools/workspace/pear/pear';
+        }
+
+        if (!empty($options['cisetup'])) {
+            $in = file_get_contents(
+                Horde_Element_Constants::getDataDirectory()
+                . DIRECTORY_SEPARATOR . 'hudson-element-config.xml.template',
+                'r'
+            );
+            file_put_contents(
+                $options['cisetup'] . DIRECTORY_SEPARATOR . 'config.xml',
+                sprintf($in, $origin, 'horde', $options['toolsdir'], $description)
+            );
+        }
+
+        if (!empty($options['ciprebuild'])) {
+            $in = file_get_contents(
+                Horde_Element_Constants::getDataDirectory()
+                . DIRECTORY_SEPARATOR . 'hudson-element-build.xml.template',
+                'r'
+            );
+            file_put_contents(
+                $options['ciprebuild'] . DIRECTORY_SEPARATOR . 'build.xml',
+                sprintf($in, $options['toolsdir'])
+            );
+            $in = file_get_contents(
+                Horde_Element_Constants::getDataDirectory()
+                . DIRECTORY_SEPARATOR . 'hudson-element-phpunit.xml.template',
+                'r'
+            );
+            file_put_contents(
+                $options['ciprebuild'] . DIRECTORY_SEPARATOR . 'phpunit.xml',
+                sprintf($in, $name, $test_path)
+            );
+        }
+    }
+}
diff --git a/components/lib/Components/Module/DevPackage.php b/components/lib/Components/Module/DevPackage.php
new file mode 100644 (file)
index 0000000..259d5ea
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * Horde_Element_Module_DevPackage:: generates a development snapshot for the
+ * specified package.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * Horde_Element_Module_DevPackage:: generates a development snapshot for the
+ * specified package.
+ *
+ * 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  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element_Module_DevPackage
+implements Horde_Element_Module
+{
+    public function getOptionGroupTitle()
+    {
+        return 'Development Packages';
+    }
+
+    public function getOptionGroupDescription()
+    {
+        return 'This module generates a development snapshot for the specified package';
+    }
+
+    public function getOptionGroupOptions()
+    {
+        return array(
+            new Horde_Argv_Option(
+                '-d',
+                '--devpackage',
+                array(
+                    'action' => 'store_true',
+                    'help'   => 'generate a development snapshot'
+                )
+            ),
+        );
+    }
+
+    public function handle(Horde_Element_Config $config)
+    {
+        $options = $config->getOptions();
+        if (!empty($options['devpackage'])) {
+            $this->run($config);
+        }
+    }
+
+    public function run(Horde_Element_Config $config)
+    {
+        $options = $config->getOptions();
+
+        $pear = new PEAR();
+        $pear->setErrorHandling(PEAR_ERROR_DIE);
+
+        $arguments = $config->getArguments();
+        $pkgfile = $arguments[0] . DIRECTORY_SEPARATOR . 'package.xml';
+
+        $pkg     = new PEAR_PackageFile(new PEAR_Config());
+        $pf      = $pkg->fromPackageFile($pkgfile, PEAR_VALIDATE_NORMAL);
+        $pf->_packageInfo['version']['release'] = $pf->getVersion()
+            . 'dev' . strftime('%Y%m%d%H%M');
+        $gen     = $pf->getDefaultGenerator();
+        $tgzfile = $gen->toTgz(new PEAR_Common());
+    }
+}
diff --git a/components/lib/Components/Module/Installer.php b/components/lib/Components/Module/Installer.php
new file mode 100644 (file)
index 0000000..2a425bc
--- /dev/null
@@ -0,0 +1,172 @@
+<?php
+/**
+ * Horde_Element_Module_Installer:: installs a Horde element including
+ * its dependencies.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * Horde_Element_Module_Installer:: installs a Horde element including
+ * its dependencies.
+ *
+ * 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  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element_Module_Installer
+implements Horde_Element_Module
+{
+    private $_run;
+
+    public function getOptionGroupTitle()
+    {
+        return 'Installer';
+    }
+
+    public function getOptionGroupDescription()
+    {
+        return 'This module installs a Horde element including its dependencies.';
+    }
+
+    public function getOptionGroupOptions()
+    {
+        return array(
+            new Horde_Argv_Option(
+                '-i',
+                '--install',
+                array(
+                    'action' => 'store',
+                    'help'   => 'install the element into the specified absolute INSTALL location'
+                )
+            ),
+        );
+    }
+
+    public function handle(Horde_Element_Config $config)
+    {
+        $options = $config->getOptions();
+        if (!empty($options['install'])) {
+            $this->run($config);
+        }
+    }
+
+    public function run(Horde_Element_Config $config)
+    {
+        $options = $config->getOptions();
+
+        $pear = new PEAR();
+        $pear->setErrorHandling(PEAR_ERROR_DIE);
+
+        $pearrc = $options['install'] . DIRECTORY_SEPARATOR . '.pearrc';
+        $command_config = new PEAR_Command_Config(new PEAR_Frontend_CLI(), new stdClass);
+        $command_config->doConfigCreate(
+            'config-create', array(), array($options['install'], $pearrc)
+        );
+
+        $pear_config = new PEAR_Config($pearrc);
+        $GLOBALS['_PEAR_Config_instance'] = $pear_config;
+
+        $channel = new PEAR_Command_Channels(
+            new PEAR_Frontend_CLI(),
+            $pear_config
+        );
+        $channel->doDiscover('channel-discover', array(), array('pear.horde.org'));
+        $channel->doDiscover('channel-discover', array(), array('pear.phpunit.de'));
+
+        $installer = new PEAR_Command_Install(
+            new PEAR_Frontend_CLI(),
+            $pear_config
+        );
+
+        $arguments = $config->getArguments();
+        $element = basename(realpath($arguments[0]));
+        $root_path = dirname(realpath($arguments[0]));
+
+        $this->_run = array();
+
+        $this->_installHordeDependency(
+            $installer,
+            $pear_config,
+            $root_path,
+            $element
+        );
+    }
+
+    /**
+     * Install a Horde dependency from the current tree (the framework).
+     *
+     * @param PEAR_Command_Install $installer   Installs the dependency.
+     * @param PEAR_Config          $pear_config The configuration of the PEAR
+     *                                          environment in which the
+     *                                          dependency will be installed.
+     * @param string               $root_path   Root path to the Horde framework.
+     * @param string               $dependency  Package name of the dependency.
+     */
+    private function _installHordeDependency(
+        PEAR_Command_Install $installer,
+        PEAR_Config $pear_config,
+        $root_path,
+        $dependency
+    ) {
+        $package_file = $root_path . DIRECTORY_SEPARATOR
+            . $dependency . DIRECTORY_SEPARATOR . 'package.xml';
+
+        $parser = new PEAR_PackageFile_Parser_v2();
+        $parser->setConfig($pear_config);
+        $pkg = $parser->parse(file_get_contents($package_file), $package_file);
+
+        $dependencies = $pkg->getDeps();
+        foreach ($dependencies as $dependency) {
+            if (isset($dependency['channel']) && $dependency['channel'] != 'pear.horde.org') {
+                $key = $dependency['channel'] . '/' . $dependency['name'];
+                if (in_array($key, $this->_run)) {
+                    continue;
+                }
+                $installer->doInstall(
+                    'install',
+                    array(
+                        'force' => true,
+                        'channel' => $dependency['channel'],
+                    ),
+                    array($dependency['name'])
+                );
+                $this->_run[] = $key;
+            } else if (isset($dependency['channel'])) {
+                $key = $dependency['channel'] . '/' . $dependency['name'];
+                if (in_array($key, $this->_run)) {
+                    continue;
+                }
+                $this->_run[] = $key;
+                $this->_installHordeDependency(
+                    $installer,
+                    $pear_config,
+                    $root_path,
+                    $dependency['name']
+                );
+            }
+        }
+        if (in_array($package_file, $this->_run)) {
+            return;
+        }
+        $installer->doInstall(
+            'install',
+            array('nodeps' => true),
+            array($package_file)
+        );
+        $this->_run[] = $package_file;
+    }
+}
diff --git a/components/lib/Components/Module/PearPackageXml.php b/components/lib/Components/Module/PearPackageXml.php
new file mode 100644 (file)
index 0000000..4439527
--- /dev/null
@@ -0,0 +1,163 @@
+<?php
+/**
+ * Horde_Element_Module_PearPackageXml:: can update the package.xml of
+ * a Horde element.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * Horde_Element_Module_PearPackageXml:: can update the package.xml of
+ * a Horde element.
+ *
+ * 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  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element_Module_PearPackageXml
+implements Horde_Element_Module
+{
+    public function getOptionGroupTitle()
+    {
+        return 'Pear Package Xml';
+    }
+
+    public function getOptionGroupDescription()
+    {
+        return 'This module allows manipulation of the package.xml.';
+    }
+
+    public function getOptionGroupOptions()
+    {
+        return array(
+            new Horde_Argv_Option(
+                '-u',
+                '--updatexml',
+                array(
+                    'action' => 'store_true',
+                    'help'   => 'update the package.xml for the package'
+                )
+            ),
+            new Horde_Argv_Option(
+                '-p',
+                '--packagexml',
+                array(
+                    'action' => 'store_true',
+                    'help'   => 'display an up-to-date package.xml for the package'
+                )
+            )
+
+        );
+    }
+
+    public function handle(Horde_Element_Config $config)
+    {
+        $options = $config->getOptions();
+        if (!empty($options['packagexml']) ||
+            !empty($options['updatexml'])) {
+            $this->run($config);
+        }
+    }
+
+    public function run(Horde_Element_Config $config)
+    {
+        $arguments = $config->getArguments();
+        $package_file = $arguments[0] . '/package.xml';
+
+        $pear = new PEAR();
+        $pear->setErrorHandling(PEAR_ERROR_DIE);
+
+        $package = PEAR_PackageFileManager2::importOptions(
+            $package_file,
+            array(
+                'packagedirectory' => $arguments[0],
+                'filelistgenerator' => 'file',
+                'clearcontents' => false,
+                'clearchangelog' => false,
+                'simpleoutput' => true,
+                'ignore' => array('*~', 'conf.php', 'CVS/*'),
+                'include' => '*',
+                'dir_roles' =>
+                array(
+                    'lib'       => 'php',
+                    'doc'       => 'doc',
+                    'example'   => 'doc',
+                    'script'    => 'script',
+                    'test'      => 'test',
+                    'migration' => 'data',
+                ),
+            )
+        );
+
+        if ($package instanceOf PEAR_Error) {
+            throw new Horde_Element_Exception($package->getMessage());
+        }
+        /**
+         * @todo: Looks like this throws away any <replace /> tags we have in
+         * the content list. Needs to be fixed.
+         */
+        $package->generateContents();
+
+        /**
+         * This is required to clear the <phprelease><filelist></filelist></phprelease>
+         * section.
+         */
+        $package->setPackageType('php');
+
+        $contents = $package->getContents();
+        $files = $contents['dir']['file'];
+
+        foreach ($files as $file) {
+            $components = explode('/', $file['attribs']['name'], 2);
+            switch ($components[0]) {
+            case 'doc':
+            case 'example':
+            case 'lib':
+            case 'test':
+            case 'data':
+                $package->addInstallAs(
+                    $file['attribs']['name'], $components[1]
+                );
+            break;
+            case 'migration':
+                $components = explode('/', $components[1]);
+                array_splice($components, count($components) - 1, 0, 'migration');
+                $package->addInstallAs(
+                    $file['attribs']['name'], implode('/', $components)
+                );
+                break;
+            case 'script':
+                $filename = basename($file['attribs']['name']);
+                if (substr($filename, strlen($filename) - 4)) {
+                    $filename = substr($filename, 0, strlen($filename) - 4);
+                }
+                $package->addInstallAs(
+                    $file['attribs']['name'], $filename
+                );
+                break;
+            }
+        }
+
+        $options = $config->getOptions();
+        if (!empty($options['packagexml'])) {
+            $package->debugPackageFile();
+        }
+        if (!empty($options['updatexml'])) {
+            $package->writePackageFile();
+        }
+
+    }
+}
diff --git a/components/lib/Components/Modules.php b/components/lib/Components/Modules.php
new file mode 100644 (file)
index 0000000..9c188f4
--- /dev/null
@@ -0,0 +1,125 @@
+<?php
+/**
+ * The Horde_Element_Modules:: class handles a set of Element modules.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * The Horde_Element_Modules:: class handles a set of Element modules.
+ *
+ * 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  Element
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element_Modules
+implements Iterator, Countable
+{
+    /**
+     * The available modules.
+     *
+     * @var array
+     */
+    private $_modules;
+
+    /**
+     * Constructor.
+     */
+    public function __construct()
+    {
+        $this->_modules = array();
+    }
+
+    /**
+     * Add all modules found in the specified directory.
+     *
+     * @param string $module_directory Load the modules from this dirrectory.
+     *
+     * @return NULL
+     */
+    public function addModulesFromDirectory(
+        $module_directory,
+        $base = 'Horde_Element_Module_'
+    ) {
+        foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($module_directory)) as $file) {
+            if ($file->isFile() && preg_match('/.php$/', $file->getFilename())) {
+                $class = $base . preg_replace("/^(.*)\.php/", '\\1', $file->getFilename());
+                $this->_modules[$class] = new $class();
+            }
+        }
+    }
+
+    /**
+     * Implementation of the Iterator rewind() method. Rewinds the module list.
+     *
+     * return NULL
+     */
+    public function rewind()
+    {
+        reset($this->_modules);
+    }
+
+    /**
+     * Implementation of the Iterator current(). Returns the current module.
+     *
+     * @return mixed The current module.
+     */
+    public function current()
+    {
+        return current($this->_modules);
+    }
+
+    /**
+     * Implementation of the Iterator key() method. Returns the key of the current module.
+     *
+     * @return mixed The class name of the current module.
+     */
+    public function key()
+    {
+        return key($this->_modules);
+    }
+
+    /**
+     * Implementation of the Iterator next() method. Returns the next module.
+     *
+     * @return Horde_Element_Module|null The next module or null if there are no more
+     * modules.
+     */
+    public function next()
+    {
+        return next($this->_modules);
+    }
+
+    /**
+     * Implementation of the Iterator valid() method. Indicates if the current element is a valid element.
+     *
+     * @return boolean Whether the current element is valid
+     */
+    public function valid()
+    {
+        return key($this->_modules) !== null;
+    }
+
+    /**
+     * Implementation of Countable count() method. Returns the number of modules.
+     *
+     * @return integer Number of modules.
+     */
+    public function count()
+    {
+        return count($this->_modules);
+    }
+}
\ No newline at end of file
diff --git a/components/lib/Horde/Element.php b/components/lib/Horde/Element.php
deleted file mode 100644 (file)
index 70816d7..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-/**
- * The Horde_Element:: class is the entry point for the various Horde
- * element actions provided by the package.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * The Horde_Element:: class is the entry point for the various Horde
- * element actions provided by the package.
- *
- * 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  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element
-{
-    /**
-     * The main entry point for the application.
-     *
-     * @param array $parameters A list of named configuration parameters.
-     * <pre>
-     * 'cli'        - (array)  CLI configuration parameters.
-     *   'parser'   - (array)  Parser configuration parameters.
-     *     'class'  - (string) The class name of the parser to use.
-     * </pre>
-     */
-    static public function main(array $parameters = array())
-    {
-        $parser = self::_prepareParser($parameters);
-        $config = self::_prepareConfig($parser);
-        $modules = self::_prepareModules();
-        $config->handleModules($modules);
-        try {
-            self::_validateArguments($config);
-        } catch (Horde_Element_Exception $e) {
-            $parser->parserError($e->getMessage());
-            return;
-        }
-        foreach ($modules as $module) {
-            $module->handle($config);
-        }
-    }
-
-    static private function _prepareParser(array $parameters = array())
-    {
-        if (empty($parameters['cli']['parser']['class'])) {
-            $parser_class = 'Horde_Argv_Parser';
-        } else {
-            $parser_class = $parameters['cli']['parser']['class'];
-        }
-        return new $parser_class(
-            array(
-                'usage' => '%prog ' . _("[options] PACKAGE_PATH")
-            )
-        );
-    }
-
-    static private function _prepareConfig(Horde_Argv_Parser $parser)
-    {
-        $config = new Horde_Element_Configs();
-        $config->addConfigurationType(
-            new Horde_Element_Config_Cli(
-                $parser
-            )
-        );
-        return $config;
-    }
-
-    static private function _prepareModules()
-    {
-        $modules = new Horde_Element_Modules();
-        $modules->addModulesFromDirectory(dirname(__FILE__) . '/Element/Module');
-        return $modules;
-    }
-
-    static private function _validateArguments(Horde_Element_Config $config)
-    {
-        $arguments = $config->getArguments();
-        if (empty($arguments[0])) {
-            throw new Horde_Element_Exception('Please specify the path of the PEAR package!');
-        }
-
-        if (!is_dir($arguments[0])) {
-            throw new Horde_Element_Exception(sprintf('%s specifies no directory!', $arguments[0]));
-        }
-
-        if (!file_exists($arguments[0] . '/package.xml')) {
-            throw new Horde_Element_Exception(sprintf('There is no package.xml at %s!', $arguments[0]));
-        }
-    }
-}
\ No newline at end of file
diff --git a/components/lib/Horde/Element/Config.php b/components/lib/Horde/Element/Config.php
deleted file mode 100644 (file)
index da22e46..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/**
- * Horde_Element_Config:: interface represents a configuration type for the Horde
- * element tool.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * Horde_Element_Config:: interface represents a configuration type for the Horde
- * element tool.
- *
- * Copyright 2009-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  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-interface Horde_Element_Config
-{
-    /**
-     * Provide each configuration handler with the list of supported modules.
-     *
-     * @param Horde_Element_Modules $modules A list of modules.
-     * @return NULL
-     */
-    public function handleModules(Horde_Element_Modules $modules);
-
-    /**
-     * Return the options provided by the configuration handlers.
-     *
-     * @return array An array of options.
-     */
-    public function getOptions();
-
-    /**
-     * Return the arguments provided by the configuration handlers.
-     *
-     * @return array An array of arguments.
-     */
-    public function getArguments();
-}
\ No newline at end of file
diff --git a/components/lib/Horde/Element/Config/Cli.php b/components/lib/Horde/Element/Config/Cli.php
deleted file mode 100644 (file)
index 6f63f94..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-/**
- * Horde_Element_Config_Cli:: class provides the command line interface for the Horde
- * element tool.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * Horde_Element_Config_Cli:: class provides the command line interface for the Horde
- * element tool.
- *
- * Copyright 2009-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  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element_Config_Cli
-implements Horde_Element_Config
-{
-    /**
-     * The command line argument parser.
-     *
-     * @var Horde_Argv_Parser
-     */
-    private $_parser;
-
-    /**
-     * The options parsed from the command line.
-     *
-     * @var array
-     */
-    private $_options;
-
-    /**
-     * Any additional arguments parsed from the command line.
-     *
-     * @var array
-     */
-    private $_arguments;
-
-    /**
-     * Constructor.
-     *
-     */
-    public function __construct(
-        Horde_Argv_Parser $parser
-    ) {
-        $this->_parser = $parser;
-    }
-
-    /**
-     * Load the options for the list of supported modules.
-     *
-     * @param Horde_Element_Modules $modules A list of modules.
-     * @return NULL
-     */
-    public function handleModules(Horde_Element_Modules $modules)
-    {
-        foreach ($modules as $module) {
-            $this->_addOptionsFromModule($this->_parser, $module);
-        }
-
-        list($this->_options, $this->_arguments) = $this->_parser->parseArgs();
-    }
-
-    /**
-     * Return the options parsed from the command line.
-     *
-     * @return Horde_Argv_Values The option values.
-     */
-    public function getOptions()
-    {
-        return $this->_options;
-    }
-
-    /**
-     * Return the arguments parsed from the command line.
-     *
-     * @return array An array of arguments.
-     */
-    public function getArguments()
-    {
-        return $this->_arguments;
-    }
-
-    /**
-     * Add an option group from the provided module to the parser.
-     *
-     * @param Horde_Argv_Parser $parser The parser.
-     * @param Horde_Element_Module   $module The module providing the option group.
-     *
-     * @return NULL
-     */
-    private function _addOptionsFromModule($parser, $module)
-    {
-        $group = new Horde_Argv_OptionGroup(
-            $parser,
-            $module->getOptionGroupTitle(),
-            $module->getOptionGroupDescription()
-        );
-        foreach ($module->getOptionGroupOptions() as $option) {
-            $group->addOption($option);
-        }
-        $parser->addOptionGroup($group);
-    }
-}
diff --git a/components/lib/Horde/Element/Configs.php b/components/lib/Horde/Element/Configs.php
deleted file mode 100644 (file)
index ee5a072..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-<?php
-/**
- * Horde_Element_Configs:: class represents configuration for the
- * Horde element tool.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * Horde_Element_Configs:: class represents configuration for the
- * Horde element tool.
- *
- * Copyright 2009-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  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element_Configs
-implements Horde_Element_Config
-{
-
-    /**
-     * The different configuration handlers.
-     *
-     * @var array
-     */
-    private $_configs;
-
-    /**
-     * Constructor.
-     */
-    public function __construct() {
-        $this->_configs = array();
-    }
-
-    /**
-     * Add a configuration type to the configuration handler.
-     *
-     * @param Horde_Element_Config $type The configuration type.
-     *
-     * @return NULL
-     */
-    public function addConfigurationType(Horde_Element_Config $type) {
-        $this->_configs[] = $type;
-    }
-
-    /**
-     * Provide each configuration handler with the list of supported modules.
-     *
-     * @param Horde_Element_Modules $modules A list of modules.
-     * @return NULL
-     */
-    public function handleModules(Horde_Element_Modules $modules)
-    {
-        foreach ($this->_configs as $config) {
-            $config->handleModules($modules);
-        }
-    }
-
-    /**
-     * Return the options provided by the configuration handlers.
-     *
-     * @return array An array of options.
-     */
-    public function getOptions()
-    {
-        $options = array();
-        foreach ($this->_configs as $config) {
-            if (count($config->getOptions()) !== 0) {
-                $config_options = array();
-                foreach ($config->getOptions() as $name => $option) {
-                    $config_options[$name] = $option;
-                }
-                $options = array_merge($options, $config_options);
-            }
-        }
-        return $options;
-    }
-
-    /**
-     * Return the arguments provided by the configuration handlers.
-     *
-     * @return array An array of arguments.
-     */
-    public function getArguments()
-    {
-        $arguments = array();
-        foreach ($this->_configs as $config) {
-            $config_arguments = $config->getArguments();
-            if (!empty($config_arguments)) {
-                $arguments = array_merge($arguments, $config_arguments);
-            }
-        }
-        return $arguments;
-    }
-}
\ No newline at end of file
diff --git a/components/lib/Horde/Element/Constants.php b/components/lib/Horde/Element/Constants.php
deleted file mode 100644 (file)
index 42f8e9f..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * Horde_Element_Constants:: provides the constants for this package.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * Horde_Element_Constants:: provides the constants for this package.
- *
- * 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  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element_Constants
-{
-    const DATA_DIR = '@data_dir@';
-
-    static public function getDataDirectory()
-    {
-        if (strpos(self::DATA_DIR, '@data_dir') === 0) {
-            return join(
-                DIRECTORY_SEPARATOR,
-                array(dirname(__FILE__), '..', '..', '..', 'data')
-            );
-        }
-        return self::DATA_DIR . DIRECTORY_SEPARATOR . 'Element';
-    }
-}
diff --git a/components/lib/Horde/Element/Exception.php b/components/lib/Horde/Element/Exception.php
deleted file mode 100644 (file)
index 115b70a..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * This class provides the standard error class for the Element package.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * This class provides the standard error class for the Element package.
- *
- * 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  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element_Exception
-extends Exception
-{
-}
diff --git a/components/lib/Horde/Element/Module.php b/components/lib/Horde/Element/Module.php
deleted file mode 100644 (file)
index 43a9862..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/**
- * Horde_Element_Module:: represents a task for a Horde element.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * Horde_Element_Module:: represents a task for a Horde element.
- *
- * 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  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-interface Horde_Element_Module
-{
-    public function getOptionGroupTitle();
-
-    public function getOptionGroupDescription();
-
-    public function getOptionGroupOptions();
-
-    public function handle(Horde_Element_Config $config);
-
-    public function run(Horde_Element_Config $config);
-}
\ No newline at end of file
diff --git a/components/lib/Horde/Element/Module/CiSetup.php b/components/lib/Horde/Element/Module/CiSetup.php
deleted file mode 100644 (file)
index 7860466..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-<?php
-/**
- * Horde_Element_Module_CiSetup:: generates the configuration for Hudson based
- * continuous integration of a Horde PEAR package.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * Horde_Element_Module_CiSetup:: generates the configuration for Hudson based
- * continuous integration of a Horde PEAR package.
- *
- * 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  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element_Module_CiSetup
-implements Horde_Element_Module
-{
-    public function getOptionGroupTitle()
-    {
-        return 'Continuous Integration Setup';
-    }
-
-    public function getOptionGroupDescription()
-    {
-        return 'This module generates the configuration for Hudson based continuous integration of a Horde PEAR package.';
-    }
-
-    public function getOptionGroupOptions()
-    {
-        return array(
-            new Horde_Argv_Option(
-                '-c',
-                '--cisetup',
-                array(
-                    'action' => 'store',
-                    'help'   => 'generate the basic Hudson project configuration for a Horde PEAR package in CISETUP'
-                )
-            ),
-            new Horde_Argv_Option(
-                '-C',
-                '--ciprebuild',
-                array(
-                    'action' => 'store',
-                    'help'   => 'generate the Hudson build configuration for a Horde PEAR package in CIPREBUILD'
-                )
-            ),
-            new Horde_Argv_Option(
-                '-T',
-                '--toolsdir',
-                array(
-                    'action' => 'store',
-                    'help'   => 'the path to the PEAR installation holding the required analysis tools'
-                )
-            ),
-        );
-    }
-
-    public function handle(Horde_Element_Config $config)
-    {
-        $options = $config->getOptions();
-        if (!empty($options['cisetup']) | !empty($options['ciprebuild'])) {
-            $this->run($config);
-        }
-    }
-
-    public function run(Horde_Element_Config $config)
-    {
-        $options = $config->getOptions();
-
-        $pear = new PEAR();
-        $pear->setErrorHandling(PEAR_ERROR_DIE);
-
-        $arguments = $config->getArguments();
-        $pkgfile = $arguments[0] . DIRECTORY_SEPARATOR . 'package.xml';
-        $name = basename($arguments[0]);
-        if (basename(dirname($arguments[0])) == 'framework') {
-            $origin = 'framework' . DIRECTORY_SEPARATOR . $name;
-        } else {
-            $origin = $name;
-        }
-        $test_path = strtr($name, '_', '/');
-
-        $pkg     = new PEAR_PackageFile(new PEAR_Config());
-        $pf      = $pkg->fromPackageFile($pkgfile, PEAR_VALIDATE_NORMAL);
-        $description = $pf->getDescription();
-
-        if (!isset($options['toolsdir'])) {
-            $options['toolsdir'] = 'php-hudson-tools/workspace/pear/pear';
-        }
-
-        if (!empty($options['cisetup'])) {
-            $in = file_get_contents(
-                Horde_Element_Constants::getDataDirectory()
-                . DIRECTORY_SEPARATOR . 'hudson-element-config.xml.template',
-                'r'
-            );
-            file_put_contents(
-                $options['cisetup'] . DIRECTORY_SEPARATOR . 'config.xml',
-                sprintf($in, $origin, 'horde', $options['toolsdir'], $description)
-            );
-        }
-
-        if (!empty($options['ciprebuild'])) {
-            $in = file_get_contents(
-                Horde_Element_Constants::getDataDirectory()
-                . DIRECTORY_SEPARATOR . 'hudson-element-build.xml.template',
-                'r'
-            );
-            file_put_contents(
-                $options['ciprebuild'] . DIRECTORY_SEPARATOR . 'build.xml',
-                sprintf($in, $options['toolsdir'])
-            );
-            $in = file_get_contents(
-                Horde_Element_Constants::getDataDirectory()
-                . DIRECTORY_SEPARATOR . 'hudson-element-phpunit.xml.template',
-                'r'
-            );
-            file_put_contents(
-                $options['ciprebuild'] . DIRECTORY_SEPARATOR . 'phpunit.xml',
-                sprintf($in, $name, $test_path)
-            );
-        }
-    }
-}
diff --git a/components/lib/Horde/Element/Module/DevPackage.php b/components/lib/Horde/Element/Module/DevPackage.php
deleted file mode 100644 (file)
index 259d5ea..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-/**
- * Horde_Element_Module_DevPackage:: generates a development snapshot for the
- * specified package.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * Horde_Element_Module_DevPackage:: generates a development snapshot for the
- * specified package.
- *
- * 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  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element_Module_DevPackage
-implements Horde_Element_Module
-{
-    public function getOptionGroupTitle()
-    {
-        return 'Development Packages';
-    }
-
-    public function getOptionGroupDescription()
-    {
-        return 'This module generates a development snapshot for the specified package';
-    }
-
-    public function getOptionGroupOptions()
-    {
-        return array(
-            new Horde_Argv_Option(
-                '-d',
-                '--devpackage',
-                array(
-                    'action' => 'store_true',
-                    'help'   => 'generate a development snapshot'
-                )
-            ),
-        );
-    }
-
-    public function handle(Horde_Element_Config $config)
-    {
-        $options = $config->getOptions();
-        if (!empty($options['devpackage'])) {
-            $this->run($config);
-        }
-    }
-
-    public function run(Horde_Element_Config $config)
-    {
-        $options = $config->getOptions();
-
-        $pear = new PEAR();
-        $pear->setErrorHandling(PEAR_ERROR_DIE);
-
-        $arguments = $config->getArguments();
-        $pkgfile = $arguments[0] . DIRECTORY_SEPARATOR . 'package.xml';
-
-        $pkg     = new PEAR_PackageFile(new PEAR_Config());
-        $pf      = $pkg->fromPackageFile($pkgfile, PEAR_VALIDATE_NORMAL);
-        $pf->_packageInfo['version']['release'] = $pf->getVersion()
-            . 'dev' . strftime('%Y%m%d%H%M');
-        $gen     = $pf->getDefaultGenerator();
-        $tgzfile = $gen->toTgz(new PEAR_Common());
-    }
-}
diff --git a/components/lib/Horde/Element/Module/Installer.php b/components/lib/Horde/Element/Module/Installer.php
deleted file mode 100644 (file)
index 2a425bc..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-<?php
-/**
- * Horde_Element_Module_Installer:: installs a Horde element including
- * its dependencies.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * Horde_Element_Module_Installer:: installs a Horde element including
- * its dependencies.
- *
- * 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  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element_Module_Installer
-implements Horde_Element_Module
-{
-    private $_run;
-
-    public function getOptionGroupTitle()
-    {
-        return 'Installer';
-    }
-
-    public function getOptionGroupDescription()
-    {
-        return 'This module installs a Horde element including its dependencies.';
-    }
-
-    public function getOptionGroupOptions()
-    {
-        return array(
-            new Horde_Argv_Option(
-                '-i',
-                '--install',
-                array(
-                    'action' => 'store',
-                    'help'   => 'install the element into the specified absolute INSTALL location'
-                )
-            ),
-        );
-    }
-
-    public function handle(Horde_Element_Config $config)
-    {
-        $options = $config->getOptions();
-        if (!empty($options['install'])) {
-            $this->run($config);
-        }
-    }
-
-    public function run(Horde_Element_Config $config)
-    {
-        $options = $config->getOptions();
-
-        $pear = new PEAR();
-        $pear->setErrorHandling(PEAR_ERROR_DIE);
-
-        $pearrc = $options['install'] . DIRECTORY_SEPARATOR . '.pearrc';
-        $command_config = new PEAR_Command_Config(new PEAR_Frontend_CLI(), new stdClass);
-        $command_config->doConfigCreate(
-            'config-create', array(), array($options['install'], $pearrc)
-        );
-
-        $pear_config = new PEAR_Config($pearrc);
-        $GLOBALS['_PEAR_Config_instance'] = $pear_config;
-
-        $channel = new PEAR_Command_Channels(
-            new PEAR_Frontend_CLI(),
-            $pear_config
-        );
-        $channel->doDiscover('channel-discover', array(), array('pear.horde.org'));
-        $channel->doDiscover('channel-discover', array(), array('pear.phpunit.de'));
-
-        $installer = new PEAR_Command_Install(
-            new PEAR_Frontend_CLI(),
-            $pear_config
-        );
-
-        $arguments = $config->getArguments();
-        $element = basename(realpath($arguments[0]));
-        $root_path = dirname(realpath($arguments[0]));
-
-        $this->_run = array();
-
-        $this->_installHordeDependency(
-            $installer,
-            $pear_config,
-            $root_path,
-            $element
-        );
-    }
-
-    /**
-     * Install a Horde dependency from the current tree (the framework).
-     *
-     * @param PEAR_Command_Install $installer   Installs the dependency.
-     * @param PEAR_Config          $pear_config The configuration of the PEAR
-     *                                          environment in which the
-     *                                          dependency will be installed.
-     * @param string               $root_path   Root path to the Horde framework.
-     * @param string               $dependency  Package name of the dependency.
-     */
-    private function _installHordeDependency(
-        PEAR_Command_Install $installer,
-        PEAR_Config $pear_config,
-        $root_path,
-        $dependency
-    ) {
-        $package_file = $root_path . DIRECTORY_SEPARATOR
-            . $dependency . DIRECTORY_SEPARATOR . 'package.xml';
-
-        $parser = new PEAR_PackageFile_Parser_v2();
-        $parser->setConfig($pear_config);
-        $pkg = $parser->parse(file_get_contents($package_file), $package_file);
-
-        $dependencies = $pkg->getDeps();
-        foreach ($dependencies as $dependency) {
-            if (isset($dependency['channel']) && $dependency['channel'] != 'pear.horde.org') {
-                $key = $dependency['channel'] . '/' . $dependency['name'];
-                if (in_array($key, $this->_run)) {
-                    continue;
-                }
-                $installer->doInstall(
-                    'install',
-                    array(
-                        'force' => true,
-                        'channel' => $dependency['channel'],
-                    ),
-                    array($dependency['name'])
-                );
-                $this->_run[] = $key;
-            } else if (isset($dependency['channel'])) {
-                $key = $dependency['channel'] . '/' . $dependency['name'];
-                if (in_array($key, $this->_run)) {
-                    continue;
-                }
-                $this->_run[] = $key;
-                $this->_installHordeDependency(
-                    $installer,
-                    $pear_config,
-                    $root_path,
-                    $dependency['name']
-                );
-            }
-        }
-        if (in_array($package_file, $this->_run)) {
-            return;
-        }
-        $installer->doInstall(
-            'install',
-            array('nodeps' => true),
-            array($package_file)
-        );
-        $this->_run[] = $package_file;
-    }
-}
diff --git a/components/lib/Horde/Element/Module/PearPackageXml.php b/components/lib/Horde/Element/Module/PearPackageXml.php
deleted file mode 100644 (file)
index 4439527..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-<?php
-/**
- * Horde_Element_Module_PearPackageXml:: can update the package.xml of
- * a Horde element.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * Horde_Element_Module_PearPackageXml:: can update the package.xml of
- * a Horde element.
- *
- * 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  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element_Module_PearPackageXml
-implements Horde_Element_Module
-{
-    public function getOptionGroupTitle()
-    {
-        return 'Pear Package Xml';
-    }
-
-    public function getOptionGroupDescription()
-    {
-        return 'This module allows manipulation of the package.xml.';
-    }
-
-    public function getOptionGroupOptions()
-    {
-        return array(
-            new Horde_Argv_Option(
-                '-u',
-                '--updatexml',
-                array(
-                    'action' => 'store_true',
-                    'help'   => 'update the package.xml for the package'
-                )
-            ),
-            new Horde_Argv_Option(
-                '-p',
-                '--packagexml',
-                array(
-                    'action' => 'store_true',
-                    'help'   => 'display an up-to-date package.xml for the package'
-                )
-            )
-
-        );
-    }
-
-    public function handle(Horde_Element_Config $config)
-    {
-        $options = $config->getOptions();
-        if (!empty($options['packagexml']) ||
-            !empty($options['updatexml'])) {
-            $this->run($config);
-        }
-    }
-
-    public function run(Horde_Element_Config $config)
-    {
-        $arguments = $config->getArguments();
-        $package_file = $arguments[0] . '/package.xml';
-
-        $pear = new PEAR();
-        $pear->setErrorHandling(PEAR_ERROR_DIE);
-
-        $package = PEAR_PackageFileManager2::importOptions(
-            $package_file,
-            array(
-                'packagedirectory' => $arguments[0],
-                'filelistgenerator' => 'file',
-                'clearcontents' => false,
-                'clearchangelog' => false,
-                'simpleoutput' => true,
-                'ignore' => array('*~', 'conf.php', 'CVS/*'),
-                'include' => '*',
-                'dir_roles' =>
-                array(
-                    'lib'       => 'php',
-                    'doc'       => 'doc',
-                    'example'   => 'doc',
-                    'script'    => 'script',
-                    'test'      => 'test',
-                    'migration' => 'data',
-                ),
-            )
-        );
-
-        if ($package instanceOf PEAR_Error) {
-            throw new Horde_Element_Exception($package->getMessage());
-        }
-        /**
-         * @todo: Looks like this throws away any <replace /> tags we have in
-         * the content list. Needs to be fixed.
-         */
-        $package->generateContents();
-
-        /**
-         * This is required to clear the <phprelease><filelist></filelist></phprelease>
-         * section.
-         */
-        $package->setPackageType('php');
-
-        $contents = $package->getContents();
-        $files = $contents['dir']['file'];
-
-        foreach ($files as $file) {
-            $components = explode('/', $file['attribs']['name'], 2);
-            switch ($components[0]) {
-            case 'doc':
-            case 'example':
-            case 'lib':
-            case 'test':
-            case 'data':
-                $package->addInstallAs(
-                    $file['attribs']['name'], $components[1]
-                );
-            break;
-            case 'migration':
-                $components = explode('/', $components[1]);
-                array_splice($components, count($components) - 1, 0, 'migration');
-                $package->addInstallAs(
-                    $file['attribs']['name'], implode('/', $components)
-                );
-                break;
-            case 'script':
-                $filename = basename($file['attribs']['name']);
-                if (substr($filename, strlen($filename) - 4)) {
-                    $filename = substr($filename, 0, strlen($filename) - 4);
-                }
-                $package->addInstallAs(
-                    $file['attribs']['name'], $filename
-                );
-                break;
-            }
-        }
-
-        $options = $config->getOptions();
-        if (!empty($options['packagexml'])) {
-            $package->debugPackageFile();
-        }
-        if (!empty($options['updatexml'])) {
-            $package->writePackageFile();
-        }
-
-    }
-}
diff --git a/components/lib/Horde/Element/Modules.php b/components/lib/Horde/Element/Modules.php
deleted file mode 100644 (file)
index 9c188f4..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php
-/**
- * The Horde_Element_Modules:: class handles a set of Element modules.
- *
- * PHP version 5
- *
- * @category Horde
- * @package  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * The Horde_Element_Modules:: class handles a set of Element modules.
- *
- * 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  Element
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element_Modules
-implements Iterator, Countable
-{
-    /**
-     * The available modules.
-     *
-     * @var array
-     */
-    private $_modules;
-
-    /**
-     * Constructor.
-     */
-    public function __construct()
-    {
-        $this->_modules = array();
-    }
-
-    /**
-     * Add all modules found in the specified directory.
-     *
-     * @param string $module_directory Load the modules from this dirrectory.
-     *
-     * @return NULL
-     */
-    public function addModulesFromDirectory(
-        $module_directory,
-        $base = 'Horde_Element_Module_'
-    ) {
-        foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($module_directory)) as $file) {
-            if ($file->isFile() && preg_match('/.php$/', $file->getFilename())) {
-                $class = $base . preg_replace("/^(.*)\.php/", '\\1', $file->getFilename());
-                $this->_modules[$class] = new $class();
-            }
-        }
-    }
-
-    /**
-     * Implementation of the Iterator rewind() method. Rewinds the module list.
-     *
-     * return NULL
-     */
-    public function rewind()
-    {
-        reset($this->_modules);
-    }
-
-    /**
-     * Implementation of the Iterator current(). Returns the current module.
-     *
-     * @return mixed The current module.
-     */
-    public function current()
-    {
-        return current($this->_modules);
-    }
-
-    /**
-     * Implementation of the Iterator key() method. Returns the key of the current module.
-     *
-     * @return mixed The class name of the current module.
-     */
-    public function key()
-    {
-        return key($this->_modules);
-    }
-
-    /**
-     * Implementation of the Iterator next() method. Returns the next module.
-     *
-     * @return Horde_Element_Module|null The next module or null if there are no more
-     * modules.
-     */
-    public function next()
-    {
-        return next($this->_modules);
-    }
-
-    /**
-     * Implementation of the Iterator valid() method. Indicates if the current element is a valid element.
-     *
-     * @return boolean Whether the current element is valid
-     */
-    public function valid()
-    {
-        return key($this->_modules) !== null;
-    }
-
-    /**
-     * Implementation of Countable count() method. Returns the number of modules.
-     *
-     * @return integer Number of modules.
-     */
-    public function count()
-    {
-        return count($this->_modules);
-    }
-}
\ No newline at end of file
diff --git a/components/script/horde-components.php b/components/script/horde-components.php
new file mode 100755 (executable)
index 0000000..f0ae98f
--- /dev/null
@@ -0,0 +1,4 @@
+#!/usr/bin/env php
+<?php
+require_once 'Horde/Autoloader/Default.php';
+Horde_Element::main();
diff --git a/components/script/horde-element.php b/components/script/horde-element.php
deleted file mode 100755 (executable)
index f0ae98f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/env php
-<?php
-require_once 'Horde/Autoloader/Default.php';
-Horde_Element::main();
diff --git a/components/test/Components/AllTests.php b/components/test/Components/AllTests.php
new file mode 100644 (file)
index 0000000..deb0ed8
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * All tests for the Horde_Element:: package.
+ *
+ * PHP version 5
+ *
+ * @category   Horde
+ * @package    Element
+ * @subpackage UnitTests
+ * @author     Gunnar Wrobel <wrobel@pardus.de>
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link       http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * Define the main method
+ */
+if (!defined('PHPUnit_MAIN_METHOD')) {
+    define('PHPUnit_MAIN_METHOD', 'Horde_Element_AllTests::main');
+}
+
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
+
+/**
+ * Combine the tests for this package.
+ *
+ * Copyright 2007-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    Element
+ * @subpackage UnitTests
+ * @author     Gunnar Wrobel <wrobel@pardus.de>
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link       http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element_AllTests extends Horde_Test_AllTests
+{
+}
+
+Horde_Element_AllTests::init('Horde_Element', __FILE__);
+
+if (PHPUnit_MAIN_METHOD == 'Horde_Element_AllTests::main') {
+    Horde_Element_AllTests::main();
+}
diff --git a/components/test/Components/Autoload.php b/components/test/Components/Autoload.php
new file mode 100644 (file)
index 0000000..b0b1fb6
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Setup autoloading for the tests.
+ *
+ * PHP version 5
+ *
+ * Copyright 2009-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    Element
+ * @subpackage UnitTests
+ * @author     Gunnar Wrobel <wrobel@pardus.de>
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link       http://pear.horde.org/index.php?package=Element
+ */
+
+if (!spl_autoload_functions()) {
+    spl_autoload_register(
+        create_function(
+            '$class', 
+            '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class);'
+            . '$err_mask = E_ALL ^ E_WARNING;'
+            . '$oldErrorReporting = error_reporting($err_mask);'
+            . 'include "$filename.php";'
+            . 'error_reporting($oldErrorReporting);'
+        )
+    );
+}
+
+/** Catch strict standards */
+error_reporting(E_ALL | E_STRICT);
+
+
+/** Load the basic test definition */
+require_once dirname(__FILE__) . '/StoryTestCase.php';
+
+/** Load stubs */
+require_once dirname(__FILE__) . '/Stub/Parser.php';
diff --git a/components/test/Components/Integration/ElementTest.php b/components/test/Components/Integration/ElementTest.php
new file mode 100644 (file)
index 0000000..9d461db
--- /dev/null
@@ -0,0 +1,121 @@
+<?php
+/**
+ * Test the Element package.
+ *
+ * PHP version 5
+ *
+ * @category   Horde
+ * @package    Element
+ * @subpackage UnitTests
+ * @author     Gunnar Wrobel <wrobel@pardus.de>
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link       http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * Prepare the test setup.
+ */
+require_once dirname(__FILE__) . '/../Autoload.php';
+
+/**
+ * Test the Element package.
+ *
+ * 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    Element
+ * @subpackage UnitTests
+ * @author     Gunnar Wrobel <wrobel@pardus.de>
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link       http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element_Integration_ElementTest
+extends Horde_Element_StoryTestCase
+{
+    /**
+     * @scenario
+     */
+    public function theHelpOptionResultsInHelpOutput()
+    {
+        $this->given('the default Element setup')
+            ->when('calling the package with the help option')
+            ->then('the help will be displayed');
+    }
+
+    /**
+     * @scenario
+     */
+    public function thePearpackagexmlModuleAddsThePOptionInTheHelpOutput()
+    {
+        $this->given('the default Element setup')
+            ->when('calling the package with the help option')
+            ->then('the help will contain the "p" option.');
+    }
+
+    /**
+     * @scenario
+     */
+    public function thePearpackagexmlModuleAddsTheUOptionInTheHelpOutput()
+    {
+        $this->given('the default Element setup')
+            ->when('calling the package with the help option')
+            ->then('the help will contain the "u" option.');
+    }
+
+    /**
+     * @scenario
+     */
+    public function theDevpackageModuleAddsTheDOptionInTheHelpOutput()
+    {
+        $this->given('the default Element setup')
+            ->when('calling the package with the help option')
+            ->then('the help will contain the "d" option.');
+    }
+
+    /**
+     * @scenario
+     */
+    public function theThePOptionProvidesAnUpdatedPackageXml()
+    {
+        $this->given('the default Element setup')
+            ->when('calling the package with the packagexml option and a Horde element')
+            ->then('the new package.xml of the Horde element will be printed.');
+    }
+
+    /**
+     * @todo Test (and fix) the reactions to three more scenarios:
+     *  - invalid XML in the package.xml (e.g. tag missing)
+     *  - empty file list
+     *  - file list with just one entry.
+     *
+     * All three scenarios yield errors which are still hard to
+     * understand.
+     */
+
+    /**
+     * @scenario
+     */
+    public function theInstallerModuleAddsTheIOptionInTheHelpOutput()
+    {
+        $this->given('the default Element setup')
+            ->when('calling the package with the help option')
+            ->then('the help will contain the "i" option.');
+    }
+
+    /**
+     * @scenario
+     */
+    public function theTheIOptionInstallsThePackageFromTheCurrentTree()
+    {
+        $this->given('the default Element setup')
+            ->when('calling the package with the install option and a Horde element')
+            ->then('a new PEAR configuration file will be installed')
+            ->and('the PEAR package will be installed')
+            ->and('the non-Horde dependencies of the Horde element will get installed from the network.')
+            ->and('the Horde dependencies of the Horde element will get installed from the current tree.')
+            ->and('the Horde element will be installed');
+    }
+}
\ No newline at end of file
diff --git a/components/test/Components/StoryTestCase.php b/components/test/Components/StoryTestCase.php
new file mode 100644 (file)
index 0000000..4d05428
--- /dev/null
@@ -0,0 +1,246 @@
+<?php
+/**
+ * Base for story based package testing.
+ *
+ * PHP version 5
+ *
+ * @category   Horde
+ * @package    Element
+ * @subpackage UnitTests
+ * @author     Gunnar Wrobel <wrobel@pardus.de>
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link       http://pear.horde.org/index.php?package=Element
+ */
+
+/**
+ * Base for story based package testing.
+ *
+ * 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    Element
+ * @subpackage UnitTests
+ * @author     Gunnar Wrobel <wrobel@pardus.de>
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link       http://pear.horde.org/index.php?package=Element
+ */
+class Horde_Element_StoryTestCase
+extends PHPUnit_Extensions_Story_TestCase
+{
+    public function tearDown()
+    {
+        if (!empty($this->_temp_dir)) {
+            $this->_rrmdir($this->_temp_dir);
+        }
+    }
+
+    /**
+     * Handle a "given" step.
+     *
+     * @param array  &$world    Joined "world" of variables.
+     * @param string $action    The description of the step.
+     * @param array  $arguments Additional arguments to the step.
+     *
+     * @return mixed The outcome of the step.
+     */
+    public function runGiven(&$world, $action, $arguments)
+    {
+        switch($action) {
+        case 'the default Element setup':
+            break;
+        default:
+            return $this->notImplemented($action);
+        }
+    }
+
+    /**
+     * Handle a "when" step.
+     *
+     * @param array  &$world    Joined "world" of variables.
+     * @param string $action    The description of the step.
+     * @param array  $arguments Additional arguments to the step.
+     *
+     * @return mixed The outcome of the step.
+     */
+    public function runWhen(&$world, $action, $arguments)
+    {
+        switch($action) {
+        case 'calling the package with the help option':
+            $_SERVER['argv'] = array(
+                'horde-element',
+                '--help',
+                dirname(__FILE__) . '/fixture/empty'
+            );
+            ob_start();
+            $parameters = array();
+            $parameters['cli']['parser']['class'] = 'Horde_Element_Stub_Parser';
+            Horde_Element::main($parameters);
+            $world['output'] = ob_get_contents();
+            ob_end_clean();
+            break;
+        case 'calling the package with the packagexml option and a Horde element':
+            $_SERVER['argv'] = array(
+                'horde-element',
+                '--packagexml',
+                dirname(__FILE__) . '/fixture/simple'
+            );
+            ob_start();
+            $parameters = array();
+            $parameters['cli']['parser']['class'] = 'Horde_Element_Stub_Parser';
+            $old_errorreporting = error_reporting(E_ALL & ~E_STRICT);
+            Horde_Element::main($parameters);
+            error_reporting($old_errorreporting);
+            $world['output'] = ob_get_contents();
+            ob_end_clean();
+            break;
+        case 'calling the package with the install option and a Horde element':
+            $_SERVER['argv'] = array(
+                'horde-element',
+                '--install=' . $this->_getTemporaryDirectory(),
+                dirname(__FILE__) . '/../../../'
+            );
+            ob_start();
+            $parameters = array();
+            $parameters['cli']['parser']['class'] = 'Horde_Element_Stub_Parser';
+            $old_errorreporting = error_reporting(E_ALL & ~E_STRICT);
+            Horde_Element::main($parameters);
+            error_reporting($old_errorreporting);
+            $world['output'] = ob_get_contents();
+            ob_end_clean();
+            break;
+        default:
+            return $this->notImplemented($action);
+        }
+    }
+
+    /**
+     * Handle a "then" step.
+     *
+     * @param array  &$world    Joined "world" of variables.
+     * @param string $action    The description of the step.
+     * @param array  $arguments Additional arguments to the step.
+     *
+     * @return mixed The outcome of the step.
+     */
+    public function runThen(&$world, $action, $arguments)
+    {
+        switch($action) {
+        case 'the help will be displayed':
+            $this->assertRegExp(
+                '/-h,[ ]*--help[ ]*show this help message and exit/',
+                $world['output']
+            );
+            break;
+        case 'the help will contain the "p" option.':
+            $this->assertRegExp(
+                '/-p,\s*--packagexml/m',
+                $world['output']
+            );
+            break;
+        case 'the help will contain the "u" option.':
+            $this->assertRegExp(
+                '/-u,\s*--updatexml/',
+                $world['output']
+            );
+            break;
+        case 'the help will contain the "d" option.':
+            $this->assertRegExp(
+                '/-d,\s*--devpackage/',
+                $world['output']
+            );
+            break;
+        case 'the help will contain the "i" option.':
+            $this->assertRegExp(
+                '/-i\s*INSTALL,\s*--install=INSTALL/',
+                $world['output']
+            );
+            break;
+        case 'the new package.xml of the Horde element will be printed.':
+            $this->assertRegExp(
+                '/<file name="New.php" role="php" \/>/',
+                $world['output']
+            );
+            break;
+        case 'a new PEAR configuration file will be installed':
+            $this->assertTrue(
+                file_exists($this->_temp_dir . DIRECTORY_SEPARATOR . '.pearrc')
+            );
+            break;
+        case 'the PEAR package will be installed':
+            $this->assertTrue(
+                file_exists(
+                    $this->_temp_dir . DIRECTORY_SEPARATOR
+                    . 'pear' . DIRECTORY_SEPARATOR 
+                    . 'php' . DIRECTORY_SEPARATOR
+                    . 'PEAR.php'
+                )
+            );
+            break;
+        case 'the non-Horde dependencies of the Horde element will get installed from the network.':
+            var_dump($world['output']);
+            $this->assertTrue(
+                file_exists(
+                    $this->_temp_dir . DIRECTORY_SEPARATOR
+                    . 'pear' . DIRECTORY_SEPARATOR 
+                    . 'php' . DIRECTORY_SEPARATOR
+                    . 'PEAR' . DIRECTORY_SEPARATOR
+                    . 'PackageFileManager2.php'
+                )
+            );
+            break;
+        case 'the Horde dependencies of the Horde element will get installed from the current tree.':
+            $this->assertTrue(
+                file_exists(
+                    $this->_temp_dir . DIRECTORY_SEPARATOR
+                    . 'pear' . DIRECTORY_SEPARATOR 
+                    . 'php' . DIRECTORY_SEPARATOR
+                    . 'Horde' . DIRECTORY_SEPARATOR
+                    . 'Autoloader.php'
+                )
+            );
+            break;
+        case 'the Horde element will be installed':
+            $this->assertTrue(
+                file_exists(
+                    $this->_temp_dir . DIRECTORY_SEPARATOR
+                    . 'pear' . DIRECTORY_SEPARATOR 
+                    . 'php' . DIRECTORY_SEPARATOR
+                    . 'Horde' . DIRECTORY_SEPARATOR
+                    . 'Element.php'
+                )
+            );
+            break;
+        default:
+            return $this->notImplemented($action);
+        }
+    }
+
+    private function _getTemporaryDirectory()
+    {
+        $this->_temp_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR
+            . 'Horde_Element_' . mt_rand();
+        mkdir($this->_temp_dir);
+        return $this->_temp_dir;
+    }
+
+    private function _rrmdir($dir)
+    {
+        if (is_dir($dir)) {
+            $objects = scandir($dir);
+            foreach ($objects as $object) {
+                if ($object != '.' && $object != '..') {
+                    if (filetype($dir . DIRECTORY_SEPARATOR . $object) == 'dir') {
+                        $this->_rrmdir($dir . DIRECTORY_SEPARATOR . $object);
+                    } else {
+                        unlink($dir . DIRECTORY_SEPARATOR . $object);
+                    }
+                }
+            }
+            reset($objects);
+            rmdir($dir);
+        }
+    } 
+}
\ No newline at end of file
diff --git a/components/test/Components/Stub/Parser.php b/components/test/Components/Stub/Parser.php
new file mode 100644 (file)
index 0000000..e704661
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+class Horde_Element_Stub_Parser
+extends Horde_Argv_Parser
+{
+    public function parserExit($status = 0, $msg = null)
+    {
+        if ($msg)
+            fwrite(STDERR, $msg);
+    }
+}
\ No newline at end of file
diff --git a/components/test/Components/fixture/empty/package.xml b/components/test/Components/fixture/empty/package.xml
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/components/test/Components/fixture/simple/lib/New.php b/components/test/Components/fixture/simple/lib/New.php
new file mode 100644 (file)
index 0000000..a814366
--- /dev/null
@@ -0,0 +1 @@
+<?php
\ No newline at end of file
diff --git a/components/test/Components/fixture/simple/lib/Second.php b/components/test/Components/fixture/simple/lib/Second.php
new file mode 100644 (file)
index 0000000..b3d9bbc
--- /dev/null
@@ -0,0 +1 @@
+<?php
diff --git a/components/test/Components/fixture/simple/package.xml b/components/test/Components/fixture/simple/package.xml
new file mode 100644 (file)
index 0000000..1e9db87
--- /dev/null
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package packagerversion="1.9.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
+ <name>Fixture</name>
+ <channel>pear.horde.org</channel>
+ <summary>Test fixture.</summary>
+ <description>A dummy package.xml used for testing the Horde_Element package.</description>
+ <lead>
+  <name>Gunnar Wrobel</name>
+  <user>wrobel</user>
+  <email>p@rdus.de</email>
+  <active>yes</active>
+ </lead>
+ <date>2010-08-22</date>
+ <time>21:12:03</time>
+ <version>
+  <release>0.0.1</release>
+  <api>0.0.1</api>
+ </version>
+ <stability>
+  <release>alpha</release>
+  <api>alpha</api>
+ </stability>
+ <license uri="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html">LGPL</license>
+ <notes>
+* Initial release
+ </notes>
+ <contents>
+  <dir baseinstalldir="/" name="/">
+   <dir name="lib">
+    <file name="Old.php" role="php" />
+   </dir> <!-- /lib -->
+  </dir> <!-- / -->
+ </contents>
+ <dependencies>
+  <required>
+   <php>
+    <min>5.0.0</min>
+   </php>
+   <pearinstaller>
+    <min>1.7.0</min>
+   </pearinstaller>
+  </required>
+ </dependencies>
+ <phprelease>
+  <filelist>
+   <install as="Old.php" name="lib/Old.php" />
+  </filelist>
+ </phprelease>
+ <changelog>
+  <release>
+   <version>
+    <release>0.0.1</release>
+    <api>0.0.1</api>
+   </version>
+   <stability>
+    <release>alpha</release>
+    <api>alpha</api>
+   </stability>
+   <date>2010-08-22</date>
+   <license uri="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html">LGPL</license>
+   <notes>
+* Initial release
+   </notes>
+  </release>
+ </changelog>
+</package>
diff --git a/components/test/Components/phpunit.xml b/components/test/Components/phpunit.xml
new file mode 100644 (file)
index 0000000..502d3c9
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit>
+  <filter>
+    <whitelist>
+      <directory suffix=".php">../../../lib</directory>
+    </whitelist>
+  </filter>
+</phpunit>
diff --git a/components/test/Horde/Element/AllTests.php b/components/test/Horde/Element/AllTests.php
deleted file mode 100644 (file)
index deb0ed8..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-/**
- * All tests for the Horde_Element:: package.
- *
- * PHP version 5
- *
- * @category   Horde
- * @package    Element
- * @subpackage UnitTests
- * @author     Gunnar Wrobel <wrobel@pardus.de>
- * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link       http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * Define the main method
- */
-if (!defined('PHPUnit_MAIN_METHOD')) {
-    define('PHPUnit_MAIN_METHOD', 'Horde_Element_AllTests::main');
-}
-
-/**
- * Prepare the test setup.
- */
-require_once 'Horde/Test/AllTests.php';
-
-/**
- * Combine the tests for this package.
- *
- * Copyright 2007-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    Element
- * @subpackage UnitTests
- * @author     Gunnar Wrobel <wrobel@pardus.de>
- * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link       http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element_AllTests extends Horde_Test_AllTests
-{
-}
-
-Horde_Element_AllTests::init('Horde_Element', __FILE__);
-
-if (PHPUnit_MAIN_METHOD == 'Horde_Element_AllTests::main') {
-    Horde_Element_AllTests::main();
-}
diff --git a/components/test/Horde/Element/Autoload.php b/components/test/Horde/Element/Autoload.php
deleted file mode 100644 (file)
index b0b1fb6..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * Setup autoloading for the tests.
- *
- * PHP version 5
- *
- * Copyright 2009-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    Element
- * @subpackage UnitTests
- * @author     Gunnar Wrobel <wrobel@pardus.de>
- * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link       http://pear.horde.org/index.php?package=Element
- */
-
-if (!spl_autoload_functions()) {
-    spl_autoload_register(
-        create_function(
-            '$class', 
-            '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class);'
-            . '$err_mask = E_ALL ^ E_WARNING;'
-            . '$oldErrorReporting = error_reporting($err_mask);'
-            . 'include "$filename.php";'
-            . 'error_reporting($oldErrorReporting);'
-        )
-    );
-}
-
-/** Catch strict standards */
-error_reporting(E_ALL | E_STRICT);
-
-
-/** Load the basic test definition */
-require_once dirname(__FILE__) . '/StoryTestCase.php';
-
-/** Load stubs */
-require_once dirname(__FILE__) . '/Stub/Parser.php';
diff --git a/components/test/Horde/Element/Integration/ElementTest.php b/components/test/Horde/Element/Integration/ElementTest.php
deleted file mode 100644 (file)
index 9d461db..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-/**
- * Test the Element package.
- *
- * PHP version 5
- *
- * @category   Horde
- * @package    Element
- * @subpackage UnitTests
- * @author     Gunnar Wrobel <wrobel@pardus.de>
- * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link       http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * Prepare the test setup.
- */
-require_once dirname(__FILE__) . '/../Autoload.php';
-
-/**
- * Test the Element package.
- *
- * 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    Element
- * @subpackage UnitTests
- * @author     Gunnar Wrobel <wrobel@pardus.de>
- * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link       http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element_Integration_ElementTest
-extends Horde_Element_StoryTestCase
-{
-    /**
-     * @scenario
-     */
-    public function theHelpOptionResultsInHelpOutput()
-    {
-        $this->given('the default Element setup')
-            ->when('calling the package with the help option')
-            ->then('the help will be displayed');
-    }
-
-    /**
-     * @scenario
-     */
-    public function thePearpackagexmlModuleAddsThePOptionInTheHelpOutput()
-    {
-        $this->given('the default Element setup')
-            ->when('calling the package with the help option')
-            ->then('the help will contain the "p" option.');
-    }
-
-    /**
-     * @scenario
-     */
-    public function thePearpackagexmlModuleAddsTheUOptionInTheHelpOutput()
-    {
-        $this->given('the default Element setup')
-            ->when('calling the package with the help option')
-            ->then('the help will contain the "u" option.');
-    }
-
-    /**
-     * @scenario
-     */
-    public function theDevpackageModuleAddsTheDOptionInTheHelpOutput()
-    {
-        $this->given('the default Element setup')
-            ->when('calling the package with the help option')
-            ->then('the help will contain the "d" option.');
-    }
-
-    /**
-     * @scenario
-     */
-    public function theThePOptionProvidesAnUpdatedPackageXml()
-    {
-        $this->given('the default Element setup')
-            ->when('calling the package with the packagexml option and a Horde element')
-            ->then('the new package.xml of the Horde element will be printed.');
-    }
-
-    /**
-     * @todo Test (and fix) the reactions to three more scenarios:
-     *  - invalid XML in the package.xml (e.g. tag missing)
-     *  - empty file list
-     *  - file list with just one entry.
-     *
-     * All three scenarios yield errors which are still hard to
-     * understand.
-     */
-
-    /**
-     * @scenario
-     */
-    public function theInstallerModuleAddsTheIOptionInTheHelpOutput()
-    {
-        $this->given('the default Element setup')
-            ->when('calling the package with the help option')
-            ->then('the help will contain the "i" option.');
-    }
-
-    /**
-     * @scenario
-     */
-    public function theTheIOptionInstallsThePackageFromTheCurrentTree()
-    {
-        $this->given('the default Element setup')
-            ->when('calling the package with the install option and a Horde element')
-            ->then('a new PEAR configuration file will be installed')
-            ->and('the PEAR package will be installed')
-            ->and('the non-Horde dependencies of the Horde element will get installed from the network.')
-            ->and('the Horde dependencies of the Horde element will get installed from the current tree.')
-            ->and('the Horde element will be installed');
-    }
-}
\ No newline at end of file
diff --git a/components/test/Horde/Element/StoryTestCase.php b/components/test/Horde/Element/StoryTestCase.php
deleted file mode 100644 (file)
index 4d05428..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-<?php
-/**
- * Base for story based package testing.
- *
- * PHP version 5
- *
- * @category   Horde
- * @package    Element
- * @subpackage UnitTests
- * @author     Gunnar Wrobel <wrobel@pardus.de>
- * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link       http://pear.horde.org/index.php?package=Element
- */
-
-/**
- * Base for story based package testing.
- *
- * 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    Element
- * @subpackage UnitTests
- * @author     Gunnar Wrobel <wrobel@pardus.de>
- * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link       http://pear.horde.org/index.php?package=Element
- */
-class Horde_Element_StoryTestCase
-extends PHPUnit_Extensions_Story_TestCase
-{
-    public function tearDown()
-    {
-        if (!empty($this->_temp_dir)) {
-            $this->_rrmdir($this->_temp_dir);
-        }
-    }
-
-    /**
-     * Handle a "given" step.
-     *
-     * @param array  &$world    Joined "world" of variables.
-     * @param string $action    The description of the step.
-     * @param array  $arguments Additional arguments to the step.
-     *
-     * @return mixed The outcome of the step.
-     */
-    public function runGiven(&$world, $action, $arguments)
-    {
-        switch($action) {
-        case 'the default Element setup':
-            break;
-        default:
-            return $this->notImplemented($action);
-        }
-    }
-
-    /**
-     * Handle a "when" step.
-     *
-     * @param array  &$world    Joined "world" of variables.
-     * @param string $action    The description of the step.
-     * @param array  $arguments Additional arguments to the step.
-     *
-     * @return mixed The outcome of the step.
-     */
-    public function runWhen(&$world, $action, $arguments)
-    {
-        switch($action) {
-        case 'calling the package with the help option':
-            $_SERVER['argv'] = array(
-                'horde-element',
-                '--help',
-                dirname(__FILE__) . '/fixture/empty'
-            );
-            ob_start();
-            $parameters = array();
-            $parameters['cli']['parser']['class'] = 'Horde_Element_Stub_Parser';
-            Horde_Element::main($parameters);
-            $world['output'] = ob_get_contents();
-            ob_end_clean();
-            break;
-        case 'calling the package with the packagexml option and a Horde element':
-            $_SERVER['argv'] = array(
-                'horde-element',
-                '--packagexml',
-                dirname(__FILE__) . '/fixture/simple'
-            );
-            ob_start();
-            $parameters = array();
-            $parameters['cli']['parser']['class'] = 'Horde_Element_Stub_Parser';
-            $old_errorreporting = error_reporting(E_ALL & ~E_STRICT);
-            Horde_Element::main($parameters);
-            error_reporting($old_errorreporting);
-            $world['output'] = ob_get_contents();
-            ob_end_clean();
-            break;
-        case 'calling the package with the install option and a Horde element':
-            $_SERVER['argv'] = array(
-                'horde-element',
-                '--install=' . $this->_getTemporaryDirectory(),
-                dirname(__FILE__) . '/../../../'
-            );
-            ob_start();
-            $parameters = array();
-            $parameters['cli']['parser']['class'] = 'Horde_Element_Stub_Parser';
-            $old_errorreporting = error_reporting(E_ALL & ~E_STRICT);
-            Horde_Element::main($parameters);
-            error_reporting($old_errorreporting);
-            $world['output'] = ob_get_contents();
-            ob_end_clean();
-            break;
-        default:
-            return $this->notImplemented($action);
-        }
-    }
-
-    /**
-     * Handle a "then" step.
-     *
-     * @param array  &$world    Joined "world" of variables.
-     * @param string $action    The description of the step.
-     * @param array  $arguments Additional arguments to the step.
-     *
-     * @return mixed The outcome of the step.
-     */
-    public function runThen(&$world, $action, $arguments)
-    {
-        switch($action) {
-        case 'the help will be displayed':
-            $this->assertRegExp(
-                '/-h,[ ]*--help[ ]*show this help message and exit/',
-                $world['output']
-            );
-            break;
-        case 'the help will contain the "p" option.':
-            $this->assertRegExp(
-                '/-p,\s*--packagexml/m',
-                $world['output']
-            );
-            break;
-        case 'the help will contain the "u" option.':
-            $this->assertRegExp(
-                '/-u,\s*--updatexml/',
-                $world['output']
-            );
-            break;
-        case 'the help will contain the "d" option.':
-            $this->assertRegExp(
-                '/-d,\s*--devpackage/',
-                $world['output']
-            );
-            break;
-        case 'the help will contain the "i" option.':
-            $this->assertRegExp(
-                '/-i\s*INSTALL,\s*--install=INSTALL/',
-                $world['output']
-            );
-            break;
-        case 'the new package.xml of the Horde element will be printed.':
-            $this->assertRegExp(
-                '/<file name="New.php" role="php" \/>/',
-                $world['output']
-            );
-            break;
-        case 'a new PEAR configuration file will be installed':
-            $this->assertTrue(
-                file_exists($this->_temp_dir . DIRECTORY_SEPARATOR . '.pearrc')
-            );
-            break;
-        case 'the PEAR package will be installed':
-            $this->assertTrue(
-                file_exists(
-                    $this->_temp_dir . DIRECTORY_SEPARATOR
-                    . 'pear' . DIRECTORY_SEPARATOR 
-                    . 'php' . DIRECTORY_SEPARATOR
-                    . 'PEAR.php'
-                )
-            );
-            break;
-        case 'the non-Horde dependencies of the Horde element will get installed from the network.':
-            var_dump($world['output']);
-            $this->assertTrue(
-                file_exists(
-                    $this->_temp_dir . DIRECTORY_SEPARATOR
-                    . 'pear' . DIRECTORY_SEPARATOR 
-                    . 'php' . DIRECTORY_SEPARATOR
-                    . 'PEAR' . DIRECTORY_SEPARATOR
-                    . 'PackageFileManager2.php'
-                )
-            );
-            break;
-        case 'the Horde dependencies of the Horde element will get installed from the current tree.':
-            $this->assertTrue(
-                file_exists(
-                    $this->_temp_dir . DIRECTORY_SEPARATOR
-                    . 'pear' . DIRECTORY_SEPARATOR 
-                    . 'php' . DIRECTORY_SEPARATOR
-                    . 'Horde' . DIRECTORY_SEPARATOR
-                    . 'Autoloader.php'
-                )
-            );
-            break;
-        case 'the Horde element will be installed':
-            $this->assertTrue(
-                file_exists(
-                    $this->_temp_dir . DIRECTORY_SEPARATOR
-                    . 'pear' . DIRECTORY_SEPARATOR 
-                    . 'php' . DIRECTORY_SEPARATOR
-                    . 'Horde' . DIRECTORY_SEPARATOR
-                    . 'Element.php'
-                )
-            );
-            break;
-        default:
-            return $this->notImplemented($action);
-        }
-    }
-
-    private function _getTemporaryDirectory()
-    {
-        $this->_temp_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR
-            . 'Horde_Element_' . mt_rand();
-        mkdir($this->_temp_dir);
-        return $this->_temp_dir;
-    }
-
-    private function _rrmdir($dir)
-    {
-        if (is_dir($dir)) {
-            $objects = scandir($dir);
-            foreach ($objects as $object) {
-                if ($object != '.' && $object != '..') {
-                    if (filetype($dir . DIRECTORY_SEPARATOR . $object) == 'dir') {
-                        $this->_rrmdir($dir . DIRECTORY_SEPARATOR . $object);
-                    } else {
-                        unlink($dir . DIRECTORY_SEPARATOR . $object);
-                    }
-                }
-            }
-            reset($objects);
-            rmdir($dir);
-        }
-    } 
-}
\ No newline at end of file
diff --git a/components/test/Horde/Element/Stub/Parser.php b/components/test/Horde/Element/Stub/Parser.php
deleted file mode 100644 (file)
index e704661..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-class Horde_Element_Stub_Parser
-extends Horde_Argv_Parser
-{
-    public function parserExit($status = 0, $msg = null)
-    {
-        if ($msg)
-            fwrite(STDERR, $msg);
-    }
-}
\ No newline at end of file
diff --git a/components/test/Horde/Element/fixture/empty/package.xml b/components/test/Horde/Element/fixture/empty/package.xml
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/components/test/Horde/Element/fixture/simple/lib/New.php b/components/test/Horde/Element/fixture/simple/lib/New.php
deleted file mode 100644 (file)
index a814366..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?php
\ No newline at end of file
diff --git a/components/test/Horde/Element/fixture/simple/lib/Second.php b/components/test/Horde/Element/fixture/simple/lib/Second.php
deleted file mode 100644 (file)
index b3d9bbc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/components/test/Horde/Element/fixture/simple/package.xml b/components/test/Horde/Element/fixture/simple/package.xml
deleted file mode 100644 (file)
index 1e9db87..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.9.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
- <name>Fixture</name>
- <channel>pear.horde.org</channel>
- <summary>Test fixture.</summary>
- <description>A dummy package.xml used for testing the Horde_Element package.</description>
- <lead>
-  <name>Gunnar Wrobel</name>
-  <user>wrobel</user>
-  <email>p@rdus.de</email>
-  <active>yes</active>
- </lead>
- <date>2010-08-22</date>
- <time>21:12:03</time>
- <version>
-  <release>0.0.1</release>
-  <api>0.0.1</api>
- </version>
- <stability>
-  <release>alpha</release>
-  <api>alpha</api>
- </stability>
- <license uri="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html">LGPL</license>
- <notes>
-* Initial release
- </notes>
- <contents>
-  <dir baseinstalldir="/" name="/">
-   <dir name="lib">
-    <file name="Old.php" role="php" />
-   </dir> <!-- /lib -->
-  </dir> <!-- / -->
- </contents>
- <dependencies>
-  <required>
-   <php>
-    <min>5.0.0</min>
-   </php>
-   <pearinstaller>
-    <min>1.7.0</min>
-   </pearinstaller>
-  </required>
- </dependencies>
- <phprelease>
-  <filelist>
-   <install as="Old.php" name="lib/Old.php" />
-  </filelist>
- </phprelease>
- <changelog>
-  <release>
-   <version>
-    <release>0.0.1</release>
-    <api>0.0.1</api>
-   </version>
-   <stability>
-    <release>alpha</release>
-    <api>alpha</api>
-   </stability>
-   <date>2010-08-22</date>
-   <license uri="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html">LGPL</license>
-   <notes>
-* Initial release
-   </notes>
-  </release>
- </changelog>
-</package>
diff --git a/components/test/Horde/Element/phpunit.xml b/components/test/Horde/Element/phpunit.xml
deleted file mode 100644 (file)
index 502d3c9..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<phpunit>
-  <filter>
-    <whitelist>
-      <directory suffix=".php">../../../lib</directory>
-    </whitelist>
-  </filter>
-</phpunit>