add cms, add todo
[ssproject1617.git] / testcms-final-anon / upgrade / index.php
1 <!doctype html>
2 <html lang="en-gb">
3 <head>
4 <meta charset="utf-8">
5 <title>Upgrade Test CMS</title>
6 <mate name="robots" content="noindex, nofollow">
7 <link rel="stylesheet" href="assets/css/app.css">
8 </head>
9 <body>
10
11 <h1><img src="assets/img/logo.gif" alt="Test CMS install logo"></h1>
12
13 <?php
14
15 $errors = array();
16
17 if(file_exists('../config.php') === false) {
18 $errors[] = 'Please run the install';
19 } else {
20 // note: on win the only way to really test is to try and write a new file to disk.
21 if(@file_put_contents('../test.php', '<?php //test') === false) {
22 $errors[] = 'It looks like the root directory is not writable, Please make the root directory writable until the upgrade is complete.';
23 } else {
24 unlink('../test.php');
25 }
26 }
27
28 ?>
29
30 <?php if(count($errors)): ?>
31
32 <div class="content">
33 <h2>Woops.</h2>
34
35 <p>Looks like we've hit a problem.</p>
36
37 <ul>
38 <?php foreach($errors as $error): ?>
39 <li><?php echo $error; ?></li>
40 <?php endforeach; ?>
41 </ul>
42
43 <p><a href="index.php" class="button" style="float: none; display: inline-block;">Ok ive fixed these, start migration</a></p>
44 </div>
45
46 <?php else: ?>
47
48 <div class="content">
49 <h2>Upgrading Test CMS.</h2>
50
51 <p>Thank you for downloading the latest version of Test CMS.
52 To get you up and running we need to make a few changes to bring you up to date.</p>
53
54 <form action="run.php" method="post">
55 <button type="submit">Start migration</button>
56 </form>
57 </div>
58
59 <?php endif; ?>
60
61 </body>
62 </html>