PHP Classes

Predefiner: Dynamically define PHP constant values

Recommend this page to a friend!
  Info   View files Documentation   View files View files (10)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 146 All time: 8,991 This week: 177Up
Version License PHP version Categories
predefiner 1.0.1MIT/X Consortium ...5.4PHP 5, Utilities and Tools, Text proc..., C..., C...
Description Author

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.

Picture of Gavin Gordon Markowski
  Performance   Level  
Name: Gavin Gordon Markowski <contact>
Classes: 11 packages by
Country: Canada Canada
Age: 33
All time rank: 189346 in Canada Canada
Week rank: 895 Up20 in Canada Canada Up
Innovation award
Innovation award
Nominee: 4x



Build Status Packagist Version Github Release Usage License


This class (GGG\Config\Predefiner) is a simple package to quickly and dynamically set PHP constants.



	composer require gavinggordon/predefiner



	include_once( __DIR__ . '/vendor/autoload.php' );
	$predefiner = new \GGG\Config\Predefiner();


	$predefiner->set( ['API_KEY' => 'abc123def456hij789klm0'] );


	echo API_KEY;
	// Result: 'abc123def456hij789klm0';


If you have any issues at all, please post your findings in the issues page at


This package utilizes the MIT License.

  Files folder image Files  
File Role Description
Files folder imageconfig (2 files)
Files folder imagesrc (1 file)
Files folder imagetests (1 file)
Plain text file .scrutinizer.yml Data scrutinizer
Plain text file .travis.yml Data
Plain text file composer.json Data composer file
Plain text file LICENSE.txt Doc. Documentation
Plain text file phpunit.xml Data phpunit file
Plain text file Doc. info and examples

  Files folder image Files  /  config  
File Role Description
  Plain text file user_app_config.php Aux. user config values
  Plain text file user_app_configTemplate.php Aux. base config values template file

  Files folder image Files  /  src  
File Role Description
  Plain text file Predefiner.php Class main class file

  Files folder image Files  /  tests  
File Role Description
  Plain text file PredefinerTest.php Test main class test file

 Version Control Reuses Unique User Downloads Download Rankings  
This week:0
All time:8,991
This week:177Up
For more information send a message to info at phpclasses dot org.