Skip to content

Commit

Permalink
Add temporary files created by PHPUnit tests to gitignore file
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnert committed Jul 25, 2014
1 parent 9115c65 commit 067c523
Show file tree
Hide file tree
Showing 14 changed files with 221 additions and 277 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
php.ini
composer.lock
composer.phar
.idea
/src/var/log/*.log
/target
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -15,9 +15,10 @@ before_script:
- composer selfupdate

script:
- ant composer-init
- ant build
- php ocular.phar code-coverage:upload --format=php-clover $TRAVIS_BUILD_DIR/target/reports/unit/clover.xml

notifications:
email: info@appserver.io
hipchat: 95d47a72c5372d4a0fef20048c3200@Appserver
hipchat: 95d47a72c5372d4a0fef20048c3200@Appserver
11 changes: 11 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,11 @@
# Version 0.2.1

## Bugfixes

* None

## Features

* Refactoring ANT PHPUnit execution process
* Composer integration by optimizing folder structure (move bootstrap.php + phpunit.xml.dist => phpunit.xml)
* Switch to new appserver-io/build build- and deployment environment
41 changes: 30 additions & 11 deletions README.md
@@ -1,15 +1,34 @@
TechDivision_WebServer
======================
____________________________________________
[![Latest Stable Version](https://poser.pugx.org/techdivision/webserver/v/stable.png)](https://packagist.org/packages/techdivision/webserver) [![Total Downloads](https://poser.pugx.org/techdivision/webserver/downloads.png)](https://packagist.org/packages/techdivision/webserver) [![Latest Unstable Version](https://poser.pugx.org/techdivision/webserver/v/unstable.png)](https://packagist.org/packages/techdivision/webserver) [![License](https://poser.pugx.org/techdivision/webserver/license.png)](https://packagist.org/packages/techdivision/webserver) [![Build Status](https://travis-ci.org/techdivision/TechDivision_WebServer.png)](https://travis-ci.org/techdivision/TechDivision_WebServer)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/techdivision/TechDivision_WebServer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/techdivision/TechDivision_WebServer/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/techdivision/TechDivision_WebServer/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/techdivision/TechDivision_WebServer/?branch=master)
____________________________________________
# TechDivision_WebServer

####Are you serious? A web server written in pure PHP for PHP?
[![Latest Stable Version](https://poser.pugx.org/techdivision/webserver/v/stable.png)](https://packagist.org/packages/techdivision/webserver) [![Total Downloads](https://poser.pugx.org/techdivision/webserver/downloads.png)](https://packagist.org/packages/techdivision/webserver) [![Latest Unstable Version](https://poser.pugx.org/techdivision/webserver/v/unstable.png)](https://packagist.org/packages/techdivision/webserver) [![License](https://poser.pugx.org/techdivision/webserver/license.png)](https://packagist.org/packages/techdivision/webserver) [![Build Status](https://travis-ci.org/techdivision/TechDivision_WebServer.png)](https://travis-ci.org/techdivision/TechDivision_WebServer)[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/techdivision/TechDivision_WebServer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/techdivision/TechDivision_WebServer/?branch=master)[![Code Coverage](https://scrutinizer-ci.com/g/techdivision/TechDivision_WebServer/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/techdivision/TechDivision_WebServer/?branch=master)

## Introduction

Are you serious? A web server written in pure PHP for PHP? Ohhhh Yes! :) This is a HTTP/1.1 compliant webserver written in php.
And the best... it has a php module and it's multithreaded!

Ohhhh Yes! :) This is a HTTP/1.1 compliant webserver written in php. And the best... it has a php module and it's multithreaded!
We use this in the [`appserver.io`](<http://www.appserver.io>) project as a server component for the WebContainer.

## Documentation
Our [documentation can be found here](<https://github.com/techdivision/TechDivision_AppserverDocumentation/blob/master/docs/components/servers/webserver/>).
## Installation

If you want to use the web server with your application you can install it by adding

```sh
{
"require": {
"techdivision/webserver": "dev-master"
},
}
```

to your ```composer.json``` and invoke ```composer update``` in your project.

## Usage

Coming soon!

# External Links

* appserver.io [combined documentation](http://docs.appserver.io)
* [Getting started](https://github.com/techdivision/TechDivision_AppserverDocumentation/tree/master/docs/getting-started)
* Documentation found on [GitHub](https://github.com/techdivision/TechDivision_AppserverDocumentation)
11 changes: 6 additions & 5 deletions tests/bootstrap.php → bootstrap.php
@@ -1,6 +1,7 @@
<?php

/**
* \TechDivision\WebServer\DummyTest
* bootstrap.php
*
* NOTICE OF LICENSE
*
Expand All @@ -12,12 +13,12 @@
*
* @category Webserver
* @package TechDivision_WebServer
* @subpackage Tests
* @subpackage Authentication
* @author Johann Zelger <jz@techdivision.com>
* @copyright 2014 TechDivision GmbH <info@techdivision.com>
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @link https://github.com/techdivision/TechDivision_Http
* @link https://github.com/techdivision/TechDivision_WebServer
*/

