Ratings | | Unique User Downloads | | Download Rankings |
Not enough user ratings | | Total: 152 | | All time: 9,015 This week: 491 |
|
Description | | Author Gavin G Gordon
Contributor
|
This class can dynamically define PHP constant values.
It can set one or more values for constants and generates a PHP script that will load those values and set them as constants before they are needed. | |
 |
|
Innovation award
 Nominee: 5x |
|
Details
Predefiner

Description
This class (GGG\Config\Predefiner) is a simple package to quickly and dynamically set PHP constants.
Usage
Installation
composer require gavinggordon/predefiner
Examples
Instantiation:
include_once( __DIR__ . '/vendor/autoload.php' );
$predefiner = new \GGG\Config\Predefiner();
Setting:
$predefiner->set( ['API_KEY' => 'abc123def456hij789klm0'] );
Initializing:
$predefiner->init();
echo API_KEY;
// Result: 'abc123def456hij789klm0';
Issues
If you have any issues at all, please post your findings in the issues page at https://github.com/gavinggordon/predefiner/issues.
License
This package utilizes the MIT License.
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.
|
Other classes that need this package |
|
Class |
Why it is needed |
Dependency |
PHP Constant Groups |
It is required, in order to dynamically set definitions for keywords used as constants. |
Required |