$record) echo $record['file'], ' ', $target, "\n"; exit(0); } if ($mode !== '--status') throw new RuntimeException('Неизвестный режим бренда'); $actual = []; $expected = []; foreach ($brand['logos'] as $target => $record) { $context = stream_context_create(['http' => ['timeout' => 30, 'header' => "Cache-Control: no-cache\r\n"]]); $body = @file_get_contents($url . '/' . $target . '?brand_check=' . $record['sha256'], false, $context); if ($body === false) throw new RuntimeException('Не удалось прочитать бренд цели: ' . $target); $actual[$target] = hash('sha256', str_replace("\r\n", "\n", $body)); $expected[$target] = $record['sha256']; } $state = prelandBrandState($actual, $brand); if ($state === 0) { echo "OK: доменный бренд совпал; SVG не перезаписываются\n"; exit(0); } if ($state === 10) { echo "Разрешена точная миграция бренда по preland#12\n"; exit(10); } throw new RuntimeException('На хосте другой бренд: обычный deploy не имеет права его менять'); } catch (Throwable $error) { fwrite(STDERR, $error->getMessage() . "\n"); exit(1); }