$loader = require '${php-target.dir}/vendor/autoload.php';
$loader->add('TechDivision\\WebServer\\', '${php-target.dir}/vendor/techdivision/webserver/src');
$loader = require 'vendor/autoload.php';
$loader->add('TechDivision\\WebServer', 'src');
14 changes: 1 addition & 13 deletions build.default.properties
Expand Up @@ -8,17 +8,5 @@
# @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
#--------------------------------------------------------------------------------

# ---- Default Operating System -------------------------------------------------
os.family = mac

# ---- Module Release Settings --------------------------------------------------
release.version = 0.2.0
release.stability = beta

# ---- Module Api Settings ------------------------------------------------------
api.version = 0.2.0
api.stability = beta

# ---- Deployment Settings ------------------------------------------------------
# Directories
deploy.dir = /opt/appserver/app/code
release.version = 0.2.1
180 changes: 37 additions & 143 deletions build.xml
@@ -1,166 +1,60 @@
<?xml version="1.0"?>
<project name="TechDivision_WebServer" default="deploy" basedir=".">
<!DOCTYPE project>
<project name="techdivision/webserver" default="composer-init" basedir=".">

<!-- initialize ENV variable -->
<property environment="env" />

<!-- initialize file based properties -->
<property file="${basedir}/build.properties"/>
<property file="${basedir}/build.default.properties"/>
<property file="${basedir}/build.${os.family}.properties"/>

<property environment="env" />

<property name="namespace" value="techdivision" />
<property name="module" value="webserver"/>

<!-- initialize the library specific properties -->
<property name="codepool" value="vendor"/>
<property name="unique.name" value="${codepool}/${namespace}/${module}" />
<property name="php-src.dir" value="${basedir}/src" />
<property name="php-test.dir" value="${basedir}/tests" />
<property name="php-target.dir" value="${basedir}/target"/>

<!-- ==================================================================== -->
<!-- Cleans the directories with the generated source files -->
<!-- ==================================================================== -->
<target name="clean" description="Cleans almost everything, so use carefully.">
<delete dir="${php-target.dir}" includeemptydirs="true" quiet="false" verbose="true" failonerror="true"/>
</target>

<!-- ==================================================================== -->
<!-- Prepares all the required directories -->
<!-- ==================================================================== -->
<target name="prepare" depends="clean" description="Prepares all the required directories.">
<mkdir dir="${php-target.dir}" />
<mkdir dir="${php-target.dir}/reports/unit/coverage" />
</target>


<!-- initialize the directory where we can find the real build files -->
<property name="vendor.dir" value ="${basedir}/${codepool}" />
<property name="build.dir" value="${vendor.dir}/appserver-io/build" />

<!-- ==================================================================== -->
<!-- Copies the sources to the target directory -->
<!-- Import the common build configuration file -->
<!-- ==================================================================== -->
<target name="copy" depends="prepare" description="Copies the sources to the target directory.">
<copy todir="${php-target.dir}/${unique.name}/src" preservelastmodified="true" overwrite="true">
<fileset dir="${php-src.dir}">
<include name="**/*" />
</fileset>
</copy>
</target>
<import file="${build.dir}/common.xml" optional="true"/>

<!-- ==================================================================== -->
<!-- Copies the sources to the deploy directory -->
<!-- Checks if composer has installed it's dependencies -->
<!-- ==================================================================== -->
<target name="deploy" description="Copies the sources to the deploy directory.">
<antcall target="prepare"/>
<antcall target="copy"/>
<copy todir="${deploy.dir}" preservelastmodified="true" overwrite="true">
<fileset dir="${php-target.dir}">
<include name="**/*"/>
</fileset>
</copy>
<target name="is-composer-installed">
<condition property="composer.present">
<available file="${build.dir}" type="dir"/>
</condition>
</target>

<!-- ==================================================================== -->
<!-- Generates the API documentation -->
<!-- Installs all dependencies defined in composer.json -->
<!-- ==================================================================== -->
<target name="apidoc" description="Generates the API documentation.">
<exec executable="phpdoc">
<arg line="-t ${php-target.dir}/docs -d ${php-src.dir}"/>
</exec>
</target>

<!-- ==================================================================== -->
<!-- Runs the code sniffer and generates a report -->
<!-- ==================================================================== -->
<target name="phpcs" description="Runs the code sniffer and generates a report.">
<exec executable="phpcs" failonerror="true">
<!-- call phpcs without report-file to get error message on build console -->
<arg line="-n --extensions=php --standard=phpcs.xml --ignore=src/TechDivision/WebServer/Modules/FastCgiClient.php --ignore=src/TechDivision/WebServer/Modules/CommunicationException.php ./"/>
<target name="composer-install" depends="is-composer-installed" unless="composer.present" description="Installs all dependencies defined in composer.json">
<exec dir="${basedir}" executable="composer">
<arg line="--no-interaction --dev install"/>
</exec>
</target>

