Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions .coveralls.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* text=auto

.gitattributes export-ignore
.gitignore export-ignore
.github/ export-ignore
doc/ export-ignore
phpunit.xml export-ignore
test/ export-ignore
composer.lock export-ignore

36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3', '8.4', '8.5']

steps:
- uses: actions/checkout@v7

- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt-get install -y imagemagick ghostscript unifont

- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none

- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Check code style
run: php vendor/bin/phpcs --standard=psr2 src/ -n

- name: Run tests
run: php vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ vendor/
# other build files
build/*
*.phar
.phpunit.cache/
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

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

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# ESC/POS Print Driver for PHP
[![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)
[![Total Downloads](https://poser.pugx.org/mike42/escpos-php/downloads)](https://packagist.org/packages/mike42/escpos-php)
[![License](https://poser.pugx.org/mike42/escpos-php/license)](https://packagist.org/packages/mike42/escpos-php)
[![Coverage Status](https://coveralls.io/repos/github/mike42/escpos-php/badge.svg?branch=development)](https://coveralls.io/github/mike42/escpos-php?branch=development)

[![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)
[![Packagist Version](https://img.shields.io/packagist/v/mike42/escpos-php?style=flat-square&color=007ec6)](https://packagist.org/packages/mike42/escpos-php)
[![Packagist Downloads](https://img.shields.io/packagist/dt/mike42/escpos-php?style=flat-square)](https://packagist.org/packages/mike42/escpos-php)
[![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)

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.

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

This project has few hard dependencies:

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

It is also suggested that you install either `imagick` or `gd`, as these can be used to speed up image processing.

A number of optional extensions can be added to enable more specific features. These
are described in the "suggest" section of [composer.json](https://github.com/mike42/escpos-php/tree/master/composer.json).
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.

### The 'Hello World' receipt

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

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

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.
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.

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

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

php vendor/bin/phpunit --coverage-text

Or with coverage:

XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text

This project uses the PSR-2 standard, which can be checked via [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer):

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

The developer docs are build with [doxygen](https://github.com/doxygen/doxygen). Re-build them to check for documentation warnings:
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:

make -C doc clean && make -C doc

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@
],
"config": {
"platform": {
"php": "7.3.0"
"php": "8.2.0"
}
},
"require" : {
"php" : ">=7.3.0",
"php" : ">=8.2.0",
"ext-json": "*",
"ext-intl": "*",
"ext-zlib": "*",
"mike42/gfx-php" : "^0.6"
"mike42/gfx-php" : "^1"
},
"suggest" : {
"ext-imagick" : "Will be used for image printing if present. Required for PDF printing or use of custom fonts.",
"ext-gd" : "Used for image printing if present."
},
"require-dev" : {
"phpunit/phpunit" : "^9",
"squizlabs/php_codesniffer" : "^3.3"
"phpunit/phpunit" : "^11",
"squizlabs/php_codesniffer" : "^4"
},
"autoload" : {
"psr-4" : {
Expand Down
Loading