mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 15:05:33 +00:00
Changed permission checks to check for the right things (merged from 2.0.2 branch, r37922)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@40479 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a30689cc72
commit
4e0fdcb5cf
24
install.php
24
install.php
@ -7,7 +7,6 @@
|
||||
|
||||
ini_set('max_execution_time', 300);
|
||||
|
||||
|
||||
// Load database config
|
||||
if(isset($_REQUEST['mysql'])) {
|
||||
$databaseConfig = $_REQUEST['mysql'];
|
||||
@ -20,7 +19,7 @@ if(isset($_REQUEST['mysql'])) {
|
||||
);
|
||||
}
|
||||
|
||||
$alreadyInstalled = (file_exists('assets') || file_exists('mysite/_config.php'));
|
||||
$alreadyInstalled = (file_exists('mysite/_config.php') || file_exists('tutorial/_config.php'));
|
||||
|
||||
if(file_exists('sapphire/silverstripe_version')) {
|
||||
$sapphireVersionFile = file_get_contents('sapphire/silverstripe_version');
|
||||
@ -38,7 +37,9 @@ if(file_exists('sapphire/silverstripe_version')) {
|
||||
$req = new InstallRequirements();
|
||||
$req->check();
|
||||
|
||||
if($req->hasErrors()) $hasErrorOtherThanDatabase = true;
|
||||
if($req->hasErrors()) {
|
||||
$hasErrorOtherThanDatabase = true;
|
||||
}
|
||||
|
||||
if($databaseConfig) {
|
||||
$dbReq = new InstallRequirements();
|
||||
@ -108,17 +109,15 @@ class InstallRequirements {
|
||||
$this->requireFile('sapphire', array("File permissions", "sapphire/ folder exists", "There's no sapphire folder."));
|
||||
$this->requireFile('cms', array("File permissions", "cms/ folder exists", "There's no cms folder."));
|
||||
$this->requireFile('jsparty', array("File permissions", "jsparty/ folder exists", "There's no jsparty folder."));
|
||||
$this->requireWriteable('.', array("File permissions", "Is the base folder writeable?", null));
|
||||
$this->requireWriteable('mysite', array("File permissions", "Is the mysite /folder writeable?", null));
|
||||
$this->requireWriteable('.htaccess', array("File permissions", "Is the .htaccess file writeable?", null));
|
||||
$this->requireWriteable('mysite', array("File permissions", "Is the mysite/ folder writeable?", null));
|
||||
$this->requireWriteable('tutorial', array("File permissions", "Is the tutorial/ folder writeable?", null));
|
||||
$this->requireWriteable('assets', array("File permissions", "Is the assets/ folder writeable?", null));
|
||||
|
||||
if(!is_writeable(dirname(tempnam('adfadsfdas','')))) {
|
||||
$this->error(array("File permissions", "Is the temporary folder writeable?", "The temporary folder isn't writeable!"));
|
||||
}
|
||||
|
||||
// Check that there's no stray files to get in the way
|
||||
//$this->moveFileOutOfTheWay('.htaccess', "Please remove the current .htaccess file.");
|
||||
//$this->moveFileOutOfTheWay('mysite/_config.php', "Please remove the current mysite/_config.php file.");
|
||||
|
||||
|
||||
// Check for rewriting
|
||||
|
||||
$webserver = strip_tags(trim($_SERVER['SERVER_SIGNATURE']));
|
||||
@ -476,11 +475,6 @@ class Installer extends InstallRequirements {
|
||||
<?
|
||||
flush();
|
||||
|
||||
echo "<li>Creating 'assets' folder...</li>";
|
||||
flush();
|
||||
|
||||
$this->makeFolder('assets');
|
||||
|
||||
// Write the config file
|
||||
|
||||
$template = $_POST['template'] == 'tutorial' ? 'tutorial' : 'mysite';
|
||||
|
Loading…
x
Reference in New Issue
Block a user