$headers = array(
'cache-control: max-age=0',
'upgrade-insecure-requests: 1',
'sec-fetch-user: ?1',
'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
'x-compress: null',
'sec-fetch-site: none',
'sec-fetch-mode: navigate',
'accept-encoding: deflate, br',
'accept-language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
"Content-Type: application/json",
'X-Atlassian-Token: no-check',
);
<?php
if($_GET['action'] == 'profile'){
require_once($_SERVER['DOCUMENT_ROOT'].'/profile/index.php');
} elseif ($_GET['action'] == 'info') {
require_once($_SERVER['DOCUMENT_ROOT'].'/info.php');
}
?>
location / {
try_files $uri $uri/ /index.php?$query_string;
}
<?php
$success = mail('example@example.com', 'My Subject', $message);
if (!$success) {
$errorMessage = error_get_last()['message'];
}
?>
$IblockID = 1;
$res = CIBlockElement::GetList([], ['IBLOCK_ID' => $IblockID], false, false, ['IBLOCK_ID', 'NAME', 'PROPERTY_ISEMPTY']);
while($item = $res -> Fetch())
{
if($item['PROPERTY_ISEMPTY_VALUE'])
{
$arResult['FILLED'][] = $item;
}
else
{
$arResult['EMPTY'][] = $item;
}
}
server {
listen 80;
server_name blog.zeroxzed.ru;
access_log /var/log/nginx/blog.zeroxzed.ru-access.log;
error_log /var/log/nginx/blog.zeroxzed.ru-error.log;
location / {
proxy_pass http://192.168.13.31;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}
kubectl get ingress
$Longest_Path = new CLongestPathBuilder($routes); // создаем экземпляр класса
$Longest_Path -> printLongestPath(); // выводим информацию о самом долгом маршруте
Class CLongestPathBuilder
{
protected $arResult = [];
protected $iterator = 0;
function __construct($routes)
{
// Sorting routes array by date (dt_start field)
try
{
$this->arResult['routes'] = CExtraTools::sortArrayByDate($routes);
}
catch(Exception $e)
{
echo $e->GetMessage();
exit(1);
}
foreach($this->arResult['routes'] as $route)
{
$this->arResult['path'][$this->iterator]['full_path'] .= $route['start'].' -> '.$route['finish'];
$this->arResult['path'][$this->iterator]['routes_count'] = 1;
// Trying to find all available routes from last destination ($route['finish'])
$this->getRoutes($route);
$this->iterator++;
}
}
protected function getRoutes($route1)
{
// Get available routes from last destination
if(!$this->arResult['path'][$this->iterator]['prev_date'])
{
$this->arResult['path'][$this->iterator]['prev_date'] = $route1['dt_start'];
}
foreach($this->arResult['routes'] as $route2)
{
if( ($route1['start'] != $route2['start']) && ($route1['finish'] == $route2['start']) && ($this->arResult['path'][$this->iterator]['prev_date'] < $route2['dt_start']) )
{
$this->arResult['path'][$this->iterator]['full_path'] .= ' -> '.$route2['finish'];
$this->arResult['path'][$this->iterator]['days'] += CExtraTools::diffDates($route1['dt_start'], $route2['dt_start']);
$this->arResult['path'][$this->iterator]['dates'][] = $route1['dt_start'].' - '.$route2['dt_start'];
$this->arResult['path'][$this->iterator]['prev_date'] = $route2['dt_start'];
$this->arResult['path'][$this->iterator]['routes_count']++; // Number of routes in the path
$this->setLongest($this->arResult['path'][$this->iterator]['days']); // Setting current path as the longest one
$this->getRoutes($route2);
}
}
}
protected function setLongest($duration)
{
// a function used to set longest path
if($duration > $this->arResult['longest_path']['days'])
{
$this->arResult['longest_path'] = $this->arResult['path'][$this->iterator];
}
}
public function getLongest()
{
// a function used to get longest path
return $this->arResult['longest_path'];
}
public function getPaths()
{
// a function used to get longest path
return $this->arResult['path'];
}
public function printAllPaths()
{
CExtraTools::pre($this->arResult['path']);
}
public function printLongestPath()
{
CExtraTools::pre($this->arResult['longest_path']);
}
}
Class CExtraTools
{
public static function diffDates($date1, $date2)
{
// The function to count the difference between two dates
try
{
$datetime1 = new DateTime($date1);
$datetime2 = new DateTime($date2);
}
catch (Exception $e) {
echo $e->getMessage();
exit(1);
}
$interval = $datetime1->diff($datetime2);
return $interval->invert ? $interval->days*(-1) : $interval->days;
}
public static function pre($var)
{
// modification of print_r method
echo '<pre>';
print_r($var);
echo '</pre>';
}
protected static function cmp($a, $b)
{
// only to sort array in sortArrayByDate() function
if ($a['dt_start'] == $b['dt_start']) {
return 0;
}
return ($a['dt_start'] < $b['dt_start']) ? -1 : 1;
}
public static function sortArrayByDate($array)
{
// Sort array by date (dt_start field)
if(!is_array($array))
{
throw new Exception('Должен быть передан массив');
}
usort($array, "self::cmp");
return $array;
}
}
$git_branches = exec('git push origin master:'.$_GET["REMOTE"].' 2>&1', $stdin, $stderr);
<script></script>
, CSS -> <style></style>
и HTML -> <body></body>
)