Encapsulate PHP Constants in Class: Encapsulate several constants in the same class

Recommend this page to a friend!
  Info   Example   View files (6)   Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 175 All time: 8,560 This week: 242
Version License PHP version Categories
abstractconstants 1.0GNU General Publi...5PHP 5, Language
Description Author

This class can encapsulate several constants in the same class.

It provides a base class that can store constant values in class variable.

Applications should extend this class to allow retrieving all constants defined in an class as an array.

Innovation Award
PHP Programming Innovation award nominee
April 2019
Number 9
Many classes need to define constant values, so they can have meaningful names for the values that they need to use.

This package makes that task easier by providing a base class that assigns values to constants from an array defined in a sub-class that needs to use those constants.

Manuel Lemos
Picture of Steven Hoyt
  Performance   Level  
Name: Steven Hoyt <contact>
Classes: 2 packages by
Country: United States United States
Age: ???
All time rank: 3841457 in United States United States
Week rank: 771 80 in United States United States
Innovation award
Innovation award
Nominee: 1x

  Files  
File Role Description
test.php Example Test script (demonstrate usage)
application.class.php Class ApplicationClass (example caller class)
paths.class.php Class Paths (example extending class)
roles.class.php Class Roles (example extending class)
abstract.constants.class.php Class AbstractConstants
test.output.txt Output Sample output

 Version Control Unique User Downloads Download Rankings  
 0%
Total:175
This week:0
All time:8,560
This week:242

For more information send a message to info at phpclasses dot org.