laminas/laminas-development-mode

Is there a way to check for development mode in code, php code

weierophinney opened this issue · 2 comments

How to check if the development mode is enabled or not in code


Originally posted by @waqarprojectinertia at zfcampus/zf-development-mode#28

@waqarprojectinertia Enabling development mode copy files:

  • config/development.config.php.dist to config/development.config.php
  • config/autoload/development.local.php.dist to config/autoload/development.local.php

so if you want to check it in code, please check if you have these files. It means you have enabled development mode.

You can also check status of development mode using console command:

$ ./vendor/bin/zf-development-mode status

Originally posted by @michalbundyra at zfcampus/zf-development-mode#28 (comment)

Via code, you can check with :

var_dump((file_exists(\Laminas\DevelopmentMode\Status::DEVEL_CONFIG)));