-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.php
More file actions
executable file
·28 lines (20 loc) · 865 Bytes
/
install.php
File metadata and controls
executable file
·28 lines (20 loc) · 865 Bytes
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
#!/usr/bin/env php
<?php
echo "This script will install the required composer packages for the plugin \n";
echo "INSTALLING COMPOSER \n\n";
$composer_setup_url = "https://getcomposer.org/installer";
// Writing the code to a file
$composer_setup_file_path = __DIR__ . '/composer-setup.php';
copy($composer_setup_url, $composer_setup_file_path);
// Reading the actual signature
$actual_signature = hash_file('sha384', $composer_setup_file_path);
echo exec("php " . $composer_setup_file_path . " --quiet");
// Actually installing the dependencies
echo "ACTUALLY INSTALLING DEPENDENCIES\n";
echo exec("cd " . __DIR__ . "; php composer.phar update");
// Removing all the stuff again
echo "\nREMOVING THE TEMPORARY FILES\n";
$composer_phar_file_path = __DIR__ . '/composer.phar';
unlink($composer_setup_file_path);
unlink($composer_phar_file_path);
echo "DONE\n";