-
Notifications
You must be signed in to change notification settings - Fork 10
Configuration
Mollify app has two configurations
- Client configuration
- Backend configuration
Client configuration is defined in the application web page (index.html), and installation package has an example page.
Application is configured in the js app initialization, and the syntax of the initialization call is following:
<script type="text/javascript">
$(document).ready(function() {
mollify.App.init({
... // CONFIGURATION OPTIONS
},
[
... // CLIENT PLUGINS
]
);
});
</script>
For all possible configuration options, see Client Configuration Options.
Backend configuration file is "configuration.php" located under folder "backend". Example configuration files can be found from "backend/examples".
Syntax of the "configuration.php" is following:
$CONFIGURATION = array(
"option_key" => "value",
"option_key_2" => "value2"
);
At minimum, define option "db" for database configuration.
For example:
$CONFIGURATION = array(
"db" => array(
// DB CONFIGURATION OPTIONS HERE
),
// OTHER CONFIGURATION OPTIONS HERE
);
For all possible configuration options, see Backend Configuration Options.
Mollify supports MySQL and SQLite databases, either directly or via PDO interface.
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
),
);
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"
),
);
For example:
$CONFIGURATION = array(
...
"plugins" => array(
// PLUGIN CONFIGURATION HERE
)
);