Download the PHP package contenir/contenir-resource without Composer
On this page you can find all versions of the php package contenir/contenir-resource. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download contenir/contenir-resource
More information about contenir/contenir-resource
Files in contenir/contenir-resource
Package contenir-resource
Short Description Contenir resources on contenir-db-model 2: attribute-mapped resource, collection and type entities, repositories, the page tree, page metadata, summaries and link normalisation. Framework neutral.
License BSD-3-Clause
Homepage https://contenir.com.au
Informations about the package contenir-resource
contenir/contenir-resource
The framework-neutral core for Contenir resources (the pages, articles and other content rows of a Contenir site), built on contenir-db-model 2:
- attribute-mapped entities for the
resource,resource_collectionandresource_typetables; - repositories, including the page tree that routes and navigation are built from;
- a resource manager with the lookups sites use (by id, slug, workflow, type);
- page metadata (title, canonical URL, description, Open Graph and Twitter tags) from
contenir-metadata's
MetadataInterface, with a renderer-agnostic HTML renderer; - plain-text summaries and safe normalisation of editor-entered links.
It has no framework dependency: no Mezzio, PSR-7/PSR-15, laminas-mvc or routing. Use it through an adapter:
- Mezzio: contenir/contenir-resource-mezzio adds workflow routing and navigation, a middleware that resolves the routed resource, URL generation and optional laminas-view helpers.
- laminas-mvc: a 2.x adapter will be published as
contenir/contenir-resource-laminas-mvc. Until then laminas-mvc sites stay on the 1.x line of this package (the1.xbranch andv1.*tags).
Version 2.0 is a rewrite and is not compatible with 1.x; see UPGRADE.md.
Requirements
- PHP 8.3, 8.4 or 8.5
- contenir/contenir-db-model 2.x and contenir/contenir-metadata 2.x
- Any PSR-11 container, for the optional factories
Install
2.0 is a release candidate (2.0.0-RC1): contenir-db-model 2 is itself at RC and builds on php-db/phpdb 0.6, which
has no stable release yet. Composer only honours stability flags in the root package, so a site needs these in its
own composer.json:
Alternatively set "minimum-stability": "dev" with "prefer-stable": true in the site's composer.json and
require contenir/contenir-resource normally.
With laminas-component-installer the
Contenir\Resource\Core\ConfigProvider is added to your configuration automatically. It registers its services
under dependencies; contenir-db-model's own ConfigProvider supplies the EntityManager.
Quick start
Configuration
Everything is optional and lives under contenir_resource:
A key that is present with a value of the wrong type is a ConfigurationException, never silently ignored.
Public API
| Class | Purpose |
|---|---|
Entity\AbstractResourceEntity, Entity\ResourceEntity |
Resource rows; metadata, navigation and routing accessors |
Entity\AbstractResourceCollectionEntity, Entity\ResourceCollectionEntity |
Collection rows |
Entity\AbstractResourceTypeEntity, Entity\ResourceTypeEntity |
Resource type rows |
Entity\ResourceStatus |
The active column: pending, active, inactive, archived |
Repository\ResourceRepository |
Finders and findPageTree() |
Repository\ResourceCollectionRepository, Repository\ResourceTypeRepository |
Finders |
ResourceManagerInterface, ResourceManager |
Lookups by id, slug, workflow, type; collections by type |
Metadata\PageMetadataBuilder, Metadata\PageMetadata |
The head metadata of one page |
Metadata\MetaTagRenderer |
Escaped HTML for any template engine |
Metadata\MetaText |
Plain-text cleaning, summaries and keywords |
Metadata\ImageUrlResolverInterface, Metadata\PathImageUrlResolver |
Share image URLs |
Content\ResourceSummary, Content\SectionAwareInterface, Content\SectionRendererInterface |
Plain-text summaries |
Url\ExternalUrl, Url\ResourceLink |
Safe editor-entered links |
ConfigProvider, Container\*Factory |
Container wiring |
Every concrete class is final; the abstract entities and the interfaces are the extension points.
The docs folder covers each area:
- Entities
- Repositories and the resource manager
- Page metadata
- Summaries and links
- Configuration and container
Development
The QA toolchain is php-db/phpdb-qa-tools.
Mago is a standalone binary, installed separately (brew install mago).
License
BSD-3-Clause. See LICENSE.md.
All versions of contenir-resource with dependencies
contenir/contenir-db-model Version ^2.0@RC
contenir/contenir-metadata Version ^2.0
psr/container Version ^1.1 || ^2.0