-
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 index.html.
<script type="text/javascript">
$(document).ready(function() {
mollify.App.init({
"service-path": "backend/", // service path
"limited-http-methods" : false, // limited HTTP methods
"view-url": false, // reflect view in url
"file-view": { // file view options
"drop-type": ..., // customize drag&drop operation
"create-empty-file-action": false, // create empty file
"default-view-mode": "list", // default view mode
"icon-view-thumbnails": false, // show icon thumbnails in icon view mode
"list-view-columns": {
... // file list column setup
},
...
}},
[
... // client plugins
]
);
});
</script>
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"
);
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
)
);
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"
),
);