Skip to content
sjarvela edited this page Feb 11, 2015 · 13 revisions

Introduction

Mollify app has two configurations

  • Client configuration
  • Backend configuration

Client configuration

Backend configuration

Backend configuration file is located under folder "backend". Example configuration files can be found from "backend/examples".

Syntax of the configuration file is following:

$CONFIGURATION = array(
	"name" => "value",
	"name2" => "value2"
);

All possible configuration options, coming.

At minimum, define option "db" for database configuration, and "plugins" to configure plugins.

For example:

$CONFIGURATION = array(
	"db" => array(
		// DB CONFIGURATION OPTIONS HERE
	),
	// OTHER CONFIGURATION OPTIONS HERE

	"plugins" => array(
		// PLUGIN CONFIGURATION HERE
	)
);

Database

Mollify supports MySQL and SQLite databases, either directly or via PDO interface.

MySQL

Before installing Mollify, create MySQL user and database for Mollify, and grant the new user CREATE/INSERT/UPDATE/DELETE rights for the created database.

Create configuration file with MySQL database information, for example:

$CONFIGURATION = array(
	"db" => array(
		"type" => "mysql",
		"user" => "mollify",
		"password" => "mollify",

		"host" => "localhost", // optional
		"database" => "mollify", // optional
		"table_prefix" => "mollify_", // optional
		"charset" => "utf8" // optional

		"engine" => "innodb" // optional, used only in installation
	),
);

Values "host", "database", "table_prefix" and "engine" are optional. If these are not defined, it is assumed that MySQL server is running on localhost, database is called "mollify" and tables are accessed without name prefix.

With localhost database, you can also provide socket for the connection:

    "socket" => "/tmp/mysql5.sock"

Default MySQL engine used is InnoDB. With option "engine" you can change this (NOTE used only on installation).

    "engine" => "myisam";

Using MySQL via PDO can be configured like this:

$CONFIGURATION = array(
	"db" => array(
		"type" => "pdo",
		"str" => "mysql:host=localhost;dbname=mollify",
		"user" => "mollify",
		"password" => "mollify",

		"table_prefix" => "mollify_", // optional
		"charset" => "utf8" // optional
	),
);

SQLite

Create configuration file with SQLite database information, for example:

$CONFIGURATION = array(
	"db" => array(
		"type" => "sqlite",
		"file" => "db.file"
	),
);

Value "file" defines the location of the SQLite database file. NOTE Using absolute path is recommended.

For SQLite version 3, use type value "sqlite3".

Using SQLite via PDO can be configured like this:

$CONFIGURATION = array(
	"db" => array(
		"type" => "pdo",
		"str" => "sqlite:mollify.db",
		"user" => "mollify",
		"password" => "mollify"
	),
);

Clone this wiki locally