Empathy MVC

ELib Base

System requirements

  • PHP 5.3
  • Web server config that supports following symlinks (for admin/backend assets)

Setup

Create a composer.json file with elib-blog in the require block:

{
    "require": {
        "mikejw/elib-base": "0.9.4"
    },
    "minimum-stability": "dev"
}

Run composer install and then launch the empathy New App command line helper:

php composer.phar install --prefer-source
php ./vendor/bin/empathy --new_app

Database

Add databse config settings to config.yml. (dbserver, dbuser, dbpass, dbname.) If the database doens't exist create it at this point. (The database will be called 'project' for this tutorial.) Create a file called setup.sql for data definition and add the following to the top of the file:

DROP DATABASE IF EXISTS project;
CREATE DATABASE project;
USE project;

Next copy the contents of ./vendor/mikejw/elib-base/dd.sql to this file. Between these two chunks of code (after use project; and before the create table blocks) create the SQL statement to drop these tables:

DROP TABLE IF EXISTS user_profile, e_user;                        

Next create a file called inserts.sql for data manipulation and add at the top:

use project;

Copy the contents from ./vendor/mikejw/elib-base/dm.sql to this file. Initiate the development database with:

php ./vendor/bin/empathy --mysql setup

Application

Generate the default application controllers with:

php ./vendor/bin/empathy --inst_mod admin
php ./vendor/bin/empathy --inst_mod user

Change the useelib bootoptions setting in /config.yml to true.

Backend

Sign into the backend with username 'mikejw' and password 'password' at http://localhost/public_html/user/login".

Create a symlink to the admin asset directory:

cd public_html; ln -s ../vendor/mikejw/elib-base/public ./elib

Update variables (WEBROOT, PUBLICDIR) in the file ./public_html/js/common.js to reflect those used in config.yml. This will ensure the drop-down help menu functions properly.

Passwords can be changed at http://localhost/basetest/public_html/admin/password.

 

Comments