ZF2 doesn't have an in-built concept of different environments. By default the 'global' config files are checked in to source control but the 'local' configs are not. So the idea is most of your configuration is in the global files, but environment-specific config goes in the local files.
Let's say your cache.local.php
config contains env-specific stuff like paths. If so, you would have this file on production, staging and development; but its contents would be different.
If you really want to stick with the ZF1 way, and want your environment-specific config in source control, this can easily be achieved too. See this blog post: http://blog.evan.pro/environment-specific-configuration-in-zend-framework-2 . You'll need to define the APPLICATION_ENV
constant for this to work (you can cut'n'paste the line from your question ininto public/index.php
).