Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/rewrite #38

Merged
merged 23 commits into from
Apr 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3974928
First commit of the 2.0 rewrite
DASPRiD Oct 26, 2017
6c4fc3b
Adjust unit tests and fix coding style errors
DASPRiD Oct 26, 2017
fab581e
Add badges to README
DASPRiD Oct 26, 2017
f359e0e
Simplify edge paths and add further minification to SVG paths
DASPRiD Oct 26, 2017
13409e1
Allow setting image format and compression quality for imagick images
DASPRiD Oct 26, 2017
8aa654d
Re-add text renderer, kudos to @consatan for supplying the initial co…
DASPRiD Oct 26, 2017
6fceccf
Use no-break space for empty blocks in plain text QR code
DASPRiD Oct 26, 2017
bb7567b
Add dots module and let modules decide whether to simplify the edge
DASPRiD Oct 26, 2017
986db3e
Add strong roundness module
DASPRiD Oct 27, 2017
e7d5adb
Tiny CS fix
DASPRiD Oct 27, 2017
d9d6aa0
Add more control over the roundness and dots module
DASPRiD Oct 29, 2017
a363015
Add EPS backend
DASPRiD Oct 30, 2017
e3a0366
Simplify image back ends and make EPS output more compact
DASPRiD Oct 30, 2017
157f8b5
Coding standard cleanups
DASPRiD Oct 30, 2017
07a3bc5
Additinal work on the renderstyle
DASPRiD Oct 31, 2017
67dbc58
Implement gradient fill for EPS back end
DASPRiD Oct 31, 2017
01a58a4
Add gradients in SVG back end
DASPRiD Nov 7, 2017
bc0d440
Finish gradient calculations for imagick backend
DASPRiD Apr 25, 2018
33a07d3
Add entries to changelog
DASPRiD Apr 25, 2018
3fbfb1a
Fix coveralls version in travis
DASPRiD Apr 25, 2018
66d938b
Prepare changelog for release
DASPRiD Apr 25, 2018
9aa899e
Fix .gitattributes content
DASPRiD Apr 25, 2018
eaac909
Fix auto generated link in CHANGELOG.md
DASPRiD Apr 25, 2018
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 @@
/test export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpcs.xml export-ignore
/phpunit.xml.dist export-ignore
11 changes: 2 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
composer.lock
vendor
nbproject
.idea
.buildpath
.project
.DS_Store
.*.sw*
.*.un~
/composer.lock
/vendor
43 changes: 35 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
sudo: false

language: php
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- hhvm

cache:
directories:
- $HOME/.composer/cache
- $HOME/.local
- vendor

matrix:
fast_finish: true
include:
- php: 7.1
env:
- EXECUTE_CS_CHECK=true
- EXECUTE_TEST_COVERALLS=true
- PATH="$HOME/.local/bin:$PATH"
- php: nightly
allow_failures:
- php: nightly

before_install:
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- composer self-update
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls:2.0.0 ; fi

install:
- travis_retry composer install --no-interaction
- composer info -i

script: vendor/bin/phpunit --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml tests
script:
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then vendor/bin/phpunit --coverage-clover clover.xml ; fi
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then vendor/bin/phpunit ; fi
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then vendor/bin/phpcs ; fi

after_script:
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then vendor/bin/coveralls ; fi

notifications:
email: true
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Changelog

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 2.0.0 - 2018-04-25

### Added

