opengeek / content
Simple content management abstractions
0.1.0
2026-03-10 23:33 UTC
Requires
- php: ^8.3
Requires (Dev)
- marcocesarato/php-conventional-changelog: ^1.17
- phpunit/phpunit: ^11.0
- symfony/console: ^7.0
README
The core package for the Opengeek Content library. Provides backend-agnostic contracts, types, collections, and shared exceptions for content management.
Installation
composer require opengeek/content
What's Included
- Contracts: Generic interfaces for repositories (
ContentRepositoryInterface) and collections (ContentCollectionInterface). - Support:
ContentCollectionTraitfor rapid collection implementation with filtering, sorting, and slicing. - Caching:
CachingContentRepositorydecorator to add PSR-6/Symfony Cache support to any repository. - Article DTO: A pure value container for article data.
- ArticleCollection: A typed, immutable, and searchable collection of
Articleobjects. - ArticleRepositoryInterface: Specialized contract for reading articles.
- ArticlePersisterInterface: Contract for writing articles.
- MarkdownRendererInterface: Implementation-agnostic interface for rendering Markdown to HTML.
- Shared Exceptions:
ContentException,ContentNotFoundException,ContentMappingException, etc.
Usage
This package provides the interfaces you should depend on in your application logic. To actually load or save content, you will need one of the implementation packages:
opengeek/content-markdown: Read-only Markdown file repository.opengeek/content-dbal: Read/write SQL persistence via Doctrine DBAL.opengeek/content-markdown-renderer: HTML rendering for Markdown content.