1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* @link http://github.com/zfcampus/zf-development-mode for the canonical source repository
* @copyright Copyright (c) 2014-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace ZF\DevelopmentMode;
class Help
{
/**
* @var string
*/
private $message = <<< EOH
Enable/Disable development mode.
Usage:
development-mode [-h|--help] disable|enable|status
--help|-h Print this usage message.
disable Disable development mode.
enable Enable development mode
(do not use in production).
status Determine if development mode is currently
enabled.
auto-composer Enable or disable development mode based on
the environment variable COMPOSER_DEV_MODE.
If the variable is not found, the mode is
untouched. If set to something other than "0",
it's enabled.
To enable development mode, the following file MUST exist:
- config/development.config.php.dist; this file will be copied to
config/development.config.php
Optionally:
- config/autoload/development.local.php.dist; this file will be copied to
config/autoload/development.local.php
When disabling development mode:
- config/development.config.php will be removed if it exists
- config/autoload/development.local.php will be removed if it exists
Additionally, both when disabling and enabling development mode, the
script will remove the file cache/module-config-cache.php (or the file
specified by the combination of the module_listener_options.cache_dir
and module_listener_options.config_cache_key options).
EOH;
/**
* Emit the help message.
*
* @param null|resource $stream Defaults to STDOUT
*/
public function __invoke($stream = null)
{
if (! is_resource($stream)) {
echo $this->message;
return;
}
fwrite($stream, $this->message);
}
}