Benign php Download

expand_composer_json.php

Calls PHP file_put_contents()PHP checks regular-file existence
SHA-2569d799367345aee6a70f371f34490e0c8622d9e8e1c02d0a3726523c411b40866

Evidence

Registers PHP error handler lines 31–44
31:44… rbose'], array_keys($options)));
32!$verbose ?: print 'argv = ' . print_r($argv, TRUE) . "\noptions = " . print_r($options, TRUE) . "\nverbose = {$verbose}\nrest_index = {$rest_index}\n";
33!$verbose ?: print "path = {$path}\nsuffix = {$suffix}\n";
34
35set_error_handler("halt_on_warning");
36$divider = "\n" . str_repeat('*', 60) . "\n";
37
38// The optional project name should be entered after the options.
39$project_name = array_slice($argv, $rest_index)[0] ?? getenv('PROJECT_NAME') ?: getenv('CI_PROJECT_NAME');
40!$verbose ?: print "project_name = {$project_name}\n";
41if (empty($project_name)) {
42 throw new RuntimeException($divider . 'Unable to determine project name.' . $divider);
43}
44$ignore_project_core_version = (bo …
PHP JSON deserialization lines 48–52
48:49… ut file {$path} does not exist." . $divider);
49}
50$json_project = json_decode(file_get_contents($path), TRUE);
51!$verbose ?: print 'Initial $json_project = ' . print_r($json_project, TRUE) . PHP_EOL;
52// Halt if the file failed to p …
PHP replaces matched string content lines 87–95
87:58… re_value;
88 }
89}
90
91// Conditionally add prophecy.
92$core_version = str_replace(['^', '~'], ['', ''], getenv('DRUPAL_CORE'));
93print "core_version=$core_version\n";
94if (
95 !isset($json_project['require-dev'][ …
HTTP URL string literal lines 115–124
115:22… LSE;
116foreach ($repos as $repo) {
117 if (is_array($repo) && ($repo['url'] ?? '') === 'https://packages.drupal.org/8') {
118 $has_drupal_repo = TRUE;
119 break;
⋯5 lines
PHP checks regular-file existence lines 153–157
153:8… "Using composer patches file: $composer_patches_file\n";
154 if (is_file($composer_patches_file) && file_exists($composer_patches_file)) {
155 $json_rich['extra']['patches-file'] = $composer_patches_file;
156 }
157 elseif (is_file('./.gitlab-ci/' . $composer_patches_file) && file_exists('./.gitlab-ci/' . $co …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.