I think this may be the way to go.

Basically, create a hook which allows people to specify a class to load instead of 'license'. This would allow people to create a child class of license with more information or modified access methods.

CommentFileSizeAuthor
#1 licensing.656770-1.patch7.96 KBnicksanta

Comments

nicksanta’s picture

Status: Active » Fixed
StatusFileSize
new7.96 KB

I've decided to roll with this, I'm not 100% sure this is the best way to implement the feature, but it's a good start.

Now you can specify a custom class to load in place of the 'license' class. See the following example from hooks.php

<?php
/**
 * If you wish to override what class is loaded in place of the default 'license' class, read this.
 *
 * As you can see at the top of licensing.module
 *
 * // Allow other modules to specify which class to load, they should be child
 * // classes of license though.
 * define('LICENSING_CLASS', variable_get('licensing_class', 'license'));
 *
 * Simply by doing a variable_set in your module's hook_enable (and removing it in hook_disable), 
 * you can use your own child class in place of the license class. See this example:
 */
function hook_enable() {
  variable_set('licensing_class', 'custom_class');
}

// Be sure to delete the variable when the module is disabled
function hook_disable() {
  variable_del('licensing_class');
}
?>

I'm going to mark as 'fixed', but anyone feel free to submit patches for a better solution.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.