- [#25](https://github.com/Bacon/BaconQrCode/pull/25) allows for setting a more compact text output

- CHANGELOG.md added (how meta)

- Allows more complex shapes for modules

- Allows setting a gradient for the foreground

- Allows transparent backgrounds and alpha channel on all colors

### Changed

- Minimum PHP version changed to 7.1

- Imagick renderer now allows setting different output formats

- New optimized SVG renderer

### Deprecated

- Nothing.

### Removed

- Legacy ZF module support removed

### Fixed

- Non-release files are excluded from composer packages
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013, Ben 'DASPRiD' Scholzen
Copyright (c) 2017, Ben Scholzen 'DASPRiD'
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
37 changes: 0 additions & 37 deletions Module.php

This file was deleted.

37 changes: 26 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
QR Code generator
=================
# QR Code generator

Master: [![Build Status](https://api.travis-ci.org/Bacon/BaconQrCode.png?branch=master)](http://travis-ci.org/Bacon/BaconQrCode)
[![Build Status](https://api.travis-ci.org/Bacon/BaconQrCode.png?branch=master)](http://travis-ci.org/Bacon/BaconQrCode)
[![Coverage Status](https://coveralls.io/repos/github/Bacon/BaconQrCode/badge.svg?branch=master)](https://coveralls.io/github/Bacon/BaconQrCode?branch=master)
[![Latest Stable Version](https://poser.pugx.org/bacon/bacon-qr-code/v/stable)](https://packagist.org/packages/bacon/bacon-qr-code)
[![Total Downloads](https://poser.pugx.org/bacon/bacon-qr-code/downloads)](https://packagist.org/packages/bacon/bacon-qr-code)
[![License](https://poser.pugx.org/bacon/bacon-qr-code/license)](https://packagist.org/packages/bacon/bacon-qr-code)

Introduction
------------

## Introduction
BaconQrCode is a port of QR code portion of the ZXing library. It currently
only features the encoder part, but could later receive the decoder part as
well.
Expand All @@ -13,12 +16,24 @@ As the Reed Solomon codec implementation of the ZXing library performs quite
slow in PHP, it was exchanged with the implementation by Phil Karn.


Example usage
-------------
## Example usage
```php
$renderer = new \BaconQrCode\Renderer\Image\Png();
$renderer->setHeight(256);
$renderer->setWidth(256);
$writer = new \BaconQrCode\Writer($renderer);
use BaconQrCode\Renderer\ImageRenderer;
use BaconQrCode\Renderer\Image\ImagickImageBackEnd;
use BaconQrCode\Renderer\RendererStyle\RendererStyle;
use BaconQrCode\Writer;

$renderer = new ImageRenderer(
new RendererStyle(400),
new ImagickImageBackEnd()
);
$writer = new Writer($renderer);
$writer->writeFile('Hello World!', 'qrcode.png');
```

## Available image renderer back ends
BaconQrCode comes with multiple back ends for rendering images. Currently included are the following:

- `ImagickImageBackEnd`: renders raster images using the Imagick library
- `SvgImageBackEnd`: renders SVG files using XMLWriter
- `EpsImageBackEnd`: renders EPS files
43 changes: 0 additions & 43 deletions autoload_classmap.php

This file was deleted.

12 changes: 0 additions & 12 deletions autoload_function.php

This file was deleted.

2 changes: 0 additions & 2 deletions autoload_register.php

This file was deleted.

15 changes: 9 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"license" : "BSD-2-Clause",
"homepage": "https://github.com/Bacon/BaconQrCode",
"require": {
"php": "^5.4|^7.0",
"ext-iconv": "*"
"php": "^7.1",
"ext-iconv": "*",
"dasprid/enum": "^1.0"
},
"suggest": {
"ext-gd": "to generate QR code images"
"ext-imagick": "to generate QR code images"
},
"authors": [
{
Expand All @@ -19,11 +20,13 @@
}
],
"autoload": {
"psr-0": {
"BaconQrCode": "src/"
"psr-4": {
"BaconQrCode\\": "src/"
}
},
"require-dev": {
"phpunit/phpunit": "^4.8"
"phpunit/phpunit": "^6.4",
"squizlabs/php_codesniffer": "^3.1",
"phly/keep-a-changelog": "^1.4"
}
}
30 changes: 30 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<ruleset name="BaconQrCode standard">
<description>BaconQrCode standard</description>

<!-- display progress -->
<arg value="p"/>
<arg name="colors"/>
<arg name="parallel" value="75"/>

<!-- inherit rules from: -->
<rule ref="PSR2"/>
<rule ref="Squiz.Strings.DoubleQuoteUsage"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Formatting.SpaceAfterNot"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>

<!-- Paths to check -->
<file>src</file>
<file>test</file>
</ruleset>
17 changes: 17 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="BaconQrCode Tests">
<directory>./test</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
Loading