Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
db
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

simple-blog

A simple blog built in PHP

Build Status Coverage Status

This is a basic blog engine built in PHP, without any frameworks but instead multiple composer packages linked together.

Installation

Follow these steps if you plan to install this project either locally or for production.

Introduction

Make sure you have at least PHP 7.2 installed, a MySQL server, and composer.

In the root of the project, type composer install to install all the dependencies.

Then, make a copy of .env.example into a .env file, and change the env parameters as you need (including the DB ones).

HTTP Server

On dev environment, you can start a simple PHP server by running the following from the root of the project:

php -S localhost:8000 -t frontend/public/

You can of course use any other HTTP server of your choice. Just note that the root folder is frontend/public, with the index.php file as an entry point.

SQL

SQL migrations are done using Phinx.

To generate the tables structures in your database, simply type:

vendor/bin/phinx migrate

Fake data

If you wish to pre-seed your local dev environment with fake data, this project contains some Phinx seeders.

You can run them by typing:

vendor/bin/phinx seed:run

This will insert some random data into your DB tables.

Admin

Once the project is installed, head over to the /admin URL in your browser to access the admin interface. (That would be http://localhost:8000/admin on dev)

It will ask you for the admin credentials you set in .env.

On the admin index, you'll need to update the Blog Configuration. There, you can set the name of your blog, a short description of it for the home page, and some text about you and your blog that will display on the about page.

You'll also need at least one author created through admin.

Once this is all done, you should be ready to write blog posts!

About

A simple blog built in PHP

Topics

Resources

License

Releases

No releases published

Packages

No packages published