function _search_api_elasticsearch_elastica_fetch_tar in Search API Elasticsearch 7
Downloads and extracts a tarball.
1 call to _search_api_elasticsearch_elastica_fetch_tar()
- drush_download_elastica in modules/
elastica/ search_api_elasticsearch_elastica.drush.inc - Command to download the Elastica PHP Library.
File
- modules/
elastica/ search_api_elasticsearch_elastica.drush.inc, line 98 - Drush integration for Search API elasticsearch.
Code
function _search_api_elasticsearch_elastica_fetch_tar($url) {
$filename = basename($url);
// Remove any existing files.
if (is_file($filename)) {
drush_op('unlink', $filename);
}
if (!drush_shell_exec('wget ' . $url)) {
drush_shell_exec('curl -O ' . $url);
}
if (is_file($filename)) {
print $filename;
// Extract the archive.
drush_shell_exec('tar xf ' . $filename);
// Remove the file.
drush_op('unlink', $filename);
// Move the directory.
drush_shell_exec('mv Elastica-' . SEARCH_API_ELASTICSEARCH_ELASTICA_VERSION . ' Elastica');
}
}