Skip to content

Instantly share code, notes, and snippets.

@davereid
Created April 1, 2014 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davereid/bf8e8ca11eb4e5d38397 to your computer and use it in GitHub Desktop.
Save davereid/bf8e8ca11eb4e5d38397 to your computer and use it in GitHub Desktop.
name = Myprofile
core = 7.x
dependencies[] = xautoload
<?php
/**
* Implements hook_install_tasks().
*/
function myprofile_install_tasks(&$install_state) {
$tasks = array();
$tasks['myprofile_check_for_class'] = array();
return $tasks;
}
function myprofile_check_for_class() {
if (!class_exists('Isbn\Validation')) {
trigger_error('Class not found even after profile module was enabled.');
}
}
<?php
/**
* Implements hook_xautoload().
*/
function myprofile_xautoload($api) {
// Ensure the isbn library can be autoloaded.
$api->namespaceRoot('Isbn', DRUPAL_ROOT . '/sites/all/libraries/isbn/src', FALSE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment