2009年10月28日星期三

Re: [fw-mvc] how to use APPLICATION_ENV

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hector Virgen wrote:
> The default error.phtml created by zf.sh tests the APPLICATION_ENV
> constant to determine if exception information should be displayed. If
> it's set to "development", then exception information is displayed. Is
> there a better way for it to determine this without using the constant?

Ah, true.
Personally, I don't like checking for a specific environment, but would
rather check for a configuration directive.

eg. I would add a "debug" configuration option to the development
environment config and check for that.

That way, you could add it to other environments, or remove it from that
environment without editing the code. Basically, I try not to depend on
the constant for anything.

Having said that, this is just my opinion, and since it's used in the
error page, somebody apparently disagrees :)


- --

Brenton Alker
PHP Developer - Brisbane, Australia

http://blog.tekerson.com/
http://twitter.com/tekerson

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkro33EACgkQ7bkAtAithuvPrwCgzk2F+EDSyZho0zlvriIh968f
hLQAn0LDjzbFBW0dS/Hwf20SrdZtDZlq
=ZY8h
-----END PGP SIGNATURE-----

没有评论: