3 * Check if all is setup correctly
6 header('HTTP/1.0 500 Internal Server Error');
8 $reqWritePermissions = false;
9 require_once 'www-header.php';
11 if (!$GLOBALS['phorkie']['cfg']['setupcheck']) {
12 header('HTTP/1.0 403 Forbidden');
13 header('Content-type: text/plain');
14 echo "Setup check is disabled\n";
18 $messages = SetupCheck::run();
20 foreach ($messages as $arMessage) {
21 list($type, $message) = $arMessage;
22 $type == 'error' && ++$errors;
25 header('HTTP/1.0 200 OK');
27 header('Content-type: text/html');
30 $messages[] = array('ok', 'All fine');
34 <?xml version="1.0" encoding="utf-8"?>
35 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
36 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
38 <title>phorkie setup check</title>
39 <meta charset="utf-8" />
40 <link rel="stylesheet" href="css/bootstrap.min.css"/>
41 <link rel="stylesheet" href="css/font-awesome.css"/>
42 <link rel="stylesheet" href="css/phorkie.css"/>
43 <link rel="icon" href="favicon.ico"/>
44 <meta name="viewport" content="width=device-width, initial-scale=1"/>
45 <style type="text/css">
49 display: inline-block;
54 li.list-group-item-success:before {
58 li.list-group-item-danger:before {
61 background-color: red;
63 li.list-group-item-info:before {
72 <div class="container">
76 <div class="page-header">
77 <h1>phorkie setup check</h1>
79 <h3>Check results</h3>
81 <ul class="list-group">
88 foreach ($messages as $arMessage) {
89 list($type, $message) = $arMessage;
90 $out .= '<li class="list-group-item list-group-item-'
91 . $stateMap[$type] . '">';
92 $out .= htmlspecialchars($message);
93 $out .= '</li>' . "\n";
99 if (array_sum($GLOBALS['phorkie']['cfgfiles']) == 0) {
100 //no config file loaded
101 reset($GLOBALS['phorkie']['cfgfiles']);
102 list($cfgFilePath, ) = each($GLOBALS['phorkie']['cfgfiles']);
104 $cfgFilePath = Tools::foldPath($cfgFilePath);
105 $cfgFileTemplate = htmlspecialchars(
106 file_get_contents(__DIR__ . '/../data/config.php.dist')
108 $cfgFileLines = count(explode("\n", $cfgFileTemplate));
111 <h3 id="configfile">Configuration file</h3>
113 Phorkie did not find a configuration file.
116 <pre>$cfgFilePath</pre>
118 from the following template:
120 <textarea style="width:99%; background-color: #F5F5F5" rows="$cfgFileLines">$cfgFileTemplate</textarea>
122 Remove the leading <tt>//</tt> from a line if you want to adjust it.
128 <p style="margin-top: 4ex">
129 <a href="./"><i class="icon-arrow-left"></i> back</a> to the index
135 <div class="container footer">
136 <a href="//sf.net/p/phorkie/">phorkie</a>,
137 the self-hosted, git-based pastebin software is available under the
138 <a href="http://www.gnu.org/licenses/agpl-3.0.html">
139 <abbr title="GNU Affero General Public License">AGPL</abbr></a>.