xoops / xmf
XMF - XOOPS Module Framework
Fund package maintenance!
XOOPS
Opencollective
xoops.org/modules/donations
Installs: 1 946
Dependents: 3
Suggesters: 0
Security: 0
Stars: 7
Watchers: 3
Forks: 6
Open Issues: 8
pkg:composer/xoops/xmf
Requires
- php: ^7.4 || ^8.0
- firebase/php-jwt: ^6.10
- kint-php/kint: ^6.0
- symfony/yaml: ^5.4 || ^6.0 || ^7.0
- webmozart/assert: ^1.11
Requires (Dev)
- phpstan/phpstan: ^1.10 || ^2.0
- phpunit/phpunit: ^9.6 || ^10.0 || ^11.0
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^3.11
- dev-master
- v1.2.33-beta2
- v1.2.33-beta1
- v1.2.32
- v1.2.31
- v1.2.30
- v1.2.29
- v1.2.28
- v1.2.27
- v1.2.26
- v1.2.25
- v1.2.24
- v1.2.23
- v1.2.22
- v1.2.21
- v1.2.20
- v1.2.19
- v1.2.18
- v1.2.17
- v1.2.16
- v1.2.15
- v1.2.14
- v1.2.12
- v1.2.11
- v1.2.10
- v1.2.9
- V1.2.8
- V1.2.7
- V1.2.6
- V1.2.5
- V1.2.4
- v1.2.3
- V1.2.2
- V1.2.1
- V1.2.0
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- v1.0.0-RC2
- v1.0.0-RC1
- v1.0.0-RC
- v0.4.1
- v0.4.0
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.0
This package is auto-updated.
Last update: 2026-02-07 14:25:36 UTC
README
XMF — XOOPS Module Framework
The toolkit that makes XOOPS module development faster, safer, and more consistent.
Why XMF?
Building XOOPS modules means solving the same problems over and over: filtering input, managing sessions, handling permissions, generating meta tags, working with databases. XMF gives you battle-tested solutions for all of them so you can focus on what makes your module unique.
| What you get | Why it matters | |
|---|---|---|
| Input & Security | Request handling, input filtering, IP address validation | Stop writing your own sanitization — use proven, audited code |
| Database | Schema migrations, table management, bulk loading | Evolve your database safely across module versions |
| Authentication | JWT tokens, key management, secure storage | Add token-based auth without pulling in heavyweight packages |
| Module Helpers | Admin panels, permissions, sessions, caching | Common module tasks reduced to one-liners |
| Content Tools | Meta tag generation, SEO titles, YAML config, search summaries | Improve SEO and content handling with zero effort |
| Identifiers | ULID and UUID generation | Generate unique, sortable identifiers out of the box |
| Developer Tools | Debugging (Kint), YAML import/export, assertions | Debug and inspect with a single call |
Quick Start
composer require xoops/xmf
use Xmf\Request; use Xmf\FilterInput; use Xmf\Metagen; // Safe input handling $id = Request::getInt('id', 0, 'GET'); $name = Request::getString('name', '', 'POST'); // Generate SEO-friendly meta tags Metagen::generateMetaTags($title, $body); // Generate a ULID $ulid = \Xmf\Ulid::generate();
Components
xmf/src/
|
|-- Request.php HTTP request handling & input retrieval
|-- FilterInput.php Input sanitization & XSS prevention
|-- IPAddress.php IPv4/IPv6 validation & subnet checks
|-- ProxyCheck.php Proxy detection for real client IPs
|
|-- Database/
| |-- Tables.php Schema definition & ALTER operations
| |-- Migrate.php Module schema migrations
| +-- TableLoad.php Bulk data import
|
|-- Jwt/
| |-- JsonWebToken Create & decode signed JWT tokens
| |-- TokenFactory Convenient token builder
| +-- TokenReader Token verification & claim extraction
|
|-- Key/
| |-- Basic.php Key pair generation
| |-- FileStorage Persistent key storage (filesystem)
| +-- ArrayStorage In-memory key storage (testing)
|
|-- Module/
| |-- Admin.php Admin panel rendering & config display
| +-- Helper/
| |-- Permission Group permission management
| |-- Session Secure session read/write
| |-- Cache Module-scoped caching
| +-- GenericHelper Common helper utilities
|
|-- Metagen.php Meta keywords, descriptions & SEO titles
|-- Highlighter.php Search term highlighting
|-- StopWords.php Keyword filtering (multi-language)
|
|-- Ulid.php ULID generation (monotonic & standard)
|-- Uuid.php UUID v4 generation
|-- Random.php Cryptographically secure random bytes
|
|-- Yaml.php YAML read/write with PHP-wrapped security
|-- Language.php Safe language file loading
|-- Debug.php Kint-powered variable inspection
+-- Assert.php Runtime assertion helpers
Requirements
| Requirement | Version |
|---|---|
| PHP | 7.4+ |
| XOOPS | 2.5.x or 2.6.x |
| Composer | Required |
Key Dependencies
firebase/php-jwt— JWT encoding/decodingsymfony/yaml— YAML parsingkint-php/kint— Debug outputwebmozart/assert— Assertion library
Installation
Via Composer (recommended):
composer require xoops/xmf
As part of XOOPS:
XMF is included in XOOPS 2.5.8+ as a core library. No separate installation needed.
Development
# Install dependencies composer install # Run tests composer test # Static analysis composer analyse # Code style check composer lint # Auto-fix code style composer fix # Run all CI checks composer ci # Regenerate PHPStan baseline composer baseline
Contributing
Contributions are welcome! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Make your changes and add tests
- Run
composer cito verify - Submit a Pull Request
Links
License
XMF is licensed under the GPL-2.0-or-later.
Acknowledgments
Thank you to JetBrains for supporting open-source development by providing free IDE licenses to this project.
Made with ❤️ by the XOOPS Project community