sintonia/airtime_mvc/application/configs/config-check.php

158 lines
5.6 KiB
PHP
Raw Normal View History

2014-11-28 21:30:11 +01:00
<?php
/*
* We only get here after setup, or if there's an error in the configuration.
*
* Display a table to the user showing the necessary dependencies
* (both PHP and binary) and the status of any application services,
* along with steps to fix them if they're not found or misconfigured.
*/
$phpDependencies = checkPhpDependencies();
2014-11-28 21:30:11 +01:00
$zend = $phpDependencies["zend"];
$postgres = $phpDependencies["postgres"];
$database = checkDatabaseConfiguration();
2014-11-28 21:30:11 +01:00
function booleanReduce($a, $b) {
return $a && $b;
}
$r = array_reduce($phpDependencies, "booleanReduce", true);
$result = $r && $database;
?>
2014-12-09 23:48:16 +01:00
<html>
2014-11-28 21:30:11 +01:00
<head>
<link rel="stylesheet" type="text/css" href="css/bootstrap-3.3.1.min.css">
<link rel="stylesheet" type="text/css" href="css/setup/config-check.css">
2014-11-28 21:30:11 +01:00
</head>
2014-12-09 23:48:16 +01:00
<body>
2014-11-28 21:30:11 +01:00
<h2>
2014-12-09 23:48:16 +01:00
<img class="logo" src="css/images/airtime_logo_jp.png" /><br/>
2014-11-28 21:30:11 +01:00
<strong>Configuration Checklist</strong>
</h2>
2014-12-09 23:48:16 +01:00
<table class="table">
2014-11-28 21:30:11 +01:00
<thead>
<tr>
<td class="component">
Component
</td>
<td class="description">
<strong>Description</strong>
2014-11-28 21:30:11 +01:00
</td>
<td class="solution">
<strong>Solution</strong>
2014-11-28 21:30:11 +01:00
</td>
</tr>
</thead>
</table>
<div class="checklist">
<table class="table table-striped">
<caption class="caption">
PHP Dependencies
</caption>
<tbody>
<tr class="<?=$zend ? 'success' : 'danger';?>">
<td class="component">
Zend
</td>
<td class="description">
Zend MVC Framework
</td>
2014-12-09 23:48:16 +01:00
<td class="solution <?php if ($zend) {echo 'check';?>">
2014-11-28 21:30:11 +01:00
<?php
} else {
2014-12-09 23:48:16 +01:00
?>">
2014-11-28 21:30:11 +01:00
<b>Ubuntu</b>: try running <code>sudo apt-get install libzend-framework-php</code>
<br/><b>Debian</b>: try running <code>sudo apt-get install zendframework</code>
<?php
}
?>
</td>
</tr>
<tr class="<?=$postgres ? 'success' : 'danger';?>">
<td class="component">
Postgres
</td>
<td class="description">
PDO and PostgreSQL libraries
</td>
2014-12-09 23:48:16 +01:00
<td class="solution <?php if ($postgres) {echo 'check';?>">
2014-11-28 21:30:11 +01:00
<?php
} else {
2014-12-09 23:48:16 +01:00
?>">
2014-11-28 21:30:11 +01:00
Try running <code>sudo apt-get install php5-pgsql</code>
<?php
}
?>
</td>
</tr>
</tbody>
</table>
<table class="table table-striped">
<caption class="caption">
External Services
</caption>
<tbody>
<tr class="<?=$database ? 'success' : 'danger';?>">
<td class="component">
Database
</td>
<td class="description">
Database configuration for Airtime
</td>
2014-12-09 23:48:16 +01:00
<td class="solution <?php if ($database) {echo 'check';?>">
2014-11-28 21:30:11 +01:00
<?php
} else {
2014-12-09 23:48:16 +01:00
?>">
2014-11-28 21:30:11 +01:00
Make sure you aren't missing any of the Postgres dependencies in the table above.
If your dependencies check out, make sure your database configuration settings in
2014-12-16 18:24:41 +01:00
<code>/etc/airtime.conf</code> are correct and the Airtime database was installed correctly.
2014-11-28 21:30:11 +01:00
<?php
}
?>
</td>
</tr>
</tbody>
</table>
2014-12-09 23:48:16 +01:00
</div>
2014-11-28 21:30:11 +01:00
<?php
if (!$result) {
?>
<p>
Looks like something went wrong! If you've tried everything we've recommended in the table above, come
<a href="https://forum.sourcefabric.org/">visit our forums</a>
or <a href="http://www.sourcefabric.org/en/airtime/manuals/">check out the manual</a>.
</p>
<?php
} else {
?>
<p>
2014-12-16 22:26:58 +01:00
Your Airtime station is up and running! Get started by logging in with the default username and password: 'admin'/'admin'
2014-11-28 21:30:11 +01:00
</p>
<button onclick="location = location.pathname;">Log in to Airtime!</button>
2014-11-28 21:30:11 +01:00
<?php
}
?>
<div class="footer">
<h3>
PHP Extension List
</h3>
<p>
<?php
2014-12-01 21:49:53 +01:00
global $extensions;
2014-12-16 18:24:41 +01:00
$first = true;
2014-11-28 21:30:11 +01:00
foreach ($extensions as $ext) {
2014-12-16 18:24:41 +01:00
if (!$first) {
echo " | ";
} else {
$first = false;
}
echo $ext;
2014-11-28 21:30:11 +01:00
}
?>
</p>
</div>