mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 15:05:33 +00:00
Don't show open_basedir errors when curl can't access temp dir
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@42178 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
984d74e9b6
commit
ff8c56927c
@ -681,7 +681,7 @@ PHP
|
|||||||
function createFile($filename, $content) {
|
function createFile($filename, $content) {
|
||||||
$base = $this->getBaseDir();
|
$base = $this->getBaseDir();
|
||||||
|
|
||||||
if(($fh = fopen($base . $filename, 'w')) && fwrite($fh, $content) && fclose($fh)) {
|
if((@$fh = fopen($base . $filename, 'w')) && fwrite($fh, $content) && fclose($fh)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$this->error("Couldn't write to file $base$filename");
|
$this->error("Couldn't write to file $base$filename");
|
||||||
@ -817,6 +817,8 @@ TEXT
|
|||||||
if(function_exists('curl_init')) {
|
if(function_exists('curl_init')) {
|
||||||
$ch = curl_init($location);
|
$ch = curl_init($location);
|
||||||
$fp = @fopen(dirname(tempnam('adfadsfdas','')) . '/rewritetest', "w");
|
$fp = @fopen(dirname(tempnam('adfadsfdas','')) . '/rewritetest', "w");
|
||||||
|
|
||||||
|
if($fp) {
|
||||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
curl_setopt($ch, CURLOPT_FILE, $fp);
|
||||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||||
curl_exec($ch);
|
curl_exec($ch);
|
||||||
@ -828,6 +830,7 @@ TEXT
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,8 @@ function performModRewriteTest() {
|
|||||||
if(function_exists('curl_init')) {
|
if(function_exists('curl_init')) {
|
||||||
$ch = curl_init($location);
|
$ch = curl_init($location);
|
||||||
$fp = @fopen(dirname(tempnam('adfadsfdas','')) . '/rewritetest', "w");
|
$fp = @fopen(dirname(tempnam('adfadsfdas','')) . '/rewritetest', "w");
|
||||||
|
|
||||||
|
if($fp) {
|
||||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
curl_setopt($ch, CURLOPT_FILE, $fp);
|
||||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||||
curl_exec($ch);
|
curl_exec($ch);
|
||||||
@ -65,6 +67,7 @@ function performModRewriteTest() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user