Sihae is a PHP 7.4+ blog engine built with Slim Framework and Doctrine ORM.
- Publish blog posts
- Markdown formatting (CommonMark via league/commonmark)
- Syntax highlighting (via Prism.js)
- Tag posts and explore all posts by their tag(s)
- Archive list of all posts grouped by year
- PHP 7.4+
- MySQL or SQLite
$ composer install
$ cp .env.example .env
# configure .env with database connection details
# create a database matching the "DB_NAME" in your .env
$ php vendor/bin/doctrine-migrations migrations:migrate
$ git fetch
$ git rebase
$ composer install --no-dev --no-suggest --optimize-autoloader
$ php vendor/bin/doctrine-migrations migrations:migrate
$ rm data/cache/router.php
All configuration is done in the .env
file at the root of the project. It contains the following options:
DB_DRIVER
— choose which database to use, possible options are:pdo_mysql
to use MySQLpdo_sqlite
to use SQLite
DB_PATH
— the path to store the database; this must be an absolute path! This is only required ifDB_DRIVER
is set topdo_sqlite
.DB_HOST
— the host to connect to the database on. This is only required ifDB_DRIVER
is set topdo_mysql
DB_PORT
— the port to use when connecting to the database host. This is only used ifDB_DRIVER
is set topdo_mysql
and the default MySQL port (3306) will be used if this is omittedDB_NAME
— the name of the database to use. This is only required ifDB_DRIVER
is set topdo_mysql
DB_USER
— the user to connect to the database with. This is only required ifDB_DRIVER
is set topdo_mysql
DB_PASSWORD
— the password to use for theDB_USER
. This is only required ifDB_DRIVER
is set topdo_mysql
APPLICATION_ENV
— the environment the application is running in. Locally this should bedevelopment
and should beproduction
when deployedSIHAE_TITLE
— the title of your blogSIHAE_SUMMARY
— the summary (line below the title) of your blogENABLE_REGISTRATION
— whether to allow users to be registered. This should be turned off after the you have registered your initial user
Creating a custom theme is super easy; Sihae will try to load template files from templates/theme
before falling back to the root of templates
. This means you can replace any template by creating a file with the same name inside templates/theme
. For example, you can create a custom 404 page by creating templates/theme/404.phtml
.
The templates/theme
directory is ignored by git in the Sihae repository so it won't be overwritten in future versions.
Be sure to read the Plates documentation for details on how to create templates.
If you need to include images, CSS or JavaScript in your theme, there is a public/theme
directory to store any assets your theme requires. This is also ignored by git.