Skip to content

Commit c4ff695

Browse files
Initial commit
0 parents  commit c4ff695

File tree

10 files changed

+851
-0
lines changed

10 files changed

+851
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
phpunit.xml
2+
composer.lock
3+
composer.phar
4+
vendor/
5+
cache.properties
6+
build/SebastianBergmann
7+
build/LICENSE
8+
build/README.md
9+
build/*.tgz

LICENSE

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Diff
2+
3+
Copyright (c) 2002-2013, Sebastian Bergmann <[email protected]>.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions
8+
are met:
9+
10+
* Redistributions of source code must retain the above copyright
11+
notice, this list of conditions and the following disclaimer.
12+
13+
* Redistributions in binary form must reproduce the above copyright
14+
notice, this list of conditions and the following disclaimer in
15+
the documentation and/or other materials provided with the
16+
distribution.
17+
18+
* Neither the name of Sebastian Bergmann nor the names of his
19+
contributors may be used to endorse or promote products derived
20+
from this software without specific prior written permission.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26+
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32+
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33+
POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Diff
2+
3+
Diff implementation for PHP, factored out of PHPUnit into a stand-alone component.
4+
5+
## Installation
6+
7+
You can use the [PEAR Installer](http://pear.php.net/manual/en/guide.users.commandline.cli.php) or [Composer](http://getcomposer.org/) to download and install this package as well as its dependencies.
8+
9+
### PEAR Installer
10+
11+
The following two commands (which you may have to run as `root`) are all that is required to install this package using the PEAR Installer:
12+
13+
pear config-set auto_discover 1
14+
pear install pear.phpunit.de/Diff
15+
16+
### Composer
17+
18+
To add this package as a local, per-project dependency to your project, simply add a dependency on `sebastian/diff` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Diff 1.0:
19+
20+
{
21+
"require": {
22+
"sebastian/diff": "1.0.*"
23+
}
24+
}

build.xml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project name="diff" default="build">
3+
<property name="php" value="php"/>
4+
<property name="phpunit" value="phpunit"/>
5+
6+
<target name="build" depends="prepare,lint,phpunit"/>
7+
8+
<target name="clean" description="Cleanup build artifacts">
9+
</target>
10+
11+
<target name="prepare" depends="clean,phpab" description="Prepare for build">
12+
</target>
13+
14+
<target name="phpab" description="Generate autoloader script">
15+
<exec executable="phpab">
16+
<arg value="--output" />
17+
<arg path="src/autoload.php" />
18+
<arg path="src" />
19+
</exec>
20+
</target>
21+
22+
<target name="lint">
23+
<apply executable="${php}" failonerror="true">
24+
<arg value="-l" />
25+
26+
<fileset dir="${basedir}/src">
27+
<include name="**/*.php" />
28+
<modified />
29+
</fileset>
30+
31+
<fileset dir="${basedir}/tests">
32+
<include name="**/*.php" />
33+
<modified />
34+
</fileset>
35+
</apply>
36+
</target>
37+
38+
<target name="phpunit" description="Run unit tests with PHPUnit">
39+
<condition property="phpunit_cmd" value="${php} ${phpunit}" else="${phpunit}">
40+
<not>
41+
<equals arg1="${phpunit}" arg2="phpunit" />
42+
</not>
43+
</condition>
44+
45+
<exec executable="${phpunit_cmd}" failonerror="true"/>
46+
</target>
47+
48+
<target name="pear">
49+
<mkdir dir="${basedir}/build/SebastianBergmann/Diff"/>
50+
51+
<copy todir="${basedir}/build/SebastianBergmann/Diff">
52+
<fileset dir="${basedir}/src"/>
53+
</copy>
54+
55+
<copy file="LICENSE" todir="${basedir}/build"/>
56+
<copy file="README.md" todir="${basedir}/build"/>
57+
58+
<exec executable="pear" dir="${basedir}/build">
59+
<arg value="package" />
60+
</exec>
61+
62+
<delete dir="${basedir}/build/SebastianBergmann"/>
63+
<delete file="${basedir}/build/LICENSE"/>
64+
<delete file="${basedir}/build/README.md"/>
65+
</target>
66+
</project>

build/package.xml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<package packagerversion="1.4.10" version="2.0"
3+
xmlns="http://pear.php.net/dtd/package-2.0"
4+
xmlns:tasks="http://pear.php.net/dtd/tasks-1.0"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
7+
http://pear.php.net/dtd/tasks-1.0.xsd
8+
http://pear.php.net/dtd/package-2.0
9+
http://pear.php.net/dtd/package-2.0.xsd">
10+
<name>Diff</name>
11+
<channel>pear.phpunit.de</channel>
12+
<summary>Diff implementation</summary>
13+
<description>Diff implementation</description>
14+
<lead>
15+
<name>Sebastian Bergmann</name>
16+
<user>sebastian</user>
17+
<email>[email protected]</email>
18+
<active>yes</active>
19+
</lead>
20+
<date>2013-MM-DD</date>
21+
<version>
22+
<release>1.0.0</release>
23+
<api>1.0.0</api>
24+
</version>
25+
<stability>
26+
<release>stable</release>
27+
<api>stable</api>
28+
</stability>
29+
<license>The BSD 3-Clause License</license>
30+
<notes>http://github.com/sebastianbergmann/diff/tree</notes>
31+
<contents>
32+
<dir name="/">
33+
<dir name="SebastianBergmann">
34+
<dir name="Diff">
35+
<file baseinstalldir="/" name="autoload.php" role="php"/>
36+
<file baseinstalldir="/" name="Diff.php" role="php"/>
37+
</dir>
38+
</dir>
39+
<file baseinstalldir="/" name="LICENSE" role="doc"/>
40+
<file baseinstalldir="/" name="README.md" role="doc"/>
41+
</dir>
42+
</contents>
43+
<dependencies>
44+
<required>
45+
<php>
46+
<min>5.3.3</min>
47+
</php>
48+
<pearinstaller>
49+
<min>1.9.4</min>
50+
</pearinstaller>
51+
</required>
52+
</dependencies>
53+
<phprelease/>
54+
</package>

composer.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "sebastian/diff",
3+
"description": "Diff implementation",
4+
"keywords": ["diff"],
5+
"homepage": "http://www.github.com/sebastianbergmann/diff",
6+
"license": "BSD-3-Clause",
7+
"authors": [
8+
{
9+
"name": "Sebastian Bergmann",
10+
"email": "[email protected]"
11+
},
12+
{
13+
"name": "Kore Nordmann",
14+
"email": "[email protected]"
15+
}
16+
],
17+
"require": {
18+
"php": ">=5.3.3"
19+
},
20+
"autoload": {
21+
"classmap": [
22+
"src/"
23+
]
24+
},
25+
"extra": {
26+
"branch-alias": {
27+
"dev-master": "1.0.x-dev"
28+
}
29+
}
30+
}

phpunit.xml.dist

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
convertErrorsToExceptions="true"
5+
convertNoticesToExceptions="true"
6+
convertWarningsToExceptions="true"
7+
processIsolation="false"
8+
stopOnFailure="false"
9+
bootstrap="src/autoload.php">
10+
<testsuites>
11+
<testsuite name="Diff">
12+
<directory>./tests</directory>
13+
</testsuite>
14+
</testsuites>
15+
<filter>
16+
<whitelist addUncoveredFilesFromWhitelist="true">
17+
<directory>./src</directory>
18+
<exclude>
19+
<file>./src/autoload.php</file>
20+
</exclude>
21+
</whitelist>
22+
</filter>
23+
</phpunit>

0 commit comments

Comments
 (0)