Skip to content

Commit b2b99f9

Browse files
committed
v0.5.1: modernize README, drop Coveralls entirely
- Rewrite README: drop dead Travis/Coveralls badges, document the PHP 7.4-8.5 support matrix, add Installation/Development/Contributing/License sections, fix missing semicolon in the Quick Start example - Drop php-coveralls/php-coveralls dev dep and the Coveralls upload step from CI -- we weren't actually publishing coverage anywhere - Set CI coverage to 'none' since we no longer emit clover output - Regenerate composer.lock (1980 lines of transitive Symfony deps gone with php-coveralls)
1 parent aafdc1c commit b2b99f9

5 files changed

Lines changed: 94 additions & 1968 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
php-version: ${{ matrix.php }}
2626
extensions: mbstring, openssl, sodium
27-
coverage: xdebug
27+
coverage: none
2828
tools: composer:v2
2929

3030
- name: Validate composer.json and composer.lock
@@ -41,14 +41,7 @@ jobs:
4141
run: composer install --prefer-dist --no-progress --no-interaction
4242

4343
- name: Run PHPUnit
44-
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
45-
46-
- name: Upload coverage to Coveralls
47-
if: matrix.php == '8.3'
48-
env:
49-
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
run: vendor/bin/php-coveralls -v
51-
continue-on-error: true
44+
run: vendor/bin/phpunit
5245

