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 <link rel="stylesheet" href="css/bootstrap.min.css"/>
40 <link rel="stylesheet" href="css/font-awesome.css"/>
41 <link rel="stylesheet" href="css/phorkie.css"/>
42 <meta name="viewport" content="width=device-width, initial-scale=1"/>
43 <style type="text/css">
47 display: inline-block;
52 li.list-group-item-success:before {
56 li.list-group-item-danger:before {
59 background-color: red;
61 li.list-group-item-info:before {
70 <div class="container">
74 <div class="page-header">
75 <h1>phorkie setup check</h1>
77 <h3>Check results</h3>
79 <ul class="list-group">
86 foreach ($messages as $arMessage) {
87 list($type, $message) = $arMessage;
88 $out .= '<li class="list-group-item list-group-item-'
89 . $stateMap[$type] . '">';
90 $out .= htmlspecialchars($message);
91 $out .= '</li>' . "\n";
97 if (array_sum($GLOBALS['phorkie']['cfgfiles']) == 0) {
98 //no config file loaded
99 reset($GLOBALS['phorkie']['cfgfiles']);
100 list($cfgFilePath, ) = each($GLOBALS['phorkie']['cfgfiles']);
102 $cfgFilePath = Tools::foldPath($cfgFilePath);
103 $cfgFileTemplate = htmlspecialchars(
104 file_get_contents(__DIR__ . '/../data/config.php.dist')
106 $cfgFileLines = count(explode("\n", $cfgFileTemplate));
109 <h3 id="configfile">Configuration file</h3>
111 Phorkie did not find a configuration file.
114 <pre>$cfgFilePath</pre>
116 from the following template:
118 <textarea style="width:99%; background-color: #F5F5F5" rows="$cfgFileLines">$cfgFileTemplate</textarea>
120 Remove the leading <tt>//</tt> from a line if you want to adjust it.
126 <p style="margin-top: 4ex">
127 <a href="./"><i class="icon-arrow-left"></i> back</a> to the index
133 <div class="container footer">
134 <a href="//sf.net/p/phorkie/">phorkie</a>,
135 the self-hosted, git-based pastebin software is available under the
136 <a href="http://www.gnu.org/licenses/agpl-3.0.html">
137 <abbr title="GNU Affero General Public License">AGPL</abbr></a>.