GitHub

Configuration

Configuration can be defined in adminneo-config.php file placed in the AdminNeo's current working directory.
A simple file structure will be:

– adminneo.php
– adminneo-config.php

You can freely rename adminneo.php to index.php.

The file adminneo-config.php will return the configuration array:

<?php

// Define configuration.
return [
    "colorVariant" => "green",
    "navigationMode" => "dual",
    "preferSelection" => true,
    "recordsPerPage" => 70,
];

Parameters

All parameters available in AdminNeo are listed in the following table. Parameters available in EditorNeo are labeled in the Editor column.

ParameterDefaultEditorDescription
theme default YES Theme code. Available themes are: default.
colorVariant blue YES Theme color variant. Available variants are: blue, green, red.
cssUrls [] YES List of custom CSS files.
jsUrls [] YES List of custom JavaScript files.
navigationMode simple no Main navigation mode that affects the left menu with the list of tables and top links: simple, dual, reversed.
preferSelection false no Whether data selection is the primary action for all table links.
jsonValuesDetection false no Whether to detect JSON objects and arrays in text columns.
jsonValuesAutoFormat false no Whether to automatically format JSON values while editing.
enumAsSelectThreshold 5 YES Threshold for displaying <select> for enum fields instead of radio list in edit form.
recordsPerPage 50 YES Number of selected records per one page.
versionVerification true YES Whether verification of the new AdminNeo's version is enabled.
hiddenDatabases [] no List of databases to hide from the UI. Value __system will be expanded to all system databases. Access to these databases will be not restricted.
hiddenSchemas [] no List of schemas to hide from the UI. Value __system will be expanded to all system databases. Access to these databases will be not restricted.
visibleCollations [] no List of collations to keep in select boxes while editing databases or tables.
defaultDriver null YES Default driver for the login form.
defaultServer null YES Default server host and port for the login form.
Devel version
defaultDatabase null no Default database name for the login form.
Devel version
defaultPasswordHash null YES Hash of the default password for authentication to password-less databases. Set to an empty string to allow connection without password.
sslKey null YES MySQL: The path name to the SSL key file.
sslCertificate null YES MySQL: The path name to the certificate file.
sslCaCertificate null YES MySQL: The path name to the certificate authority file.
sslTrustServerCertificate null YES MySQL, MS SQL: Whether to trust server certificate. Values: true, false, null.
sslEncrypt null YES MS SQL: Whether the communication is encrypted. Values: true, false, null.
sslMode null YES PostgreSQL: Value for sslmode connection parameter.
servers [] no List of predefined server connections.

theme

Theme code. Available themes are: default. Make sure that the theme is compiled into the final single file. If the theme is not found, the default theme will be used.

colorVariant

Theme color code. Available variants are: blue, green, red. Make sure that the color variant is compiled into the final single file together with the selected theme. If the color variant is not found, blue color will be used.

cssUrls

List of custom CSS files. For example:

"cssUrls" => [
    "custom.css",
    "https://www.myservice.com/adminneo.css",
],

ℹ️ Note: It is also possible to use autoloaded adminneo.css file for basic UI modifications.

jsUrls

List of custom JavaScript files. For example:

"cssUrls" => [
    "custom.js",
    "https://www.myservice.com/adminneo.js",
],

ℹ️ Note: It is also possible to use autoloaded adminneo.js file for basic UI modifications.

Main navigation mode that affects the left menu with the list of tables and main navigation links.

simpleOnly one primary link is displayed in the left menu.
dualBoth primary link and secondary icon are displayed in the left menu.
reversedDual mode with reversed order of the primary link and secondary icon.

preferSelection

Whether data selection is the primary action for all table links. This also affects the order of main navigation links to be consistent with the left menu.

jsonValuesDetection

Whether to detect JSON objects and arrays in text columns. Detected JSON values will be displayed with syntax highlighting.

jsonValuesAutoFormat

Whether to automatically format JSON values while editing. JSON values will be pretty-formatted in edit fields and minified before writing to database.

enumAsSelectThreshold

Threshold for displaying <select> for enum fields instead of radio list in edit form. If the number of enum values is greater than this threshold, select will be used. Set null to disable the threshold.

recordsPerPage

The default number of selected records per one page.

versionVerification

Whether verification of the new AdminNeo's version is enabled.

hiddenDatabases

List of databases to hide from the UI. Value __system will be expanded to all system databases for the current driver. The * character can be used as a wildcard.

