19ft / nf-development-mode
Requires
- php: >=5.3.3
- zendframework/zend-console: >=2.2.2
- zendframework/zend-mvc: >=2.2.2
Suggests
- zendframework/zend-developer-tools: dev-master
- zendframework/zend-tool: dev-master
This package is not auto-updated.
Last update: 2022-02-01 12:29:25 UTC
README
#NFDevelopmentMode
更新:现在该模块有一个官方版本在
https://github.com/zfcampus/zf-development-mode
这个 ZF2 开发模式模块是从 Apigility 骨架的开发模式控制器中提取出来,用于 ZF2 应用程序的自定义模块。
##使用 Composer 安装
-
将
"19ft/nf-development-mode": "1.*"
添加到您的composer.json
文件的"require"
部分,并运行php composer.phar update
。 -
将
development.config.dist
复制到config/development.config.dist
,并根据需要进行编辑。将此文件提交到您的 VCS。 -
将任何开发模块添加到应用程序的
composer.json
文件的"require-dev"
部分。例如"zendframework/zend-developer-tools": "dev-master", "zendframework/zftool": "dev-master"
然后运行
composer.update
。 -
如果您使用的是 Zend 开发者工具,请将
./vendor/zendframework/zend-developer-tools/config/zenddevelopertools.local.php.dist
复制到./config/autoload/zenddevelopertools.local.php
。根据您的需要更改其中的任何设置。 -
将
'NFDevelopmentMode'
添加到您的config/application.config.php
文件中的模块列表中。 -
在
public/index.php
中,将这些行// Run the application! Zend\Mvc\Application::init(require 'config/application.config.php')->run();
替换为
// Config $appConfig = include APPLICATION_PATH . '/config/application.config.php'; if (file_exists(APPLICATION_PATH . '/config/development.config.php')) { $appConfig = Zend\Stdlib\ArrayUtils::merge($appConfig, include APPLICATION_PATH . '/config/development.config.php'); } // Run the application! Zend\Mvc\Application::init($appConfig)->run();
要启用开发模式
cd path/to/install
php public/index.php development enable
要禁用开发模式
cd path/to/install
php public/index.php development disable
注意:不要在生产服务器上运行开发模式。