4 * Check if everything is setup
6 header('HTTP/1.0 500 Internal Server Error');
8 if (file_exists(__DIR__ . '/../src/phancap/Autoloader.php')) {
9 include_once __DIR__ . '/../src/phancap/Autoloader.php';
10 Autoloader::register();
12 include_once 'phancap/Autoloader.php';
17 $config = new Config();
20 $messages[][] = array('ok', 'Configuration check ok');
21 } catch (\Exception $e) {
22 $messages[][] = array('err', $e->getMessage());
28 foreach ($adapter as $classpart) {
29 $class = '\\phancap\\Adapter_' . $classpart;
30 $adapter = new $class();
31 $adapter->setConfig($config);
32 $errors = $adapter->isAvailable();
33 if ($errors === true) {
34 $messages[][] = array(
35 'ok', 'Adapter ' . $classpart . ' is available'
38 foreach ($errors as $msg) {
39 $messages['Adapter: '. $classpart][] = array('err', $msg);
44 header('HTTP/1.0 200 OK');
47 <?xml version="1.0" encoding="utf-8"?>
50 <title>phancap setup check</title>
51 <style type="text/css">
61 background-color: red;
68 <h1>phancap setup check</h1>
71 foreach ($messages as $key => $messages) {
72 if (!is_numeric($key)) {
73 $out .= '<li>' . htmlspecialchars($key)
76 foreach ($messages as $data) {
77 list($state, $message) = $data;
78 $out .= '<li class="' . $state . '">';
79 $out .= htmlspecialchars($message);
80 $out .= '</li>' . "\n";
82 if (!is_numeric($key)) {
83 $out .= '</ul></li>' . "\n";
89 <a href="./">back</a> to the index