This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 7605 - Replace global constants by class constants
Summary: Replace global constants by class constants
Status: NEW
Alias: None
Product: mobileOK authoring tools
Classification: Unclassified
Component: Transcoding (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Sylvain Lequeux
QA Contact: fd
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-14 08:38 UTC by fd
Modified: 2009-09-14 08:38 UTC (History)
0 users

See Also:


Attachments

Description fd 2009-09-14 08:38:26 UTC
Most transcoding actions rely and define a few global constants, typically:

 define('DEFAULT_MOBILE_DEVICE_NAME', 'is_wireless_device');
 define('DEFAULT_MOBILE_DEVICE_NAMESPACE', TranscodingAction::$WURFL_VOCABULARY);
 define('DEFAULT_MOBILE_DEVICE_ASPECT', '__NULL');
 define('DEFAULT_MOBILE_DEVICE', true);

Things at the common library level should not define and/or rely on global constants being defined because there is no way to ensure unique names will be used, and that, e.g. the library won't be used in a project where DEFAULT_PERCENT means something completely different from its meaning for TranscodingActionPagination.

Global constants should be replaced by class constants everywhere (I think they work starting with PHP5, but that may need to be confirmed):
 http://fr2.php.net/manual/en/language.oop5.constants.php