<!-- ==================================================================== -->
<!-- Runs the copy and paste detection -->
<!-- Updates composer dependencies defined in composer.json -->
<!-- ==================================================================== -->
<target name="phpcpd" description="Runs the copy and paste detection.">
<exec executable="phpcpd">
<arg line="--log-pmd ${php-target.dir}/reports/pmd-cpd.xml ${php-src.dir}"/>
<target name="composer-update" depends="is-composer-installed" if="composer.present" description="Updates composer dependencies defined in composer.json">
<exec dir="${basedir}" executable="composer">
<arg line="--no-interaction --dev update"/>
</exec>
</target>

<!-- ==================================================================== -->
<!-- Generate phploc.csv -->
<!-- ==================================================================== -->
<target name="phploc" description="Generate phploc.csv">
<exec executable="phploc">
<arg line="--log-xml ${php-target.dir}/reports/phploc.xml ${php-src.dir}"/>
</exec>
</target>

<!-- ==================================================================== -->
<!-- Runs the PHPDepend tool and generats a graphs -->
<!-- ==================================================================== -->
<target name="pdepend" description="Runs the PHPDepend tool and generats a graphs.">
<exec executable="pdepend">
<arg line="--summary-xml=${php-target.dir}/reports/pdepend.xml --jdepend-xml=${php-target.dir}/reports/jdepend.xml --jdepend-chart=${php-target.dir}/reports/jdepend.svg --overview-pyramid=${php-target.dir}/reports/pdepend-pyramid.svg ${php-src.dir}" />
</exec>
</target>

<!-- ==================================================================== -->
<!-- Runs the PHP mess detector tool -->
<!-- ==================================================================== -->
<target name="phpmd" description="Runs the PHP Mess detector tool.">
<exec executable="phpmd">
<arg line="${php-src.dir} xml codesize,unusedcode --reportfile ${php-target.dir}/reports/pmd.xml" />
</exec>
</target>

<!-- ==================================================================== -->
<!-- Copies the test sources to the target directory -->
<!-- ==================================================================== -->
<target name="copy-tests" depends="copy" description="Copies the test sources to the target directory.">
<!-- copy the test classes to the target directory -->
<copy todir="${php-target.dir}/${unique.name}/src">
<fileset dir="${php-test.dir}">
<include name="**/*" />
</fileset>
<filterchain>
<expandproperties/>
</filterchain>
</copy>
<!-- copy the composer configuration file to the target directory -->
<copy file="${basedir}/composer.json" todir="${php-target.dir}" />
<!-- install composer packages -->
<exec dir="${php-target.dir}" executable="composer">
<env key="PATH" value="${instance.base.dir}/bin:${env.PATH}"/>
<arg line="--no-interaction update"/>
</exec>
</target>

<!-- ==================================================================== -->
<!-- Runs the PHPUnit tests on Travis-CI and generates a report -->
<!-- ==================================================================== -->
<target name="run-tests" depends="copy-tests" description="Runs the PHPUnit tests on Travis-CI and generates a report.">
<exec executable="phpunit" dir="${php-target.dir}/${unique.name}/src">
<arg line="--configuration phpunit.xml.dist" />
</exec>
</target>

<!-- ==================================================================== -->
<!-- Runs the PHPUnit tests and generates a report -->
<!-- ==================================================================== -->
<target name="run-tests-in-runtime" depends="copy-tests" description="Runs the PHPUnit tests and generates a report.">
<exec executable="${instance.base.dir}/bin/php" dir="${php-target.dir}/${unique.name}/src" failonerror="true">
<arg line="-d zend_extension=xdebug.so ${instance.base.dir}/app/code/vendor/bin/phpunit --configuration phpunit.xml.dist" />
</exec>
</target>

<!-- ==================================================================== -->
<!-- Runs the PHPUnit tests and generates the code metrics -->
<!-- ==================================================================== -->
<target name="build" description="Runs the PHPUnit tests and generates the code metrics.">
<antcall target="phpcs"/>
<antcall target="run-tests"/>
<!--
<antcall target="apidoc"/>
<antcall target="phpcpd"/>
<antcall target="phploc"/>
<antcall target="pdepend"/>
<antcall target="phpmd"/>
-->
<!-- ===================================================================== -->
<!-- Checks if the build- and deployment stub has already been initialized -->
<!-- ===================================================================== -->
<target name="composer-init">
<antcall target="composer-install"/>
<antcall target="composer-update"/>
</target>

</project>
</project>

0 comments on commit 067c523

Please sign in to comment.