-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.php
47 lines (39 loc) · 1.15 KB
/
install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Copyright 2016 | Licensed under MIT
*
* Currently additionally required extensions for MyEnvoy:
* - acpu
* - curl
* - gd
* - mcrypt
* - mhash
*
*/
$_required_extensions = array('apcu', 'curl', 'gd', 'mcrypt', 'mhash');
$_havetoinstall = array();
echo 'Welcome to the MyEnvoy installer script!' . PHP_EOL;
echo 'This PHP script will lead you through the installation process of an envoy on your machine.' . PHP_EOL . PHP_EOL;
echo 'At first, all missing PHP extensions will get installed.' . PHP_EOL;
echo 'Search for installed extensions . . .' . PHP_EOL;
foreach ($_required_extensions as $ext) {
if (extension_loaded($ext) === FALSE) {
$_havetoinstall[] = $ext;
}
}
echo 'The following missing extensions will get installed:' . PHP_EOL;
echo implode(', ', $_havetoinstall);
if (count($_havetoinstall) === 0) {
echo 'None.';
}
echo PHP_EOL;
$input = readline('Do you want to proceed? (y/n): ');
if ($input !== 'y') {
exit();
}
echo PHP_EOL;
foreach ($_havetoinstall as $ext) {
passthru('apt-get install --force-yes php5-' . $ext);
}
echo 'Extensions successfully checked!' . PHP_EOL . PHP_EOL;
echo '' . PHP_EOL;