forked from leftypol/leftypol
lots of print statements
This commit is contained in:
parent
4b61aaabbf
commit
195a3914d1
5 changed files with 50 additions and 5 deletions
33
install.php
33
install.php
|
@ -9,6 +9,7 @@ if (fopen('inc/instance-config.php' , 'a') === false) {
|
|||
}
|
||||
|
||||
require 'inc/functions.php';
|
||||
require_once 'inc/anti-bot.php'; // DELETE ME THIS IS FOR print_err function only!
|
||||
|
||||
loadConfig();
|
||||
|
||||
|
@ -23,6 +24,31 @@ $page = array(
|
|||
// this breaks the display of licenses if enabled
|
||||
$config['minify_html'] = false;
|
||||
|
||||
function checkMd5Exec(bool $can_exec) {
|
||||
print_err2("checkMd5Exec");
|
||||
print_err2($can_exec);
|
||||
$shell_out = shell_exec("pwd");
|
||||
print_err2("shell out: " . $shell_out);
|
||||
$shell_out = shell_exec('echo "vichan" | md5sum');
|
||||
print_err2("shell out: " . $shell_out);
|
||||
$shell_ok = $shell_out == "141225c362da02b5c359c45b665168de -\n";
|
||||
print_err2("shell ok: " . strval($shell_ok));
|
||||
$result = $can_exec && $shell_ok;
|
||||
print_err2($result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
function checkGifsicle() {
|
||||
print_err2("checkGifsicle");
|
||||
$shell_out = shell_exec('echo $PATH');
|
||||
print_err2("shell out: " . $shell_out);
|
||||
$shell_out = shell_exec('gifsicle --help');
|
||||
print_err2("shell out: " . $shell_out);
|
||||
$shell_out = shell_exec('which gifsicle');
|
||||
print_err2("shell out (which gifsicle): " . $shell_out);
|
||||
return $shell_out;
|
||||
}
|
||||
|
||||
if (file_exists($config['has_installed'])) {
|
||||
|
||||
// Check the version number
|
||||
|
@ -647,6 +673,7 @@ if ($step == 0) {
|
|||
|
||||
echo Element('page.html', $page);
|
||||
} elseif ($step == 1) {
|
||||
print_err2("Hello World install.php");
|
||||
$page['title'] = 'Pre-installation test';
|
||||
|
||||
$can_exec = true;
|
||||
|
@ -663,6 +690,8 @@ if ($step == 0) {
|
|||
$version = explode('.', PHP_VERSION);
|
||||
define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
|
||||
}
|
||||
|
||||
print_err2("Can exec: " . strval($can_exec));
|
||||
|
||||
// Required extensions
|
||||
$extensions = array(
|
||||
|
@ -770,7 +799,7 @@ if ($step == 0) {
|
|||
array(
|
||||
'category' => 'Image processing',
|
||||
'name' => '`gifsicle` (command-line animted GIF thumbnailing)',
|
||||
'result' => $can_exec && shell_exec('which gifsicle'),
|
||||
'result' => $can_exec && checkGifsicle(),
|
||||
'required' => false,
|
||||
'message' => '(Optional) `gifsicle` was not found or executable; you may not use `convert+gifsicle` for better animated GIF thumbnailing.',
|
||||
'effect' => function (&$config) { if ($config['thumb_method'] == 'gm') $config['thumb_method'] = 'gm+gifsicle';
|
||||
|
@ -780,7 +809,7 @@ if ($step == 0) {
|
|||
'category' => 'Image processing',
|
||||
'name' => '`md5sum` (quick file hashing on GNU/Linux)',
|
||||
'prereq' => '',
|
||||
'result' => $can_exec && shell_exec('echo "vichan" | md5sum') == "141225c362da02b5c359c45b665168de -\n",
|
||||
'result' => checkMd5Exec($can_exec),
|
||||
'required' => false,
|
||||
'message' => '(Optional) `md5sum` was not found or executable; file hashing for multiple images will be slower. Ignore if not using Linux.',
|
||||
'effect' => function (&$config) { $config['gnu_md5'] = true; },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue