dev-master
9999999-dev https://github.com/basicinvoices/basicinvoices-modulemanager
BSD-3-Clause
The Requires
- php ^5.6 || ^7.0
- zendframework/zend-modulemanager ^2.7.1
- zendframework/zend-stdlib ^3.0
The Development Requires
zf2 db modulemanager
Wallogit.com
2017 © Pedro Peláez
This module basically allows you to load modules from a database table., (*1)
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
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)
BSD-3-Clause
zf2 db modulemanager