-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclass-urls.php
39 lines (34 loc) · 851 Bytes
/
class-urls.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
39
<?php
/**
* Urls class.
*
* @package Contextly Related Links
* @link https://contextly.com
*/
/**
* Class Urls
*/
class Urls {
const MODE_LOCAL = 'local';
const MODE_DEV = 'dev';
const MODE_LIVE = 'live';
/**
* Get Main server url from config file
*
* @return null|string
* @throws ContextlyKitException In case if server identifier is not exists in config.
*/
public static function get_main_server_url() {
return ContextlyWpKit::getInstance()->getServerUrl( 'cp' );
}
/**
* Get WP plugin assets url from config
*
* @param string $file file name.
* @param string $type file type.
* @return string asset URL in Contextly CDN
*/
public static function get_plugin_cdn_url( $file, $type = 'js' ) {
return 'https://assets.context.ly/wp-plugin/' . CONTEXTLY_PLUGIN_VERSION . '/' . $type . '/' . $file;
}
}