Files
progcode/web/public/assets/editorial/2018/curl-outcome-classifier.svg
T
huncode 90692f0f16
Build and deploy / deploy (push) Successful in 15s
raise editorial quality gate and revise 2018 spring
2026-07-31 09:20:37 +03:00

47 lines
3.7 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 620" role="img" aria-labelledby="title desc">
<title id="title">Три уровня результата cURL-интеграции</title>
<desc id="desc">После curl_exec сначала проверяется false и ошибка транспорта, затем код HTTP, а затем контракт тела ответа.</desc>
<defs>
<linearGradient id="background" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" stop-color="#1f2437"/>
<stop offset="1" stop-color="#3b315f"/>
</linearGradient>
<marker id="flow-arrow" markerWidth="10" markerHeight="10" refX="9" refY="5" orient="auto">
<path d="M0 0 L10 5 L0 10z" fill="#f8e9ac"/>
</marker>
</defs>
<rect width="1200" height="620" rx="34" fill="url(#background)"/>
<text x="74" y="88" fill="#fff9e4" font-family="Arial, sans-serif" font-size="32" font-weight="700">cURL отвечает за передачу, а не за успех операции</text>
<text x="74" y="125" fill="#d1c5e6" font-family="Arial, sans-serif" font-size="19">Проверки идут слева направо: транспорт → HTTP → полезная нагрузка</text>
<g font-family="Arial, sans-serif">
<rect x="75" y="228" width="194" height="116" rx="18" fill="#f8e9ac"/>
<text x="109" y="275" fill="#352f52" font-size="22" font-weight="700">curl_exec()</text>
<text x="118" y="310" fill="#352f52" font-size="17">получить тело</text>
<path d="M269 286 H385" fill="none" stroke="#f8e9ac" stroke-width="5" marker-end="url(#flow-arrow)"/>
<rect x="405" y="228" width="200" height="116" rx="18" fill="#e4d7ff"/>
<text x="438" y="274" fill="#352f52" font-size="22" font-weight="700">body === false?</text>
<text x="450" y="310" fill="#352f52" font-size="17">cURL + сеть</text>
<path d="M505 344 V439 H325" fill="none" stroke="#f8e9ac" stroke-width="5" marker-end="url(#flow-arrow)"/>
<text x="422" y="405" fill="#f8e9ac" font-size="16">да</text>
<rect x="112" y="438" width="214" height="104" rx="18" fill="#f2b8ae"/>
<text x="145" y="481" fill="#5d2427" font-size="21" font-weight="700">transport error</text>
<text x="151" y="514" fill="#5d2427" font-size="16">errno, error, time</text>
<path d="M605 286 H695" fill="none" stroke="#f8e9ac" stroke-width="5" marker-end="url(#flow-arrow)"/>
<text x="636" y="265" fill="#f8e9ac" font-size="16">нет</text>
<rect x="715" y="228" width="182" height="116" rx="18" fill="#b8e8e0"/>
<text x="745" y="274" fill="#21423f" font-size="22" font-weight="700">HTTP 2xx?</text>
<text x="737" y="310" fill="#21423f" font-size="17">curl_getinfo</text>
<path d="M806 344 V439 H965" fill="none" stroke="#f8e9ac" stroke-width="5" marker-end="url(#flow-arrow)"/>
<text x="842" y="405" fill="#f8e9ac" font-size="16">нет</text>
<rect x="966" y="438" width="170" height="104" rx="18" fill="#f2b8ae"/>
<text x="1003" y="481" fill="#5d2427" font-size="21" font-weight="700">HTTP error</text>
<text x="992" y="514" fill="#5d2427" font-size="16">status + route</text>
<path d="M897 286 H995" fill="none" stroke="#f8e9ac" stroke-width="5" marker-end="url(#flow-arrow)"/>
<text x="927" y="265" fill="#f8e9ac" font-size="16">да</text>
<rect x="1015" y="228" width="121" height="116" rx="18" fill="#d4e8ff"/>
<text x="1045" y="274" fill="#294465" font-size="21" font-weight="700">Тело</text>
<text x="1032" y="310" fill="#294465" font-size="16">контракт</text>
</g>
<text x="75" y="585" fill="#d1c5e6" font-family="Arial, sans-serif" font-size="18">Статус 404 или 500 может прийти как строка: это не false для curl_exec().</text>
</svg>