qcubed-4 / common
The common utilities and helpers for QCubed-4 framework
Installs: 156
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Type:qcubed-library
pkg:composer/qcubed-4/common
Requires
- php: >=8.3
Requires (Dev)
- phpunit/phpunit: ^12.1
This package is auto-updated.
Last update: 2025-11-29 20:32:24 UTC
README
Common classes for the entire QCubed-4 framework.
There are several repositories:
- qcubed-4/application — the core QCubed functionality: forms, controls, UI rendering
- qcubed-4/orm — the object-relational mapper enabling powerful queries
- qcubed-4/i18n — translation and localization services
- qcubed-4/cache — caching layers for QCubed
- qcubed-4/app-starter — a quick-start template to begin new QCubed projects
- qcubed-4/common — shared classes used across QCubed-4 repositories
- qcubed-4/bootstrap — Bootstrap integration for QCubed
SessionCleaner Utility
SessionCleaner is a lightweight helper that automatically manages and cleans temporary PHP session keys.
This utility is extremely helpful in workflows such as:
- image uploads & avatar croppie handlers
- wizard / multi-step forms
- modal-based temporary actions
- any UI process that stores short-lived state
Key Features
- Automatic cleanup of expired session keys
- Protected keys via
setPreserveKeys() - Timestamp-based expiration tracking
- One-line global cleanup with
autoClean() - Developer debug mode
- Direct call:
SessionCleaner::debugDump(); - OR via URL parameter:
?sc_debug=1
- Direct call:
✔ Usage Example
use QCubed\Helper\SessionCleaner; // Session keys that must never be removed SessionCleaner::setPreserveKeys(['logged_user_id', 'csrf_token', 'qformstate']); // Automatically remove temporary session keys older than 30 minutes SessionCleaner::autoClean(1800);
More details can be found in: docs/SessionCleaner.md