Optional reporting of versions to SilverStripe

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@42412 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
aoneil 2007-09-21 04:50:50 +00:00
parent ab17337b75
commit b716e29743
3 changed files with 34 additions and 1 deletions

View File

@ -77,6 +77,10 @@ input.text, textarea, select {
font-size: 1.2em;
font-weight: bold;
width: 305px;
}
#stats {
float: left;
margin: 5px;
}
table.testResults {
border-collapse: collapse;

View File

@ -56,6 +56,8 @@
</ul>
<p>You can change the template or download another from the SilverStripe website after installation.</p>
<input type="checkbox" id="stats" name="stats" checked="checked"><label for="stats">Send information on my webserver to SilverStripe (this is only version information, used for statistical purposes)</label><br />
<?php if($alreadyInstalled) { ?>
<p class="warning">

View File

@ -519,7 +519,34 @@ class Installer extends InstallRequirements {
<p>I am now running through the installation steps (this should take about 30 seconds)</p>
<p>If you receive a fatal error, refresh this page to continue the installation
<?php
flush();
flush();
if(isset($_POST['stats'])) {
if(file_exists('sapphire/silverstripe_version')) {
$sapphireVersionFile = file_get_contents('sapphire/silverstripe_version');
if(strstr($sapphireVersionFile, "/sapphire/trunk")) {
$silverstripe_version = "trunk";
} else {
preg_match("/sapphire\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $sapphireVersionFile, $matches);
$silverstripe_version = $matches[1];
}
} else {
$silverstripe_version = "unknown";
}
$phpVersion = urlencode(phpversion());
$conn = @mysql_connect($config['mysql']['server'], null, null);
$databaseVersion = urlencode('MySQL ' . mysql_get_server_info());
$webserver = urlencode($_SERVER['SERVER_SOFTWARE']);
$url = "http://ss2stat.silverstripe.com/Installation/add?SilverStripe=$silverstripe_version&PHP=$phpVersion&Database=$databaseVersion&WebServer=$webserver";
if(isset($_SESSION['StatsID']) && $_SESSION['StatsID']) {
$url .= '&ID=' . $_SESSION['StatsID'];
}
@$_SESSION['StatsID'] = file_get_contents($url);
}
// Delete old _config.php files
if(file_exists('tutorial/_config.php')) {