forked from amareshjoshi/orcid-data-block
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.php
38 lines (29 loc) · 843 Bytes
/
init.php
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
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Orcid Data Block
*
* @package OrcidDataBlock
*/
declare(strict_types=1);
namespace MESH\OrcidDataBlock;
use MESH\OrcidDataBlock\Cache\WPTransientCache;
use MESH\OrcidDataBlock\Client\OrcidClient;
use MESH\OrcidDataBlock\Formatter\XslFormatter;
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
if (!defined('ORCID_DATA_BLOCK_DIR')) {
define('ORCID_DATA_BLOCK_DIR', plugin_dir_path(__FILE__));
}
if (!defined('ORCID_DATA_BLOCK_URL')) {
define('ORCID_DATA_BLOCK_URL', plugin_dir_url(__FILE__));
}
if (!defined('ORCID_DATA_BLOCK_FILE')) {
define('ORCID_DATA_BLOCK_FILE', __FILE__);
}
require_once __DIR__ . '/lib/autoload.php';
OrcidDataBlock::boot(
new OrcidClient(new WPTransientCache(24 * 60 * 60 * 1)),
new XslFormatter(ORCID_DATA_BLOCK_DIR . 'orcid-data-all.xsl')
);