dlu / dluphpsettings
ZF2 module to set PHP ini settings based on the configuration data
Requires
- zendframework/zendframework: >=2.0.5
This package is not auto-updated.
Last update: 2018-12-08 00:09:45 UTC
README
Introduction
DluPhpSettings is a Zend Framework 2 module used to set the PHP ini settings based on the configuration data.
More info
You can find more information and discussion of this module on my blog ZF Daily here: Configuring PHP ini Settings in ZF2
Installation - manual
- Go to your project's directory.
Clone this project into your
./vendor
directory as aDluPhpSettings
module:git clone https://bitbucket.org/dlu/dluphpsettings.git ./vendor/DluPhpSettings
Follow the Post installation steps bellow
Installation - with Composer
- Go to your project's directory.
- Edit your
composer.json
file and add"dlu/dluphpsettings": "dev-master"
intorequire
section. - Run
php composer.phar install
(orphp composer.phar update
). - Follow the Post installation steps bellow
Post installation steps
Enable the DluPhpSettings module in your app config file
<your app>/config/application.config.php
:- add
'DluPhpSettings',
undermodules
- add
Usage
Put any allowed PHP ini settings under the phpSettings
key into any of your configuration files:
/* Global application configuration in /config/autoload/global.php */
<?php
return array(
'phpSettings' => array(
'display_startup_errors' => false,
'display_errors' => false,
'max_execution_time' => 60,
'date.timezone' => 'Europe/Prague',
'mbstring.internal_encoding' => 'UTF-8',
),
);
You can find the list of available PHP ini directives in the PHP docs.
Use the global config files for global application configuration and local config files for settings relevant only to the local environment.
Links
- DluPhpSettings - git repository on BitBucket
- Configuring PHP ini Settings in ZF2 - blog post about this module