mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Added /SapphireInfo URL with some basic version information
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@50452 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
db1932b57c
commit
a0fb07d8ba
@ -4,8 +4,26 @@
|
||||
* Returns information about the current site instance.
|
||||
*/
|
||||
class SapphireInfo extends Controller {
|
||||
function baseurl() {
|
||||
return Director::absoluteBaseUrl() . "\n";
|
||||
function Version() {
|
||||
$sapphireVersionFile = file_get_contents('../sapphire/silverstripe_version');
|
||||
|
||||
if(strstr($sapphireVersionFile, "/sapphire/trunk")) {
|
||||
$sapphireVersion = "trunk";
|
||||
} else {
|
||||
preg_match("/sapphire\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $sapphireVersionFile, $matches);
|
||||
$sapphireVersion = $matches[1];
|
||||
}
|
||||
|
||||
return $sapphireVersion;
|
||||
}
|
||||
|
||||
function EnvironmentType() {
|
||||
if(Director::isLive()) return "live";
|
||||
else if(Director::isTest()) return "test";
|
||||
else return "dev";
|
||||
}
|
||||
|
||||
function BaseURL() {
|
||||
return Director::absoluteBaseURL();
|
||||
}
|
||||
}
|
15
templates/SapphireInfo.ss
Normal file
15
templates/SapphireInfo.ss
Normal file
@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Sapphire Application Information</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Sapphire Application Information</h1>
|
||||
|
||||
<dl>
|
||||
<dt>Sapphire version:</dt> <dd>$Version</dd>
|
||||
<dt>Environment type:</dt> <dd>$EnvironmentType</dd>
|
||||
<dt>Site URL:</dt> <dd>$BaseURL</dd>
|
||||
</dl>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user