5346
static-analysis:
5447
name: PHPStan

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## 0.5.1 - 2026-04-14
8+
### Changed
9+
- Rewrote `README.md`: dropped dead Travis and Coveralls badges, documented the supported PHP 7.4–8.5 matrix, added Installation / Development / Contributing / License sections, and fixed a missing semicolon in the Quick Start example
10+
- Dropped `php-coveralls/php-coveralls` dev dependency and the Coveralls upload step from CI (we aren't actually publishing coverage anywhere)
11+
- Switched CI `coverage` setup to `none` since we no longer collect clover output
12+
713
## 0.5.0 - 2026-04-14
814
### Changed
915
- Bumped minimum PHP version to 7.4

README.md

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
1-
# PHP Sessionz [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![CI](https://github.com/ericmann/sessionz/actions/workflows/ci.yml/badge.svg)](https://github.com/ericmann/sessionz/actions/workflows/ci.yml)
1+
# PHP Sessionz [![CI](https://github.com/ericmann/sessionz/actions/workflows/ci.yml/badge.svg)](https://github.com/ericmann/sessionz/actions/workflows/ci.yml) [![Latest Stable Version](https://img.shields.io/packagist/v/ericmann/sessionz.svg)](https://packagist.org/packages/ericmann/sessionz) [![License](https://img.shields.io/packagist/l/ericmann/sessionz.svg)](https://packagist.org/packages/ericmann/sessionz)
22

33
Sessionz is a PHP library for smarter session management in modular applications.
44

5+
## Requirements
6+
7+
- PHP 7.4 or newer (tested against 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, and 8.5)
8+
- [Composer](https://getcomposer.org/)
9+
10+
## Installation
11+
12+
```bash
13+
composer require ericmann/sessionz
14+
```
15+
516
## Quick Start
617

7-
Use [Composer](https://getcomposer.org/) to add `ericmann/sessionz` to your project. Then, after loading all of your dependencies, initialize the core session manager and add the handlers you need to your stack.
18+
After loading your autoloader, initialize the core session manager and register the handlers you need:
819

920
```php
1021
require __DIR__ . '/vendor/autoload.php';
1122

1223
EAMann\Sessionz\Manager::initialize()
1324
->addHandler( new \EAMann\Sessionz\Handlers\DefaultHandler() )
1425
->addHandler( new \EAMann\Sessionz\Handlers\EncryptionHandler( getenv('session_passkey') ) )
15-
->addHandler( new \EAMann\Sessionz\Handlers\MemoryHandler() )
26+
->addHandler( new \EAMann\Sessionz\Handlers\MemoryHandler() );
1627

1728
session_start();
18-
1929
```
2030

2131
The above example adds, in order:
@@ -38,7 +48,7 @@ Each handler must implement the `Handler` interface so the session manager knows
3848

3949
### Middleware Structure
4050

41-
The overall structure of the handler stack is identical to that of a middleware stack in a modern PHP application. You can read more about the general philosophy [on Slim's website](https://www.slimframework.com/docs/concepts/middleware.html#how-does-middleware-work).
51+
The overall structure of the handler stack is identical to that of a middleware stack in a modern PHP application. You can read more about the general philosophy [on Slim's website](https://www.slimframework.com/docs/v4/concepts/middleware.html).
4252

4353
In general, stack operations will flow from the outside-in, starting by invoking the appropriate operation on the most recently registered handler and walking down the stack to the oldest handler. Each handler has the option to halt execution and return data immediately, or can invoke the passed `$next` callback to continue operation.
4454

@@ -60,11 +70,16 @@ The default session handler merely exposes PHP's default session implementation
6070

6171
Sessions stored on disk (the default implementation) or in a separate storage system (Memcache, MySQL, or similar) should be encrypted _at rest_. This handler will automatically encrypt any information passing through it on write and decrypt data on read. It does not store data on its own.
6272

63-
This handler requires a symmetric encryption key when it's instantiated. This key should be an ASCII-safe string, 32 bytes in length. You can easily use [Defuse PHP Encryption](https://github.com/defuse/php-encryption) (a dependency of this library) to generate a new key:
73+
This handler requires a symmetric encryption key when it's instantiated. This key should be an ASCII-safe string generated by [Defuse PHP Encryption](https://github.com/defuse/php-encryption) (a dependency of this library):
6474

6575
```php
66-
$rawKey = Defuse\Crypto\Key::createNewRandomKey();
67-
$key = $rawKey->saveToAsciiSafeString();
76+
use Defuse\Crypto\Key;
77+
78+
$rawKey = Key::createNewRandomKey();
79+
$key = $rawKey->saveToAsciiSafeString();
80+
81+
// Store $key somewhere safe (e.g. an environment variable) and pass it
82+
// back into the EncryptionHandler constructor on every request.
6883
```
6984

7085
### `MemoryHandler`
@@ -79,11 +94,32 @@ The `BaseHandler` class is always instantiated and included at the root of the h
7994

8095
The `NoopHandler` class is provided for you to build additional middleware atop a standard interface that "passes through" to the next layer in the stack by default. The `EncryptionHandler`, for example, inherits from this class as it doesn't store or read data, but merely manipulates information before passing it along. Another implementation might be a logging interface to track when sessions are accessed/updated.
8196

97+
## Development
98+
99+
Clone the repository and install dev dependencies:
100+
101+
```bash
102+
git clone https://github.com/ericmann/sessionz.git
103+
cd sessionz
104+
composer install
105+
```
106+
107+
Run the test suite:
108+
109+
```bash
110+
composer test
111+
```
112+
113+
Static analysis is provided by [PHPStan](https://phpstan.org/) and runs automatically in CI.
114+
115+
## Contributing
116+
117+
Issues and pull requests are welcome at <https://github.com/ericmann/sessionz>. Please ensure new code is covered by tests and that `composer test` passes across the supported PHP matrix before opening a PR.
118+
119+
## License
120+
121+
[MIT](LICENSE.md)
122+
82123
## Credits
83124

84125
The middleware implementation is inspired heavily by the request middleware stack presented by [the Slim Framework](https://www.slimframework.com/).
85-
86-
[travis-image]: https://travis-ci.org/ericmann/sessionz.svg?branch=master
87-
[travis-url]: https://travis-ci.org/ericmann/sessionz
88-
[coveralls-image]: https://coveralls.io/repos/github/ericmann/sessionz/badge.svg?branch=master
89-
[coveralls-url]: https://coveralls.io/github/ericmann/sessionz?branch=master

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
"defuse/php-encryption": "^2.4"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "^9.6",
24-
"php-coveralls/php-coveralls": "^2.7"
23+
"phpunit/phpunit": "^9.6"
2524
},
2625
"scripts": {
2726
"test": "phpunit",

0 commit comments

Comments
 (0)