mamuz / mamuz-blog
Provides blog feature for ZF2 with Doctrine
Installs: 1 107
Dependents: 1
Suggesters: 0
Security: 0
Stars: 10
Watchers: 4
Forks: 1
Open Issues: 1
Requires
- php: >=5.4
- ext-intl: *
- cocur/slugify: ~1.0
- doctrine/doctrine-orm-module: ~0.8
- hashids/hashids: ~1.0.5
- maglnet/magl-markdown: ~1.3
- neilime/zf2-twb-bundle: ~2.4
- zendframework/zend-eventmanager: ~2.3
- zendframework/zend-form: ~2.3
- zendframework/zend-http: ~2.3
- zendframework/zend-i18n: ~2.3
- zendframework/zend-loader: ~2.3
- zendframework/zend-modulemanager: ~2.3
- zendframework/zend-mvc: ~2.3
- zendframework/zend-servicemanager: ~2.3
- zendframework/zend-view: ~2.3
Requires (Dev)
- mamuz/php-dependency-analysis: 0.*
- mockery/mockery: 0.9.*
- phpunit/phpunit: 4.*
- satooshi/php-coveralls: 0.6.*
Suggests
- mamuz/mamuz-blog-feed: To provide rss and/or atom feeds
README
Features
- This module provides a blog based on ZF2 and Doctrine2.
- Posts are rendered by a markdown parser.
- Posts are taggable and searchable.
- Post listing is provided, same is true for tags.
- Hyperlinks to dedicated posts are secured by encrypted identities.
- Hyperlinks also ends with slugified post titles to meet SEO.
- Hyperlinks are Permalinks.
- Views are twitter-Bootstrap compatible.
Installation
The recommended way to install
mamuz/mamuz-blog
is through
composer by adding dependency to your composer.json
:
{ "require": { "mamuz/mamuz-blog": "*" } }
After that run composer update
and enable this module for ZF2 by adding
MamuzBlog
to modules
in ./config/application.config.php
:
// ... 'modules' => array( 'MamuzBlog', ),
This module is based on DoctrineORMModule
and be sure that you have already configured database connection.
Create database tables with command line tool provided by
DoctrineORMModule
:
./vendor/bin/doctrine-module orm:schema-tool:update
Configuration
Post identity encryption for hyperlinks
Encryption is supported by hashids/hashids
and have to be configured by copy ./vendor/mamuz-blog/config/crypt.local.php.dist
to ./config/autoload/crypt.local.php
. Be sure that this file is not under version control.
The only thing you have to do is changing salt
value to any complex string.
Default configuration
Besides configuration for identity encryption this module is usable out of the box,
but you can overwrite default configuration by adding a config file in ./config/autoload
directory.
For default configuration see
module.config.php
Pagination
Listings of posts and tags includes a pagination feature, which seperates
views to a default range. Default range is overwritable by adding a config file in ./config/autoload
directory.
Posts
Post listing is provided by route blogPublishedPosts
and default range is two items.
Tags
Tag listing is provided by route blogTags
and default range is 10 items.
Creating a new Post
Create an entity in MamuzBlogPost
repository and tag it in related MamuzBlogTag
.
Admin Module to provide an interface for that is planned.
Workflow
If routing to a dedicated post found by published flag and encrypted identity is successful, post content will be responsed in a new view model rendered as markdown, otherwise it will set a 404 status code to the http response object.
Events
For the sake of simplicity Event
is used for FQN MamuzBlog\EventManager\Event
.
The following events are triggered by Event::IDENTIFIER
mamuz-blog:
Terminology
- Posts: Published articles about any issues which are listed chronological in a blog.
- Tag: Category to group related posts to a specific issue.
- Permalink: Human-readable and unchangeable hyperlink to a dedicated post or to a list of posts by a specific tag.