Source Guardian Docs: Custom Predefined Constants (Section 4.2.6)


Custom key/value data called constants can be added to license files and read via the Loader API at runtime. This feature might be used to customise product behaviour based on information read from the license file.

In your software, you would use the "sg_get_const()" function (defined in the Source Guardian encoder) (Section 7.3) to check whether a constant exists and if it matches a certain criteria, do the appropriate action.

Example:

<?php
if (sg_get_const('key') == 'value') {
// do something
}
?>

You can have as many key/value constant pairs as you need. If you require a visitor to enter a value for a key, such as a product key, leave the value blank and set the field option to 'Yes'.

Note that constant keys should contain alphanumeric characters ONLY, and no spaces.

To validate user input for custom constants see the 'Field Validation' link in the menu.

Source Guardian Command Line Reference:
--const