Skip to content

Commit c68fab2

Browse files
committed
Merge branch 'develop' for v4.0.5
2 parents 469fde1 + b0ff4ea commit c68fab2

File tree

4 files changed

+90
-52
lines changed

4 files changed

+90
-52
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.4
1+
4.0.5

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
"php": ">=7.0",
2828
"composer/composer": "1.7.3",
2929
"composer/semver": "1.4.2",
30-
"easyengine/admin-tools-command": "v1.0.2",
30+
"easyengine/admin-tools-command": "v1.0.3",
3131
"easyengine/auth-command": "v1.0.1",
3232
"easyengine/config-command": "v1.0.1",
3333
"easyengine/cron-command": "v1.0.1",
3434
"easyengine/log-command": "v1.0.0",
3535
"easyengine/mailhog-command": "v1.0.1",
36-
"easyengine/site-command": "v2.2.5",
37-
"easyengine/site-type-wp": "v1.0.2",
38-
"easyengine/site-type-php": "v1.0.2",
39-
"easyengine/service-command": "v1.0.3",
36+
"easyengine/site-command": "v2.2.6",
37+
"easyengine/site-type-wp": "v1.0.3",
38+
"easyengine/site-type-php": "v1.0.3",
39+
"easyengine/service-command": "v1.0.4",
4040
"easyengine/shell-command" : "v1.0.0",
4141
"justinrainbow/json-schema": "5.2.7",
4242
"monolog/monolog": "1.24.0",

composer.lock

Lines changed: 46 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

php/utils.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,44 @@ function get_config_value( $key, $default = null ) {
16451645
return empty( $existing_config[ $key ] ) ? $default : $existing_config[ $key ];
16461646
}
16471647

1648+
/**
1649+
* Function to download file to a path.
1650+
*
1651+
* @param string $path Path to download the file on.
1652+
* @param string $download_url Url to download the file from.
1653+
*/
1654+
function download( $path, $download_url ) {
1655+
1656+
$headers = array();
1657+
$options = array(
1658+
'timeout' => 1200, // 20 minutes ought to be enough for everybody.
1659+
'filename' => $path,
1660+
);
1661+
http_request( 'GET', $download_url, null, $headers, $options );
1662+
}
1663+
1664+
/**
1665+
* Extract zip files.
1666+
*
1667+
* @param string $zip_file Path to the zip file.
1668+
* @param string $path_to_extract Path where zip needs to be extracted to.
1669+
*
1670+
* @return bool Success of extraction.
1671+
*/
1672+
function extract_zip( $zip_file, $path_to_extract ) {
1673+
1674+
$zip = new \ZipArchive;
1675+
$res = $zip->open( $zip_file );
1676+
if ( true === $res ) {
1677+
$zip->extractTo( $path_to_extract );
1678+
$zip->close();
1679+
1680+
return true;
1681+
}
1682+
1683+
return false;
1684+
}
1685+
16481686
/**
16491687
* Random name generator.
16501688
*

0 commit comments

Comments
 (0)