Conditions | 3 |
Paths | 6 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function __construct() |
||
26 | { |
||
27 | if (!file_exists(__DIR__.'/../vendor/autoload.php')) { |
||
28 | require_once __DIR__.'/../vendor/autoload.php'; |
||
29 | |||
30 | $composer = 'composer'; |
||
31 | |||
32 | try { |
||
33 | $process = \Symfony\Component\Process\Process::fromShellCommandline($composer.' install'); |
||
34 | $process->setEnv( |
||
35 | [ |
||
36 | 'COMPOSER_HOME' => __DIR__.'/../vendor/bin/composer', |
||
37 | ] |
||
38 | ); |
||
39 | $process->setTimeout(null); // Setting timeout to null to prevent installation from stopping at a certain point in time. |
||
40 | $process->setWorkingDirectory(__DIR__)->mustRun(); |
||
41 | } catch (\Exception $ex) { |
||
42 | echo $ex->getMessage(); |
||
43 | } |
||
47 |