mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-26 16:37:18 +02:00
checkin (broken)
This commit is contained in:
parent
a01abba787
commit
06fec5daf7
21 changed files with 2025 additions and 376 deletions
|
@ -75,10 +75,47 @@ class CRM_Contactcats_ExtensionUtil {
|
|||
return self::CLASS_PREFIX . '_' . str_replace('\\', '_', $suffix);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \CiviMix\Schema\SchemaHelperInterface
|
||||
*/
|
||||
public static function schema() {
|
||||
if (!isset($GLOBALS['CiviMixSchema'])) {
|
||||
pathload()->loadPackage('civimix-schema@5', TRUE);
|
||||
}
|
||||
return $GLOBALS['CiviMixSchema']->getHelper(static::LONG_NAME);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
use CRM_Contactcats_ExtensionUtil as E;
|
||||
|
||||
($GLOBALS['_PathLoad'][0] ?? require __DIR__ . '/mixin/lib/pathload-0.php');
|
||||
pathload()->addSearchDir(__DIR__ . '/mixin/lib');
|
||||
spl_autoload_register('_contactcats_civix_class_loader', TRUE, TRUE);
|
||||
|
||||
function _contactcats_civix_class_loader($class) {
|
||||
if ($class === 'CRM_Contactcats_DAO_Base') {
|
||||
if (version_compare(CRM_Utils_System::version(), '5.74.beta', '>=')) {
|
||||
class_alias('CRM_Core_DAO_Base', 'CRM_Contactcats_DAO_Base');
|
||||
// ^^ Materialize concrete names -- encourage IDE's to pick up on this association.
|
||||
}
|
||||
else {
|
||||
$realClass = 'CiviMix\\Schema\\Contactcats\\DAO';
|
||||
class_alias($realClass, $class);
|
||||
// ^^ Abstract names -- discourage IDE's from picking up on this association.
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// This allows us to tap-in to the installation process (without incurring real file-reads on typical requests).
|
||||
if (strpos($class, 'CiviMix\\Schema\\Contactcats\\') === 0) {
|
||||
// civimix-schema@5 is designed for backported use in download/activation workflows,
|
||||
// where new revisions may become dynamically available.
|
||||
pathload()->loadPackage('civimix-schema@5', TRUE);
|
||||
CiviMix\Schema\loadClass($class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (Delegated) Implements hook_civicrm_config().
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue