On Github tmquang6805 / zf2-usable-config-project
curl -s https://getcomposer.org/installer | php -- php composer.phar create-project -sdev zendframework/skeleton-application .
$pendrive
Setup your vhost or php 5.4+
php -S 127.0.0.1:8001 -t skeleton-application/public skeleton-application/public/index.php
php composer.phar require zendframework/zend-developer-tools:dev-master
return array(
// This should be an array of module namespaces used in the application.
'modules' => array(
'Application',
'ZendDeveloperTools',
),
/* other configurations */
);
Copy ./vendor/zendframework/zend-developer-tools/config/zenddevelopertools.local.php.dist to ./config/autoload/zenddevelopertools.local.php
Change any settings in it according to your needs.
"repositories": [
{
"type": "vcs",
"url": "private-repository"
}
],
"require": {
"private-modulename": "dev-master"
}
php composer.phar update
{
"name": "private-modulename",
"description": "ZF2 demo",
"type": "zf-module",
"homepage": "https://private-repository",
"authors": [
{
"name": "QuangTM",
"email": "quangtm@hdviet.com"
}
],
"require": {
"php": "~5.4",
"zendframework/zendframework" : "~2.2"
},
"autoload": {
"psr-0": {
"Backend": "src/"
},
"classmap": [
"./Module.php"
]
}
}
application.config.php
Enable/Disable ZF2 modules
Specify autoload config files
Cache merged config
module.config.php - config/autoload/{,*.}{global,local}.php
Merge configs runtime (if not cached)
Right Application Config
Enable/Disable ZF2 modules
'modules' => array(
'Application',
'ZendDeveloperTools',
'Backend',
),
Specify autoload config files
'config_glob_paths' => array(
'config/autoload/{,*.}{global,local}.php',
),
Cache merged config
'config_cache_enabled' => $booleanValue
'config_cache_key' => $stringKey
'module_map_cache_enabled' => $booleanValue
'module_map_cache_key' => $stringKey
'cache_dir' => $stringPath
module.config.php
Effective only for module
{,*.}{global,local}.php
global.config.php
environment and not sensitive to security
local.config.php
environment and sensitive to security