basicinvoices-modulemanager
This module basically allows you to load modules from a database table., (*1)
Installation
Add this project in your composer.json
:, (*2)
"require": {
"basicinvoices/basicinvoices-modulemanager": "dev-master"
}
Tell composer to download the module by running:, (*3)
composer update
Post installation
Enable the module in your application by editting module.config.php
. As an example:, (*4)
return [
'Zend\Db',
'BasicInvoices\ModuleManager',
'Zend\Validator',
'Application',
];
Create the database table., (*5)
CREATE TABLE IF NOT EXISTS `modules` (
`name` varchar(100) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`active` tinyint(1) NOT NULL DEFAULT '0',
UNIQUE KEY `UX_MODULE_NAME` (`name`),
KEY `IX_ACTIVE_MODULE` (`active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
The description column is not really needed but comes in handy if building a controller to load or unload the modules., (*6)
The module will only load the active
modules., (*7)
Enable the database configuration by editting global.php
, (*8)
return [
'db' => [
'driver' => 'Pdo',
'dsn' => 'mysql:dbname=basic_invoices;host=localhost',
'driver_options' => [
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''
],
],
];
...and the database credentials in your local.php
, (*9)
return [
'db' => [
'username' => 'YOURUSERNAME',
'password' => 'YOURPASSWORD',
],
];
...and you are ready to go!, (*10)