Download the PHP package comeonfox/phly-blog without Composer
On this page you can find all versions of the php package comeonfox/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 >= 5.3.3
- Zend Framework 2 >= 2.0.0beta4, specifically:
- Zend\View\View, used to render and write generated files
- Zend\Mvc and Zend\ModuleManager, as this implements a module, and the compiler script depends on it and an Application instance. As such, it also has a dependency on Zend\Loader, Zend\ServiceManager, and Zend\EventManager.
- Zend\Feed\Writer
- Zend\Tag\Cloud
- PhlyCommon (for Entity and Filter interfaces)
Installation
You can add this module as a git submodule to your repository. Alternately, use
composer. To do so, add the following composer.json
configuration in your
project:
and then execute:
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 is ZF2 Console-aware. Once installed and active in your application, you should be able to run:
and see usage for the module. Currently, it defines a "blog compile" action that 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/module.blog.config.global.php
. As a sample:
When you run the command line tool, it will generate files in the locations you specify in your configuration.
License
Copyright (c) 2012, Matthew Weier O'Phinney All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
All versions of phly-blog with dependencies
zendframework/zendframework Version 2.*
phly/phly-common Version dev-master