On Tue, Jan 25, 2022 at 5:11 PM Rowan Tommins
wrote:
> On 25/01/2022 19:44, Chase Peeler wrote:
> > If we start throwing exceptions, which can't be suppressed, it will make
> > this much more difficult to read since the constants.php will have to be
> > updated:
> >
> > if(!defined('dbserver')){
On 25/01/2022 19:44, Chase Peeler wrote:
If we start throwing exceptions, which can't be suppressed, it will make
this much more difficult to read since the constants.php will have to be
updated:
if(!defined('dbserver')){
define('dbserver','productiondb.example.com');
}
if(!defined('othercons
On Tue, Jan 25, 2022 at 9:45 PM Chase Peeler wrote:
> it will make this much more difficult to read since the constants.php will
> have to be
> updated:
>
> if(!defined('dbserver')){
> define('dbserver','productiondb.example.com');
> }
> if(!defined('otherconstant')){
>define('otherconstan
On Tue, Jan 25, 2022 at 3:08 PM Kamil Tekiela wrote:
> A constant is a value that, unlike a variable, cannot be reassociated with
> a different value. A properly written software should never redefine
> constants. The possibility of redefining constants in PHP should be
> considered a bug rather
A constant is a value that, unlike a variable, cannot be reassociated with
a different value. A properly written software should never redefine
constants. The possibility of redefining constants in PHP should be
considered a bug rather than a feature.
Constants are not good for configuration values
We have a main "constants.php" file that resides in git. The first line of
constants.php includes local_constants.php, which is kept out of git. The
idea is that we can "override" any of the constants on a per server basis.
constants.php:
@define('dbserver','productiondb.example.com');
local_cons
Internals,
While cleaning up some PRs I was prompted to re-visit one I had
outstanding about exception-throwing behaviour when redefining
constants, this applies to functions like define and language syntax
constructs such as const.
There have been a few discussions in the past about the top