Download the PHP package phly/phly-blog without Composer
On this page you can find all versions of the php package phly/phly-blog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package phly-blog
PhlyBlog: Static Blog Generator
This module is a tool for generating a static blog.
Blog posts are simply PHP files that create and return PhlyBlog\EntryEntity
objects.
You point the compiler at a directory, and it creates a tree of files representing your blog and its feeds.
These can either be consumed by your application, or they can be plain old HTML markup files that you serve directly.
Requirements
- PHP >=
7.3
- Laminas packages, notably:
- laminas/laminas-view, used to render and write generated files.
- laminas/laminas-mvc and laminas/laminas-modulemanager, as this implements a module, and the compiler script depends on it and a laminas-mvc
Application
instance. As such, it also has a dependency on laminas/laminas-servicemanager and laminas/laminas-eventmanager. - laminas/laminas-feed for generating feeds.
- laminas/laminas-tag for generating tag clouds.
- phly/phly-common for Entity and Filter interfaces.
Installation
Use Composer to add this module to your application:
Writing Entries
Find a location in your repository for entries, preferably outside your document root; I recommend either data/blog/
or posts/
.
Post files are simply PHP files that return a PhlyBlog\EntryEntity
instance.
A sample is provided in misc/sample-post.php
.
This post can be copied as a template.
Important things to note:
- Set the created and/or updated timestamps.
Alternately, use
DateTime
ordate()
to generate a timestamp based on a date/time string. - Entries marked as "drafts" (i.e.,
setDraft(true)
) will not be published. - Entries marked as private (i.e.,
setPublic(false)
) will be published, but will not be aggregated in paginated views or feeds. As such, you need to hand the URL to somebody in order for them to see it. - You can set an array of tags. Tags can have whitespace, which will be translated to "+" characters.
Usage
This module provides laminas/laminas-cli tooling.
Run:
to get usage. Currently, the compilation tooling can generate the following artifacts:
- A file per entry
- Paginated entry files
- Paginated entry files by year
- Paginated entry files by month
- Paginated entry files by day
- Paginated entry files by tag
- Atom and/or RSS feeds for recent entries
- Atom and/or RSS feeds for recent entries by tag
- Optionally, a tag cloud
You will want to setup local configuration; I recommend putting it in
config/autoload/blog.global.php
. As a sample:
When you run the command line tool, it will generate files in the locations you specify in your configuration.
All versions of phly-blog with dependencies
laminas/laminas-cli Version ^0.1.4
laminas/laminas-console Version ^2.5
laminas/laminas-dependency-plugin Version ^1.0 || ^2.0
laminas/laminas-eventmanager Version ^3.0
laminas/laminas-feed Version ^2.5
laminas/laminas-filter Version ^2.5
laminas/laminas-http Version ^2.5
laminas/laminas-i18n Version ^2.5
laminas/laminas-inputfilter Version ^2.5
laminas/laminas-modulemanager Version ^2.5
laminas/laminas-mvc Version ^3.0
laminas/laminas-paginator Version ^2.5
laminas/laminas-stdlib Version ^3.0
laminas/laminas-tag Version ^2.5
laminas/laminas-uri Version ^2.5
laminas/laminas-validator Version ^2.5
laminas/laminas-view Version ^2.5
phly/phly-common Version ^2.0.1
symfony/console Version ^5.1