Task #3567

Define FLOW3_SAPITYPE constant in bootstrap

Added by Bastian Waidelich about 6 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2009-06-04
Priority:Could have Due date:
Assigned To:- % Done:

100%

Category:Environment
Target version:-
Sprint: Has patch:
PHP Version: 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()...

FLOW3_define_constants_in_bootstrap.patch Magnifier (936 Bytes) Bastian Waidelich, 2009-06-04 19:26

FLOW3_define_FLOW3_SAPITYPE_constant_in_bootstrap_v2.patch Magnifier - 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. (995 Bytes) Bastian Waidelich, 2009-06-15 12:31

Associated revisions

Revision 2cda63f5
Added by Robert Lemke almost 6 years ago

[+FEATURE] FLOW3 (AOP): Parse errors in AOP proxy code (introduced by a potential bug) will now be treated properly by throwing a meaningful exception.
[-FEATURE] FLOW3 (Configuration): Removed support for PHP-based configuration files. This caused a lot of overhead and in practice we want everyone to use YAML files anyway.
[+FEATURE] FLOW3 (Configuration): Implemented support for cached ("compiled") configuration. When the new FLOW3.yaml option "configuration: comileConfigurationFiles" is turned on, all configuration will be compiled into a PHP file which from then on is read instead of parsing the YAML files everytime. Please see the updated documentation for more information. Resolves #4460
[~TASK] FLOW3 (Configuration): Completely refactored the Configuration Manager and a few related classes. Its methods now each fullfil a clear purpose and work more effective. The method names now also better describe what each method is doing. Resolves #2711
[-TASK] FLOW3 (Configuration): Removed the WritableSourceInterface - this is now a standard feature of a configuration source.
[+TASK] FLOW3 (Core): Refactored and cleaned up the FLOW3 Bootstrap. Constants are now defined by a static method and all configuration related functionality has been moved to the Configuration sub package. Also replaced the evil die() calls by more handsome exit() calls. Relates to #2117
[+TASK] FLOW3 (Object): Moved some object initialization code from the Bootstrap to the Object Manager and further cleaned up the Object Manager's code. Wrote additional tests - now this class has 100% test coverage. Relates to #2117
[+API] FLOW3 (MVC): Added a few @api annotations to properties of the AbstractController and ActionController.
[-API] FLOW3 (Utility): Removed the getSAPIType() method from the Environment class. Just use the constant FLOW3_SAPITYPE instead. Resolves #3567 and relates to #2117.

Revision 89c28b46
Added by Robert Lemke almost 6 years ago

[+FEATURE] FLOW3 (AOP): Parse errors in AOP proxy code (introduced by a potential bug) will now be treated properly by throwing a meaningful exception.
[-FEATURE] FLOW3 (Configuration): Removed support for PHP-based configuration files. This caused a lot of overhead and in practice we want everyone to use YAML files anyway.
[+FEATURE] FLOW3 (Configuration): Implemented support for cached ("compiled") configuration. When the new FLOW3.yaml option "configuration: comileConfigurationFiles" is turned on, all configuration will be compiled into a PHP file which from then on is read instead of parsing the YAML files everytime. Please see the updated documentation for more information. Resolves #4460
[~TASK] FLOW3 (Configuration): Completely refactored the Configuration Manager and a few related classes. Its methods now each fullfil a clear purpose and work more effective. The method names now also better describe what each method is doing. Resolves #2711
[-TASK] FLOW3 (Configuration): Removed the WritableSourceInterface - this is now a standard feature of a configuration source.
[+TASK] FLOW3 (Core): Refactored and cleaned up the FLOW3 Bootstrap. Constants are now defined by a static method and all configuration related functionality has been moved to the Configuration sub package. Also replaced the evil die() calls by more handsome exit() calls. Relates to #2117
[+TASK] FLOW3 (Object): Moved some object initialization code from the Bootstrap to the Object Manager and further cleaned up the Object Manager's code. Wrote additional tests - now this class has 100% test coverage. Relates to #2117
[+API] FLOW3 (MVC): Added a few @api annotations to properties of the AbstractController and ActionController.
[-API] FLOW3 (Utility): Removed the getSAPIType() method from the Environment class. Just use the constant FLOW3_SAPITYPE instead. Resolves #3567 and relates to #2117.

History

#1 Updated by Karsten Dambekalns about 6 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 almost 6 years ago

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

Applied in changeset r3107.

Also available in: Atom PDF