Elaborate on how to set up dev env

This commit is contained in:
Joost Rijneveld 2022-11-27 14:02:40 +01:00
parent 7d82a4a924
commit a211e3ae4a
5 changed files with 62 additions and 8 deletions

7
.gitignore vendored
View File

@ -1,5 +1,2 @@
.DS_Store
composer.lock
config.php
hashru.sublime-project
hashru.sublime-workspace
composer-setup.php
composer.phar

View File

@ -13,12 +13,22 @@ The Kabuki codebase requires the following PHP extensions to be enabled for full
## Setup
Copy `config.php.dist` to `config.php` and set-up the constants contained in the file.
Copy `config.php.dist` to `config.php` and set-up the constants contained in the file. For development, consider starting from `config-dev.php.dist`.
Ensure you have a MySQL database running with credentials matching your `config.php`. For development, consider the /dev/docker-compose.yml file.
Run `composer install`. If you do not have composer installed globally, run it from the project directory as follows:
```
wget -O composer-setup.php https://getcomposer.org/installer
php composer-setup.php --install-dir=.
php ./composer.phar install
```
## Running
For development purposes, simply run the `server` script provided in the root of this repository.
This will start a PHP development server on `hashru.local:8080`.
This will start a PHP development server on `127.0.0.1:8080`.
For a production environment, please set up a proper PHP-FPM environment instead.

36
config-dev.php.dist Normal file
View File

@ -0,0 +1,36 @@
<?php
/*****************************************************************************
* config.php
* Contains general settings for the project.
*
* Kabuki CMS (C) 2013-2015, Aaron van Geffen
*****************************************************************************/
const DEBUG = true;
const CACHE_ENABLED = true;
const CACHE_KEY_PREFIX = 'hashru_';
// Basedir and base URL of the project.
const BASEDIR = __DIR__;
const BASEURL = 'http://127.0.0.1:8080'; // no trailing /
// Reply-To e-mail header address
const REPLY_TO_ADDRESS = 'no-reply@my.domain.tld';
// Assets dir and url, where assets are plentiful. (In wwwroot!)
const ASSETSDIR = BASEDIR . '/public/assets';
const ASSETSURL = BASEURL . '/assets';
// Thumbs dir and url, where thumbnails for assets reside.
const THUMBSDIR = BASEDIR . '/public/thumbs';
const THUMBSURL = BASEURL . '/thumbs';
// Database server, username, password, name
const DB_SERVER = '127.0.0.1';
const DB_USER = 'hashru';
const DB_PASS = 'hashru';
const DB_NAME = 'hashru_pics';
const DB_LOG_QUERIES = false;
const SITE_TITLE = 'HashRU Pics';
const SITE_SLOGAN = 'Nijmeegs Nerdclubje';

11
dev/docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
version: '3'
services:
mysql:
image: mysql:latest
ports:
- 3306:3306
environment:
MYSQL_USER: 'hashru'
MYSQL_PASSWORD: 'hashru'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: 'hashru_pics'

2
server
View File

@ -1,2 +1,2 @@
#!/bin/bash
php -S hashru.local:8080 -t public
php -S 127.0.0.1:8080 -t public