aboutsummaryrefslogtreecommitdiffhomepage
path: root/install/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'install/index.php')
-rwxr-xr-xinstall/index.php291
1 files changed, 286 insertions, 5 deletions
diff --git a/install/index.php b/install/index.php
index ec504160..dbfe9539 100755
--- a/install/index.php
+++ b/install/index.php
@@ -11,6 +11,8 @@
11$errors = array(); 11$errors = array();
12$successes = array(); 12$successes = array();
13 13
14require_once('wallabag_compatibility_test.php');
15
14/* Function taken from at http://php.net/manual/en/function.rmdir.php#110489 16/* Function taken from at http://php.net/manual/en/function.rmdir.php#110489
15 * Idea : nbari at dalmp dot com 17 * Idea : nbari at dalmp dot com
16 * Rights unknown 18 * Rights unknown
@@ -210,6 +212,117 @@ else if (isset($_POST['install'])) {
210 <link rel="stylesheet" href="themes/baggy/css/print.css" media="print"> 212 <link rel="stylesheet" href="themes/baggy/css/print.css" media="print">
211 <script src="themes/_global/js/jquery-2.0.3.min.js"></script> 213 <script src="themes/_global/js/jquery-2.0.3.min.js"></script>
212 <script src="themes/baggy/js/init.js"></script> 214 <script src="themes/baggy/js/init.js"></script>
215
216
217 <style type="text/css">
218a {
219color:#000;
220text-decoration:underline;
221padding:0 1px;
222}
223a:hover {
224color:#fff;
225background-color:#333;
226text-decoration:none;
227padding:0 1px;
228}
229p {
230margin:0;
231padding:5px 0;
232}
233em {
234font-style:normal;
235background-color:#ffc;
236padding: 0.1em 0;
237}
238ul, ol {
239margin:10px 0 10px 20px;
240padding:0 0 0 15px;
241}
242ul li, ol li {
243margin:0 0 7px 0;
244padding:0 0 0 3px;
245}
246h2 {
247font-size:18px;
248padding:0;
249}
250h3 {
251font-size:16px;
252padding:0;
253margin:20px 0 5px 0;
254}
255h4 {
256font-size:14px;
257padding:0;
258margin:15px 0 5px 0;
259}
260code {
261font-size:1.1em;
262background-color:#f3f3ff;
263color:#000;
264}
265em strong {
266text-transform: uppercase;
267}
268table#chart {
269border-collapse:collapse;
270}
271table#chart th {
272background-color:#eee;
273padding:2px 3px;
274border:1px solid #fff;
275}
276table#chart td {
277text-align:center;
278padding:2px 3px;
279border:1px solid #eee;
280}
281table#chart tr.enabled td {
282/* Leave this alone */
283}
284table#chart tr.disabled td,
285table#chart tr.disabled td a {
286}
287table#chart tr.disabled td a {
288text-decoration:underline;
289}
290div.chunk {
291margin:20px 0 0 0;
292padding:0 0 10px 0;
293border-bottom:1px solid #ccc;
294}
295.footnote,
296.footnote a {
297font:10px/12px verdana, sans-serif;
298color:#aaa;
299}
300.footnote em {
301background-color:transparent;
302font-style:italic;
303}
304.good{
305background-color:#52CC5B;
306}
307.bad{
308background-color:#F74343;
309font-style:italic;
310font-weight: bold;
311}
312.pass{
313background-color:#FF9500;
314}
315#detail {
316background-color: #000;
317font-size:1.2em;
318line-height: 1.6;
319width: 1.6em;
320height: 1.6em;
321color:white;
322}
323
324</style>
325
213 </head> 326 </head>
214 <body> 327 <body>
215 <header class="w600p center mbm"> 328 <header class="w600p center mbm">
@@ -259,11 +372,8 @@ else if (isset($_POST['install'])) {
259 <?php endif; ?> 372 <?php endif; ?>
260 <p>To install wallabag, you just have to fill the following fields. That's all.</p> 373 <p>To install wallabag, you just have to fill the following fields. That's all.</p>
261 <p>If you need help, you can read the doc: <a href="docs/" target="_blank">offline documentation</a> and <a href="http://doc.wallabag.org" target="_blank">online one</a> (already up-to-date).</p> 374 <p>If you need help, you can read the doc: <a href="docs/" target="_blank">offline documentation</a> and <a href="http://doc.wallabag.org" target="_blank">online one</a> (already up-to-date).</p>
262 <p>Don't forget to check your server compatibility <a href="install/wallabag_compatibility_test.php?from=install">here</a>.</p> 375
263 <form method="post"> 376 <?php if (!is_dir('vendor')) : ?>
264 <fieldset>
265 <legend><strong>Technical settings</strong></legend>
266 <?php if (!is_dir('vendor')) : ?>
267 <div class='messages notice install'>wallabag needs twig, a template engine (<a href="http://twig.sensiolabs.org/">?</a>). Two ways to install it:<br /> 377 <div class='messages notice install'>wallabag needs twig, a template engine (<a href="http://twig.sensiolabs.org/">?</a>). Two ways to install it:<br />
268 <ul> 378 <ul>
269 <li>automatically download and extract vendor.zip into your wallabag folder. 379 <li>automatically download and extract vendor.zip into your wallabag folder.
@@ -277,6 +387,159 @@ php composer.phar install</code></pre></li>
277 </ul> 387 </ul>
278 </div> 388 </div>
279 <?php endif; ?> 389 <?php endif; ?>
390
391 <p class="detail">Server compatibility test (click to view details) : <?php if (isOkay()) { ?>
392 <span class="good">All good</span>
393 <?php } elseif (isPassing()) { ?>
394 <span class="pass">Some problems, but it's OK !</span>
395 <?php } else { ?>
396 <span class="bad">Bad news : you can't run wallabag</span>
397 <?php } ?> </p>
398 <?php $status = status(); ?>
399
400 <div class="details">
401 <div>
402 <h2 style="text-align:center;"><?php echo $status['app_name']; ?>: Compatibility Test</h2>
403 <table cellpadding="0" cellspacing="0" border="0" width="100%" id="chart">
404 <thead>
405 <tr>
406 <th>Test</th>
407 <th>Should Be</th>
408 <th>What You Have</th>
409 <th>What it means</th>
410 </tr>
411 </thead>
412 <tbody>
413 <tr class="<?php echo ($status['php']) ? 'enabled' : 'disabled'; ?>">
414 <td>PHP</td>
415 <td>5.3.3 or higher</td>
416 <td class="<?php echo ($status['php']) ? 'good' : 'disabled'; ?>"><?php echo phpversion(); ?></td>
417 <td><?php echo ($status['php']) ? '<strong>PHP:</strong> You are running a supported version of PHP.' : '<strong>PHP:</strong> You are running an unsupported version of PHP. <strong>' . $status['app_name'] . ' will not work here.</strong>' ;?></td>
418 </tr>
419 <tr class="<?php echo ($status['pdo']) ? 'enabled' : 'disabled'; ?>">
420 <td><a href="http://php.net/manual/en/book.pdo.php">PDO</a></td>
421 <td>Enabled</td>
422 <?php echo ($status['pdo']) ? '<td class="good">Enabled</span>' : '<td class="bad">Disabled'; ?></td>
423 <td><?php echo ($status['pdo']) ? '<strong>PDO:</strong> You have PDO support enabled.' : '<strong>PDO:</strong> Your PHP installation doesn\'t support PHP PDO. <strong>' . $status['app_name'] . ' will not work here.</strong>' ?></td>
424 </tr>
425 <tr class="<?php echo ($status['xml']) ? 'enabled' : 'disabled'; ?>">
426 <td><a href="http://php.net/xml">XML</a></td>
427 <td>Enabled</td>
428 <?php echo ($status['xml']) ? '<td class="good">Enabled, and sane</span>' : '<td class="bad">Disabled, or broken'; ?></td>
429 <td><?php echo ($status['xml']) ? '<strong>XML:</strong> You have XMLReader support or a version of XML support that isn\'t broken installed.' : '<strong>XML:</strong> Your PHP installation doesn\'t support XML parsing. <strong>' . $status['app_name'] . ' will not work here.</strong>' ?></td>
430 </tr>
431 <tr class="<?php echo ($status['pcre']) ? 'enabled' : 'disabled'; ?>">
432 <td><a href="http://php.net/pcre">PCRE</a></td>
433 <td>Enabled</td>
434 <?php echo ($status['pcre']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
435 <td><?php echo ($status['pcre']) ? '<strong>PCRE:</strong> You have PCRE support installed.' : '<strong>PCRE:</strong> Your PHP installation doesn\'t support Perl-Compatible Regular Expressions. <strong>' . $status['app_name'] .' will not work here.</strong>' ?></td>
436 </tr>
437 <tr class="<?php echo ($status['zlib']) ? 'enabled' : 'disabled'; ?>">
438 <td><a href="http://php.net/zlib">Zlib</a></td>
439 <td>Enabled</td>
440 <?php echo ($status['zlib']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
441 <td><?php echo ($status['zlib']) ? '<strong>Zlib:</strong> You have <code>Zlib</code> enabled. This allows SimplePie to support GZIP-encoded pages.' : '<strong>Zlib:</strong> The <code>Zlib</code> extension is not available. SimplePie will ignore any GZIP-encoding, and instead handle pages as uncompressed text.' ?></td>
442 </tr>
443 <tr class="<?php echo ($status['mbstring']) ? 'enabled' : 'disabled'; ?>">
444 <td><a href="http://php.net/mbstring">mbstring</a></td>
445 <td>Enabled</td>
446 <?php echo ($status['mbstring']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
447 <td rowspan="2"><?php if(($status['mbstring']) && ($status['iconv'])) { ?><strong>mbstring and iconv:</strong> You have both <code>mbstring</code> and <code>iconv</code> installed! This will allow <?php echo $status['app_name']; ?> to handle the greatest number of languages.
448 <?php } elseif ($status['mbstring']) { ?><strong>mbstring:</strong> <code>mbstring</code> is installed, but <code>iconv</code> is not.
449 <?php } elseif ($status['iconv']) { ?><strong>iconv:</strong> <code>iconv</code> is installed, but <code>mbstring</code> is not.
450 <?php } else { ?><strong>mbstring and iconv:</strong> <em>You do not have either of the extensions installed.</em> This will significantly impair your ability to read non-English pages, as well as even some English ones.
451 <?php } ?>
452 </td>
453 </tr>
454 <tr class="<?php echo ($status['iconv']) ? 'enabled' : 'disabled'; ?>">
455 <td><a href="http://php.net/iconv">iconv</a></td>
456 <td>Enabled</td>
457 <?php echo ($status['iconv']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
458 </tr>
459 <tr class="<?php echo ($status['dom']) ? 'enabled' : 'disabled'; ?>">
460 <td><a href="http://php.net/manual/en/book.dom.php">DOM / XML extension</a></td>
461 <td>Enabled</td>
462 <?php echo ($status['dom']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
463 <td><?php echo ($status['dom']) ? '<strong>DOM/XML:</strong> You can parse <em>ini</em> files.' : '<strong>DOM/XML:</strong> Your PHP configuration isn\'t standard, you\'re missing PHP-DOM. You may try to install a package or recompile PHP. <strong>' . $status['app_name'] . ' will not work here.</strong>'; ?></td>
464 </tr>
465 <tr class="<?php echo ($status['filter']) ? 'enabled' : 'disabled'; ?>">
466 <td><a href="http://uk.php.net/manual/en/book.filter.php">Data filtering</a></td>
467 <td>Enabled</td>
468 <?php echo ($status['filter']) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
469 <td><?php echo ($status['filter']) ? '<strong>Data filtering:</strong> You can use the PHP build-in DOM to operate on XML documents.' : '<strong>Data filtering:</strong> Your PHP configuration has the filter extension disabled. <strong>' . $status['app_name'] . ' will not work here.</strong>' ?></td>
470 </tr>
471 <tr class="<?php echo ($status['gd']) ? 'enabled' : 'disabled'; ?>">
472 <td><a href="http://php.net/manual/en/book.image.php">GD</a></td>
473 <td>Enabled</td>
474 <?php echo ($status['gd']) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
475 <td><?php echo($status['gd']) ? '<strong>GD:</strong> You have <code>GD</code> support installed.' : '<strong>GD:</strong> The <code>GD</code> extension is not available. ' . $status['app_name'] . ' will not be able to download pictures locally on your server.' ?></td>
476 </tr>
477 <tr class="<?php echo ($status['tidy']) ? 'enabled' : 'disabled'; ?>">
478 <td><a href="http://php.net/tidy">Tidy</a></td>
479 <td>Enabled</td>
480 <?php echo ($status['tidy']) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
481 <td><?php echo ($status['tidy']) ? '<strong>Tidy:</strong> You have <code>Tidy</code> support installed.' : '<strong>Tidy:</strong> The <code>Tidy</code> extension is not available.' . $status['app_name'] . ' should still work with most pages, but you may experience problems with some. You can install it with <code>sudo apt-get install php5-tidy</code> and then reload Apache <code>sudo service apache2 reload</code>.' ; ?></td>
482 </tr>
483 <tr class="<?php echo ($status['curl']) ? 'enabled' : 'disabled'; ?>">
484 <td><a href="http://php.net/curl">cURL</a></td>
485 <td>Enabled</td>
486 <?php echo (extension_loaded('curl')) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
487 <td><?php echo ($status['curl']) ? '<strong>cURL:</strong> You have <code>cURL</code> support installed.' : '<strong>cURL:</strong> The <code>cURL</code> extension is not available. SimplePie will use <code>fsockopen()</code> instead.' ?></td>
488 </tr>
489 <tr class="<?php echo ($status['parse_ini']) ? 'enabled' : 'disabled'; ?>">
490 <td><a href="http://uk.php.net/manual/en/function.parse-ini-file.php">Parse ini file</td>
491 <td>Enabled</td>
492 <?php echo ($status['parse_ini']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
493 <td><?php echo ($status['parse_ini']) ? '<strong>Parse ini:</strong> You can parse <em>ini</em> files.' : '<strong>Parse ini files function :</strong> Bad luck : your webhost has decided to block the use of the <em>parse_ini_file</em> function. <strong>' . $status['app_name'] . ' will not work here.' ?></td>
494 </tr>
495 <tr class="<?php echo ($status['parallel']) ? 'enabled' : 'disabled'; ?>">
496 <td>Parallel URL fetching</td>
497 <td>Enabled</td>
498 <?php echo ($status['parallel']) ? '<td class="good">Enabled' : '<td class="pass">Disabled'; ?></td>
499 <td><?php echo ($status['parallel']) ? '<strong>Parallel URL fetching:</strong> You have <code>HttpRequestPool</code> or <code>curl_multi</code> support installed.' : '<strong>Parallel URL fetching:</strong> <code>HttpRequestPool</code> or <code>curl_multi</code> support is not available. ' . $status['app_name'] . ' will use <code>file_get_contents()</code> instead to fetch URLs sequentially rather than in parallel.' ?></td>
500 </tr>
501 <tr class="<?php echo ($status['allow_url_fopen']) ? 'enabled' : 'disabled'; ?>">
502 <td><a href="http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen">allow_url_fopen</a></td>
503 <td>Enabled</td>
504 <?php echo ($status['allow_url_fopen']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
505 <td><?php echo ($status['allow_url_fopen']) ? '<strong>allow_url_fopen:</strong> You have allow_url_fopen enabled.' : '<strong>allow_url_fopen:</strong> Your PHP configuration has allow_url_fopen disabled. <strong>' . $status['app_name'] . ' will not work here.</strong>' ?></td>
506 </tr>
507 <tr class="<?php echo ($status['gettext']) ? 'enabled' : 'disabled'; ?>">
508 <td><a href="http://php.net/manual/en/book.gettext.php">gettext</a></td>
509 <td>Enabled</td>
510 <?php echo ($status['gettext']) ? '<td class="good">Enabled' : '<td class="bad">Disabled'; ?></td>
511 <td><?php echo ($status['gettext']) ? '<strong>Gettext:</strong> You have <code>gettext</code> enabled.</em>' : '<strong>GetText:</strong> The <code>gettext</code> extension is not available. The system we use to display wallabag in various languages is not available. <strong>' . $status['app_name'] .' will not work here.</strong>' ?></td>
512 </tr>
513 </tbody>
514 </table>
515 </div>
516
517 <div class="details">
518 <?php //if ($status['php'] && $status['xml'] && $status['pcre'] && $status['mbstring'] && $status['iconv'] && $status['filter'] && $status['allow_url_fopen']) { ?>
519 <?php if (isOkay()) { ?>
520 <h3>Bottom Line: Yes, you can run <?php echo $status['app_name']; ?> !</h3>
521 <p><em>Your webhost has its act together!</em></p>
522 <p><strong>Note</strong>: Passing this test does not guarantee that <?php echo $status['app_name']; ?> will run on your webhost &mdash; it only ensures that the basic requirements have been addressed. If you experience any problems, please let us know.</p>
523 <?php //} else if ($status['php'] && $status['xml'] && $status['pcre'] && $status['mbstring'] && $status['allow_url_fopen'] && $status['filter']) { ?>
524 <?php } else if (!isOkay() && isPassing()) { ?>
525 <h3>Bottom Line: Yes, you can run <?php echo $status['app_name']; ?> !</h3>
526 <p><em>For most pages, it'll run with no problems.</em> There are certain languages that you might have a hard time with though.</p>
527 <p><strong>Note</strong>: Passing this test does not guarantee that <?php echo $status['app_name']; ?> will run on your webhost &mdash; it only ensures that the basic requirements have been addressed. If you experience any problems, please let us know.</p>
528 <?php } else { ?>
529 <h3>Bottom Line: We're sorry…</h3>
530 <p><em>Your webhost does not support the minimum requirements for <?php echo $status['app_name']; ?>.</em> It may be a good idea to contact your webhost and point them to the results of this test. They may be able to enable/install the required components.</p>
531 <?php } ?>
532 </div>
533
534 <div class="chunk">
535 <p class="footnote">This compatibility test has been borrowed (and slightly adapted by <a href="http://fivefilters.org/content-only/">fivefilters.org</a>) from the one supplied by <a href="http://simplepie.org/">SimplePie.org</a>.</a></p>
536 </div>
537
538 </div>
539
540 <form method="post" class="technical">
541 <fieldset>
542 <legend><strong>Technical settings</strong></legend>
280 <p> 543 <p>
281 Database engine: 544 Database engine:
282 <ul> 545 <ul>
@@ -331,6 +594,19 @@ php composer.phar install</code></pre></li>
331 $("#mysql_infos").hide(); 594 $("#mysql_infos").hide();
332 $("#pg_infos").hide(); 595 $("#pg_infos").hide();
333 596
597 $(".details").hide();
598
599 <?php
600 if (!isPassing()) : ?>
601 $('.technical').hide();
602 <?php
603 else :
604 ?>
605 $('.technical').show();
606 <?php
607 endif;
608 ?>
609
334 <?php 610 <?php
335 if (!extension_loaded('pdo_sqlite')) : ?> 611 if (!extension_loaded('pdo_sqlite')) : ?>
336 $("#install_button").hide(); 612 $("#install_button").hide();
@@ -370,6 +646,11 @@ php composer.phar install</code></pre></li>
370 } 646 }
371 } 647 }
372 }); 648 });
649
650 $(".detail").click(function()
651 {
652 $('.details').toggle();
653 });
373 </script> 654 </script>
374 </body> 655 </body>
375</html> 656</html>