Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
56426a8
Upper bound the version ranges of the dependencies
JeroenDeDauw Aug 5, 2015
c574b72
readme: Add link to pygments.org and use their tagline
Krinkle Jun 25, 2015
ea7e59e
Use -P rather than -O when passing options
MatmaRex Jun 23, 2015
1925c3f
travis: Add PHP 5.6 and HHVM builds
Krinkle Jun 16, 2015
6128d5c
Apply updates to make tests pass on Travis CI again
ramsey Mar 10, 2017
267811b
Test on newer versions of PHP
ramsey Mar 10, 2017
ad3f861
Remove the composer.lock file
ramsey Mar 10, 2017
bf76068
Modernize the Travis CI configuration
ramsey Mar 10, 2017
5afda7a
Ignore the composer.lock file
ramsey Mar 10, 2017
b2cc714
Rename `test/` to `tests/`, according to modern conventions
ramsey Mar 10, 2017
d7c9432
Update the library to use PSR-4 autoloading
ramsey Mar 10, 2017
34e5916
Change PHP version requirements to exclude unsupported PHP versions
ramsey Mar 10, 2017
69c1e1e
Update the lowest PHPUnit version required
ramsey Mar 10, 2017
2e579ae
Upgrade library to use Symfony components from the 3.x series
ramsey Mar 11, 2017
11f0c23
Uses builder's `setInput`
sroze Sep 29, 2016
3ae5784
Move coveralls installation back to Travis CI configuration
ramsey Mar 10, 2017
8d47c42
Add PHP CodeSniffer and sniff for PSR-2 coding standards violations
ramsey Mar 10, 2017
cc47c8b
Add PHP script linting and Composer helpers to run all tests
ramsey Mar 10, 2017
f343d1d
Add a .gitattributes file to ignore certain files/dirs on export
ramsey Mar 10, 2017
b2eb16b
Use Travis CI Python build environment to test Pygments versions
ramsey Mar 11, 2017
917de37
Split up test resources by Pygments version
ramsey Mar 12, 2017
b0c46a6
Add resources for Pygments 2.0
ramsey Mar 12, 2017
0d42247
Add Literal.Number.Bin to expected results
jayvdb Dec 2, 2015
e1e2444
Add test resources for Pygments 2.1
ramsey Mar 12, 2017
bb29c02
Add parameter for expected guessed lexer output
ramsey Mar 12, 2017
9987666
Add test resources for Pygments 2.2
ramsey Mar 12, 2017
c9e2413
Update README to note updated requirements & installation best practices
ramsey Mar 12, 2017
e2f7d14
Update Travis build matrix for testing Pygments with PHP & Python
ramsey Mar 12, 2017
c96aa11
Add table listing supported Python and Pygments versions
ramsey Mar 12, 2017
25e3088
Allow failures for Pygments 2.2 on Python 2.6
ramsey Mar 12, 2017
717ec16
Add MIT license file with copyright information
ramsey Mar 12, 2017
98fa83a
Use short array syntax
ramsey Mar 12, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/util export-ignore
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
/build/
composer.phar
/vendor/
composer.lock
composer.phar
79 changes: 66 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,74 @@
language: php
language: python

php:
- 5.5
- 5.4
- 5.3
sudo: false

python:
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6

env:
global:
- PATH="$HOME/.phpenv/bin:$HOME/.phpenv/shims:$PATH"
matrix:
- PHP_VERSION=7.1 PYGMENTS_VERSION=1.6
- PHP_VERSION=7.1 PYGMENTS_VERSION=2.0
- PHP_VERSION=7.1 PYGMENTS_VERSION=2.1
- PHP_VERSION=7.1 PYGMENTS_VERSION=2.2
- PHP_VERSION=7.0 PYGMENTS_VERSION=1.6
- PHP_VERSION=7.0 PYGMENTS_VERSION=2.0
- PHP_VERSION=7.0 PYGMENTS_VERSION=2.1
- PHP_VERSION=7.0 PYGMENTS_VERSION=2.2
- PHP_VERSION=5.6 PYGMENTS_VERSION=1.6
- PHP_VERSION=5.6 PYGMENTS_VERSION=2.0
- PHP_VERSION=5.6 PYGMENTS_VERSION=2.1
- PHP_VERSION=5.6 PYGMENTS_VERSION=2.2

matrix:
fast_finish: true
include:
- python: 3.2
env: PHP_VERSION=7.1 PYGMENTS_VERSION=1.6
- python: 3.2
env: PHP_VERSION=7.0 PYGMENTS_VERSION=1.6
- python: 3.2
env: PHP_VERSION=5.6 PYGMENTS_VERSION=1.6
allow_failures:
- python: 2.6
env: PHP_VERSION=7.1 PYGMENTS_VERSION=2.2
- python: 2.6
env: PHP_VERSION=7.0 PYGMENTS_VERSION=2.2
- python: 2.6
env: PHP_VERSION=5.6 PYGMENTS_VERSION=2.2

