1 | <?php |
||
15 | class MultiDomain extends Object |
||
16 | { |
||
17 | /** |
||
18 | * The key for the "primary" domain |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | const KEY_PRIMARY = 'primary'; |
||
23 | |||
24 | /** |
||
25 | * Given a url, get the domain that maps to it, e.g. |
||
26 | * |
||
27 | * /company/ -> silverstripe.com |
||
28 | * /company/partners -> silverstripe.com |
||
29 | * /community/forum -> silverstripe.org |
||
30 | * |
||
31 | * @param string $url |
||
32 | * @return MultiDomainDomain |
||
33 | */ |
||
34 | public static function domain_for_url($url) |
||
46 | |||
47 | /** |
||
48 | * Gets all the domains that have been configured |
||
49 | * |
||
50 | * @param boolean $includePrimary If true, include the primary domain |
||
51 | * @return array |
||
52 | */ |
||
53 | public static function get_all_domains($includePrimary = false) |
||
66 | |||
67 | /** |
||
68 | * Gets the domain marked as "primary" |
||
69 | * @return MultiDomainDomain |
||
70 | */ |
||
71 | public static function get_primary_domain() |
||
75 | |||
76 | /** |
||
77 | * Gets a domain by its key, e.g. 'org','com' |
||
78 | * @param string $domain |
||
79 | * @return MultiDomainDomain |
||
80 | */ |
||
81 | public static function get_domain($domain) |
||
90 | } |
||
91 |