Skip to content

Commit 985d57c

Browse files
authored
Merge pull request #1397 from mike42/1396-maintenance-updates
Maintenance updates to enable new releases
2 parents f414320 + 44b5480 commit 985d57c

53 files changed

Lines changed: 966 additions & 1499 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveralls.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
* text=auto
2+
3+
.gitattributes export-ignore
4+
.gitignore export-ignore
5+
.github/ export-ignore
6+
doc/ export-ignore
7+
phpunit.xml export-ignore
8+
test/ export-ignore
9+
composer.lock export-ignore
10+

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
php-version: ['8.2', '8.3', '8.4', '8.5']
14+
15+
steps:
16+
- uses: actions/checkout@v7
17+
18+
- name: Install System Dependencies
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y imagemagick ghostscript unifont
22+
23+
- name: Set up PHP ${{ matrix.php-version }}
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php-version }}
27+
coverage: none
28+
29+
- name: Install dependencies
30+
run: composer install --no-interaction --prefer-dist
31+
32+
- name: Check code style
33+
run: php vendor/bin/phpcs --standard=psr2 src/ -n
34+
35+
- name: Run tests
36+
run: php vendor/bin/phpunit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ vendor/
1414
# other build files
1515
build/*
1616
*.phar
17+
.phpunit.cache/

.travis.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2014-2016 Michael Billington, incorporating modifications by others.
3+
Copyright (c) 2014-2026 Michael Billington, incorporating modifications by others.
44
See CONTRIBUTORS.md for a full list.
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# ESC/POS Print Driver for PHP
2-
[![Build Status](https://travis-ci.org/mike42/escpos-php.svg?branch=master)](https://travis-ci.org/mike42/escpos-php) [![Latest Stable Version](https://poser.pugx.org/mike42/escpos-php/v/stable)](https://packagist.org/packages/mike42/escpos-php)
3-
[![Total Downloads](https://poser.pugx.org/mike42/escpos-php/downloads)](https://packagist.org/packages/mike42/escpos-php)
4-
[![License](https://poser.pugx.org/mike42/escpos-php/license)](https://packagist.org/packages/mike42/escpos-php)
5-
[![Coverage Status](https://coveralls.io/repos/github/mike42/escpos-php/badge.svg?branch=development)](https://coveralls.io/github/mike42/escpos-php?branch=development)
2+
3+
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/mike42/escpos-php/ci.yml?branch=main&style=flat-square)](https://github.com/mike42/escpos-php/actions/workflows/ci.yml)
4+
[![Packagist Version](https://img.shields.io/packagist/v/mike42/escpos-php?style=flat-square&color=007ec6)](https://packagist.org/packages/mike42/escpos-php)
5+
[![Packagist Downloads](https://img.shields.io/packagist/dt/mike42/escpos-php?style=flat-square)](https://packagist.org/packages/mike42/escpos-php)
6+
[![Packagist License](https://img.shields.io/packagist/l/mike42/escpos-php?style=flat-square&color=007ec6)](https://github.com/mike42/escpos-php/blob/development/LICENSE.md)
67

78
This project implements a subset of Epson's ESC/POS protocol for thermal receipt printers. It allows you to generate and print receipts with basic formatting, cutting, and barcodes on a compatible printer.
89

@@ -178,15 +179,12 @@ If you haven't used `composer` before, you can read about it at [getcomposer.org
178179

179180
This project has few hard dependencies:
180181

181-
- PHP 7.3 or newer.
182+
- PHP 8.2 or newer.
182183
- `json` extension, used to load bundled printer definitions (see [documentation](https://www.php.net/manual/en/book.json.php))
183184
- `intl` extension, used for character encoding (see [documentation](https://www.php.net/manual/en/book.intl.php))
184185
- `zlib` extension, used for de-compressing bundled resources (see [documentation](https://www.php.net/manual/en/book.zlib.php)).
185186

186-
It is also suggested that you install either `imagick` or `gd`, as these can be used to speed up image processing.
187-
188-
A number of optional extensions can be added to enable more specific features. These
189-
are described in the "suggest" section of [composer.json](https://github.com/mike42/escpos-php/tree/master/composer.json).
187+
It is also suggested that you install either `imagick` or `gd`, as these will be used to speed up image processing if present. The [gfx-php](https://github.com/mike42/gfx-php) library will otherwise be used as a fallback.
190188

191189
### The 'Hello World' receipt
192190

@@ -552,7 +550,7 @@ This code is MIT licensed, and you are encouraged to contribute any modification
552550

553551
For development, it's suggested that you load `imagick`, `gd` and `Xdebug` PHP extensions.
554552

555-
The tests are executed on [Travis CI](https://travis-ci.org/mike42/escpos-php) over PHP 7.3, 7.4 and 8.0. Older versions of PHP are not supported in the current release, nor is HHVM.
553+
The tests are executed [via GitHub actions](https://github.com/mike42/escpos-php/blob/main/.github/workflows/ci.yml) on PHP 8.2, 8.3, 8.4 and 8.5. Older versions of PHP are not supported in the current release.
556554

557555
Fetch a copy of this code and load dependencies with composer:
558556

@@ -564,11 +562,15 @@ Execute unit tests via `phpunit`:
564562

565563
php vendor/bin/phpunit --coverage-text
566564

565+
Or with coverage:
566+
567+
XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
568+
567569
This project uses the PSR-2 standard, which can be checked via [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer):
568570

569571
php vendor/bin/phpcs --standard=psr2 src/ -n
570572

571-
The developer docs are build with [doxygen](https://github.com/doxygen/doxygen). Re-build them to check for documentation warnings:
573+
The developer docs are not currently maintained, but were built with [doxygen](https://github.com/doxygen/doxygen). Re-build them to check for documentation warnings:
572574

573575
make -C doc clean && make -C doc
574576

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@
1818
],
1919
"config": {
2020
"platform": {
21-
"php": "7.3.0"
21+
"php": "8.2.0"
2222
}
2323
},
2424
"require" : {
25-
"php" : ">=7.3.0",
25+
"php" : ">=8.2.0",
2626
"ext-json": "*",
2727
"ext-intl": "*",
2828
"ext-zlib": "*",
29-
"mike42/gfx-php" : "^0.6"
29+
"mike42/gfx-php" : "^1"
3030
},
3131
"suggest" : {
3232
"ext-imagick" : "Will be used for image printing if present. Required for PDF printing or use of custom fonts.",
3333
"ext-gd" : "Used for image printing if present."
3434
},
3535
"require-dev" : {
36-
"phpunit/phpunit" : "^9",
37-
"squizlabs/php_codesniffer" : "^3.3"
36+
"phpunit/phpunit" : "^11",
37+
"squizlabs/php_codesniffer" : "^4"
3838
},
3939
"autoload" : {
4040
"psr-4" : {

0 commit comments

Comments
 (0)