addons:
apt:
packages:
- libc-client-dev
- libtidy-dev
- libmcrypt-dev

before_install:
- sudo easy_install Pygments
- ./util/install-php.sh
- eval "$(phpenv init -)" && phpenv rehash
- php --version
- php composer.phar --version

install:
- travis_retry pip install Pygments==$PYGMENTS_VERSION
- travis_retry php composer.phar require --no-update satooshi/php-coveralls:^1.0
- travis_retry php composer.phar install --no-interaction --prefer-dist

before_script:
- composer require --no-update satooshi/php-coveralls:dev-master sensiolabs/security-checker:dev-master
- composer update --dev --no-interaction
- mkdir -p build/logs

script:
- mkdir -p build/logs
- phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml
- php vendor/bin/security-checker security:check composer.lock
- ./vendor/bin/parallel-lint src tests
- ./vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml
- ./vendor/bin/phpcs src tests --standard=psr2 -sp

after_script:
- php vendor/bin/coveralls
after_success:
- travis_retry php vendor/bin/coveralls
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Pygments.php - A Thin Wrapper for the Python Pygments
Copyright (c) 2013-2017 Kazuyuki Hayashi <hayashi@valnur.net>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,34 @@ Pygments.php - A Thin Wrapper for the Python Pygments
[![Coverage Status](https://coveralls.io/repos/kzykhys/Pygments.php/badge.png)](https://coveralls.io/r/kzykhys/Pygments.php)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/3efddd61-f6e2-4f4a-949d-9ca7230f6e56/mini.png)](https://insight.sensiolabs.com/projects/3efddd61-f6e2-4f4a-949d-9ca7230f6e56)

A PHP wrapper for the Python Pygments syntax highlighter
A PHP wrapper for [Pygments](http://pygments.org/), the Python syntax highlighter.

Requirements
------------

* PHP5.3+
* Python 2.4+
* Pygments (`sudo easy_install Pygments`)
* PHP 5.6+
* Python
* Pygments (`pip install Pygments`)

Python and Pygments versions supported:

| Pygments: | 1.6 | 2.0 | 2.1 | 2.2 |
| :--------- | :-: | :-: | :-: | :-: |
| Python 2.6 | ✔ | ✔ | ✔ | - |
| Python 2.7 | ✔ | ✔ | ✔ | ✔ |
| Python 3.2 | ✔ | - | - | - |
| Python 3.3 | ✔ | ✔ | ✔ | ✔ |
| Python 3.4 | ✔ | ✔ | ✔ | ✔ |
| Python 3.5 | ✔ | ✔ | ✔ | ✔ |
| Python 3.6 | ✔ | ✔ | ✔ | ✔ |

Installation
------------

Create or update your composer.json and run `composer update`
Use [Composer](https://getcomposer.org) to require this package:

``` json
{
"require": {
"kzykhys/pygments": ">=1.0"
}
}
```
composer require kzykhys/pygments
```

Usage
Expand Down
28 changes: 23 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,33 @@
],
"minimum-stability": "stable",
"require": {
"php": ">=5.3.2",
"symfony/process": ">=2.3"
"php": "^5.6 || ^7.0",
"symfony/process": "^3.0"
},
"require-dev": {
"symfony/finder": ">=2.3"
"jakub-onderka/php-parallel-lint": "^0.9.2",
"phpunit/phpunit": "^5.7 || ^6.0",
"squizlabs/php_codesniffer": "^2.8",
"symfony/finder": "^3.0"
},
"autoload": {
"psr-0": {
"": "src"
"psr-4": {
"KzykHys\\Pygments\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"KzykHys\\Pygments\\Test\\": "tests"
}
},
"scripts": {
"lint": "parallel-lint src tests",
"phpunit": "phpunit --verbose --colors=always",
"phpcs": "phpcs src tests --standard=psr2 -sp --colors",
"test": [
"@lint",
"@phpunit",
"@phpcs"
]
}
}
118 changes: 0 additions & 118 deletions composer.lock

This file was deleted.

42 changes: 15 additions & 27 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "vendor/autoload.php" >

<testsuites>
<testsuite name="Project Test Suite">
<directory>test</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>src</directory>
</whitelist>
</filter>

</phpunit>
<phpunit bootstrap="./tests/bootstrap.php" colors="true" backupGlobals="false">
<testsuites>
<testsuite>
<directory>./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<php>
<env name="PYGMENTIZE_PATH" value="pygmentize"/>
</php>
</phpunit>
Loading