forked from jaredfhealy/extrabuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
27 lines (23 loc) · 741 Bytes
/
Copy pathbootstrap.php
File metadata and controls
27 lines (23 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
/**
* @var \MODX\Revolution\modX $modx
* @var array $namespace
*/
use ExtraBuilder\ExtraBuilder;
use xPDO\xPDO;
// Add the service
try {
// Add the package and model classes
$modx->addPackage('ExtraBuilder\Model', $namespace['path'] . 'src/', null, 'ExtraBuilder\\');
if (class_exists('ExtraBuilder\\ExtraBuilder')) {
$modx->services->add('ExtraBuilder', function($c) use ($modx) {
return new ExtraBuilder($modx);
});
}
else {
$modx->log(xPDO::LOG_LEVEL_ERROR, "Class ExtraBuilder\\ExtraBuilder does not exist.".print_r($loader->getPrefixesPsr4(), true));
}
}
catch (\Exception $e) {
$modx->log(xPDO::LOG_LEVEL_ERROR, $e->getMessage());
}