BUGFIX: If sapphire hasn't been installed as subdirectory, give error message rather than erroring out with a 500 or a php error

This commit is contained in:
Hamish Friedlander 2011-10-29 15:53:06 +13:00
parent c7b6eab151
commit d5723f7b0e
3 changed files with 50 additions and 2 deletions

View File

@ -23,6 +23,11 @@ ErrorDocument 500 /assets/error-500.html
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1 [QSA,L]
RewriteRule .* sapphire/main.php?url=%1 [QSA]
RewriteCond %{REQUEST_URI} ^(.*)/sapphire/main.php$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . %1/install.php? [R,L]
</IfModule>
### SILVERSTRIPE END ###

View File

@ -0,0 +1,42 @@
<html>
<head>
<title>The sapphire module is missing</title>
<link rel="stylesheet" type="text/css" href="themes/blackcandy/css/layout.css" />
<link rel="stylesheet" type="text/css" href="themes/blackcandy/css/typography.css" />
<link rel="stylesheet" type="text/css" href="themes/blackcandy/css/form.css" />
<link rel="stylesheet" type="text/css" href="sapphire/dev/install/install.css" />
</head>
<body>
<div id="BgContainer">
<div id="Container">
<div id="Header">
<h1>SilverStripe CMS Installation</h1>
</div>
<div id="Navigation">&nbsp;</div>
<div class="clear"><!-- --></div>
<div id="Layout">
<div class="typography">
<h1>The sapphire module is missing</h1>
<h2>To run the installer, at least the sapphire module and the blackcandy theme are required</h2>
<p>If you downloaded a pre-packaged zip or tar.gz, something might have gone wrong with the packaging
process. Please try re-downloading, or try an older version</p>
<p>If you downloaded this from github, you need to install the sapphire and blackcandy code bases
in subdirectories of this directory. You can do this manually, or by running the tools/new-project
script from the command line</p>
</div>
</div>
<div class="clear"><!-- --></div>
</div>
<div id="Footer">
<div class="footerTop"><!-- --></div>
<p><a href="http://silverstripe.org">SilverStripe Open Source CMS</a> | Copyright &copy; 2008-2011 SilverStripe Limited</p>
</div>
</div>
</body>
</html>

View File

@ -9,4 +9,5 @@
************************************************************************************
************************************************************************************/
include('./sapphire/dev/install/install.php');
if (!file_exists('sapphire') || !file_exists('sapphire/_config.php')) include "install-sapphiremissing.html";
else include('./sapphire/dev/install/install.php');