⚠️ Warning: Access to these databases is not restricted. They can be still selected by modifying URL parameters.

For example:

"hiddenDatabases" => ["__system", "some_other_database"],

hiddenSchemas

List of schemas to hide from the UI. Value __system will be expanded to all system schemas for the current driver. The * character can be used as a wildcard.

⚠️ Warning: Access to these schemas is not restricted. They can be still selected by modifying URL parameters.

For example:

"hiddenSchemas" => ["__system", "some_other_schema"],

visibleCollations

List of collations to keep in the select box when editing databases or tables. The * character can be used as a wildcard. If an existing table or row uses a different collation, it will also be preserved in the select box.

ℹ️ Note: Access to other collations is not restricted.

For example:

"visibleCollations" => ["ascii_general_ci", "utf8mb4*czech*ci"],

defaultDriver

Default driver for the login form. Given value is validated against available drivers. If driver is not set or is invalid, the first available driver will be used.

defaultDriver Devel version

Default server host and port for the login form. If also servers parameter is set, default server will be the key to the servers list.

For example:

"defaultServer" => "localhost:5432",
"servers" => [
    ["driver" => "mysql", "name" => "Devel DB"],
    ["driver" => "pgsql", "server" => "localhost:5432"],
],
"defaultServer" => 1,
"servers" => [
    "service1" => ["driver" => "mysql", "name" => "Service 1", "database" => "service1"],
    "service2" => ["driver" => "mysql", "name" => "Service 2", "database" => "service2"],
],
"defaultServer" => "service2",

defaultDatabase Devel version

Default database name for the login form.

defaultPasswordHash

By default, AdminNeo does not allow connecting to a database without a password. This affects password-less databases such as SQLite, SimpleDB or Elasticsearch. In this parameter, you can specify a hash of the default password to enable internal authentication. The given password will be validated by AdminNeo and not passed to the database itself.

Set to an empty string to allow connection without a password.

⚠️ Warning: Allow an empty password on your own risk and put other sufficient safety measures in place.

ℹ️ Note: Custom password verification requires PHP 5.5. With PHP 5.4, it is only possible to disable the password.

For example:

// Inline the result of password_hash() so that the password is not visible in the source code.
// password_hash("YOUR_PASSWORD_HERE", PASSWORD_DEFAULT)
"defaultPasswordHash" => "$2y$12$iPiS7CrfImmfjfQU9YU4ZeGNXRu9NiszTPyMik/ZsrRAadlgs8r3G",

sslKey

MySQL: The path name to the SSL key file.

sslCertificate

MySQL: The path name to the certificate file.

sslCaCertificate

MySQL: The path name to the certificate authority file.

sslTrustServerCertificate

MySQL, MS SQL: Whether to trust server certificate. Values: true, false or null (for not setting the corresponding parameter).

sslEncrypt

MS SQL: Whether the communication is encrypted. Values: true, false or null (for not setting the corresponding parameter).

sslMode

PostgreSQL: Value for sslmode connection parameter.

servers

List of predefined server connections. Each server connection has parameters:

ParameterRequiredDescription
driver YES Driver code: mysql, pgsql, mssql, sqlite, oracle, mongo, simpledb, elastic, clickhouse.
server no Server address.
database no Database name, or file path to SQLite file.
name no Custom server name.
username no Database user that will be used to log in.
password no Database user's password.
config no Configuration parameters that overrides global config.

For example:

"servers" => [
    [
        "driver" => "mysql",
        "name" => "Devel DB",
        "config" => ["colorVariant" => "green"],
    ],
    [
        "driver" => "pgsql",
        "server" => "localhost:5432",
        "database" => "postgres",
    ],
    [
        "driver" => "sqlite",
        "database" => "/projects/my-service/test.db",
        "config" => ["defaultPasswordHash" => ""],
    ],
],

It is also possible to define custom server keys. This is needed to properly distinguish between multiple connections to the same server.

"servers" => [
    "service1" => [
        "driver" => "mysql",
        "name" => "Service 1",
        "database" => "service1",
    ],
    "service2" => [
        "driver" => "mysql",
        "name" => "Service 2",
        "database" => "service2",
    ],
],

Username and password are used to log in to the database if the login form is submitted with empty credentials. This can be used to:

ℹ️ Note: Global configuration parameter servers can't be overridden by a server connection.