Task #3567

Define FLOW3_SAPITYPE constant in bootstrap

Added by Bastian Waidelich over 12 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority:
Could have
Assignee:
-
Category:
Environment
Target version:
-
Start date:
2009-06-04
Due date:
% Done:

100%

Estimated time:
Sprint:
PHP Version:
Has patch:
Complexity:

Description

IMO global constants are as bad as global variables. So I'm happy there are only 4 constants needed yet in FLOW3.
They're all defined in FLOW3-bootstrap - except FLOW3_SAPITYPE, that's defined in the constructor of F3\FLOW3\Utility\Environment if it hasn't been defined before.
Attached patch fixes this. But maybe \F3\FLOW3\Utility\Environment::getSAPIType() could be a static method too so we wouldn't need to instantiate it at all and could move the Constant-definition up to the other three defines()...


Files

FLOW3_define_constants_in_bootstrap.patch (936 Bytes) FLOW3_define_constants_in_bootstrap.patch Bastian Waidelich, 2009-06-04 19:26
FLOW3_define_FLOW3_SAPITYPE_constant_in_bootstrap_v2.patch (995 Bytes) FLOW3_define_FLOW3_SAPITYPE_constant_in_bootstrap_v2.patch The previous patch did not take into account that bootstrap might be called several times (e.g. in Testing package). This version checks whether constant has been defined already. Bastian Waidelich, 2009-06-15 12:31
#1

Updated by Karsten Dambekalns over 12 years ago

  • Subject changed from define constants in bootstrap to Define FLOW3_SAPITYPE constant in bootstrap
  • Category set to Environment

When working on #3544 I had a similar thought... To me it sounds reasonable.

#3

Updated by Robert Lemke about 12 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset r3107.

Also available in: Atom PDF