Download .zip |
Info | Documentation | View files (13) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2017-02-23 (4 days ago) | Not yet rated by the users | Total: Not yet counted | Not yet ranked |
Version | License | PHP version | Categories | |||
constantgroups 1.0.0 | MIT/X Consortium ... | 5 | PHP 5, Utilities and Tools, Language, C... |
Description | Author | |
This class can be used to define groups of constant values from arrays. |
A PHP class which provides quick as-needed access to pre- and user defined data via constants.
The following dependencies will be automatically installed, if not already, when installing via composer:
composer require gavinggordon/constantgroups
include_once( __DIR__ . '/vendor/autoload.php' );
$constantgroups = new \GGG\Config\ConstantGroups();
Use as many or as few ConstantGroups as you want...
$constantgroups->set( ['hexcolours', 'rgbcolours', 'rgbacolours'] );
$constantgroups->init();
echo HEX_ORANGE;
// Result: #FF8000
echo RGB_ORANGE;
// Result: rgba( 255, 128, 0 )
echo RGBA_ORANGE;
// Result: rgba( 255, 128, 0, 1.0 )
Create your own named ConstantGroups...
use \GGG\Config\ConstantGroups as ConstantGroups;
use \GGG\Config\ConstantGroupCreator as ConstantGroupCreator;
$myconstantsgroup = [
'my application name' => 'testapp',
'application version' => '1.4.5',
'apphomedir' => dirname( __DIR__ )
];
$constantgroupcreator = new ConstantGroupCreator( $myconstantsgroup );
ConstantGroups::create( $constantgroupcreator, 'AppData' );
$constantgroups = new ConstantGroups();
$constantgroups->set( ['hexcolours', 'appdata'] );
$constantgroups->init();
echo MY_APPLICATION_NAME;
// Result: testapp
If you have any issues at all, please post your findings in the issues page at https://github.com/gavinggordon/constantgroups/issues.
This package utilizes the MIT License.
Files |
File | Role | Description | ||
---|---|---|---|---|
src (2 files, 1 directory) | ||||
composer.json | Data | Auxiliary data | ||
LICENSE.txt | Doc. | Documentation | ||
README.md | Doc. | Documentation |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
Groups (8 files) | ||||
ConstantGroupCreator.php | Class | Class source | ||
ConstantGroups.php | Class | Class source |
Files | / | src | / | Groups |
File | Role | Description |
---|---|---|
GradientStylesConstantGroup.php | Class | Class source |
gradient_style_data.json | Data | Auxiliary data |
HexColoursConstantGroup.php | Class | Class source |
hex_colour_data.json | Data | Auxiliary data |
RgbaColoursConstantGroup.php | Class | Class source |
rgba_colour_data.json | Data | Auxiliary data |
RgbColoursConstantGroup.php | Class | Class source |
rgb_colour_data.json | Data | Auxiliary data |
constantgroups-2017-02-23.zip 22KB | |
constantgroups-2017-02-23.tar.gz | |
Install with Composer |
Needed packages | ||
Class | Download | Why it is needed | Dependency |
---|---|---|---|
Predefiner | .zip .tar.gz | It is required, in order to dynamically set definitions for keywords used as constants. | Required |
Version Control | Unique User Downloads | |||||||
100% |
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Related pages |
GitHub - ConstantGroups GitHub page for ConstantGroups |
GitHub - Predefiner GitHub page for Predefiner, a dependency of ConstantGroups |