Файл: Проектирование реализации операций бизнес-процесса «Планирование закупок и размещение заказов поставщикам.pdf

ВУЗ: Не указан

Категория: Курсовая работа

Дисциплина: Не указана

Добавлен: 31.03.2023

Просмотров: 73

Скачиваний: 2

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

!in_array($fileType, $settings['gzipExceptions']) &&

in_array('gzip', array_map('trim', explode(',' , @$_SERVER['HTTP_ACCEPT_ENCODING']))) &&

function_exists('gzencode'));

if ($settings['gzip']) header("Content-Encoding: gzip");

$settings['minify'] = $settings['minify'] && file_exists('minifiers/'.$fileType.'.php');

$settings['embed'] = $settings['embed'] && $fileType == 'css' && (!preg_match('/msie/i', $_SERVER['HTTP_USER_AGENT']) || preg_match('/msie 8|opera/i', $_SERVER['HTTP_USER_AGENT']));

$settings['serverCache'] = $settings['serverCache'] && ($settings['minify'] || $settings['gzip'] || $settings['concatenate'] || $settings['embed']);

if ($settings['serverCache']) {

$cachedFile = $settings['cacheDir'].$settings['cachePrefix'].md5($query.($settings['embed']?'1':'0')).'.'.$fileType.($settings['gzip'] ? '.gz' : '');

}

$generateContent = ((!$settings['serverCache'] && (!$settings['clientCache'] || !$settings['clientCacheCheck'] || !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || $_SERVER['HTTP_IF_MODIFIED_SINCE'] != gmdatestr(filesmtime()))) ||

($settings['serverCache'] && (!file_exists($cachedFile) || ($settings['serverCacheCheck'] && filesmtime() > filemtime($cachedFile)))));

if ($settings['clientCache'] && $settings['clientCacheCheck']) {

if ($settings['serverCache'] && !$generateContent) $mtime = filemtime($cachedFile);

elseif ($settings['serverCache']) $mtime = time();

else $mtime = filesmtime();

$mtimestr = gmdatestr($mtime);

}

if (!$settings['clientCache'] || !$settings['clientCacheCheck'] || !isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || $_SERVER['HTTP_IF_MODIFIED_SINCE'] != $mtimestr) {

if ($settings['clientCache'] && $settings['clientCacheCheck']) {

header("Last-Modified: " . $mtimestr);

header("Cache-Control: must-revalidate");

} elseif ($settings['clientCache']) {

headerNeverExpire();

} else headerNoCache();

if ($generateContent) {

if ($settings['minify']) include('minifiers/'.$fileType.'.php');

$content = array();

foreach ($files as $file) (($content[] = @file_get_contents($file)) !== false) || debugExit("File not found ($file).");

$content = implode("\n", $content);

if ($settings['minify']) $content = call_user_func('minify_' . $fileType, $content);

if ($settings['gzip']) $content = gzencode($content, $settings['compressionLevel']);

if ($settings['serverCache']) {

$handle = @fopen($cachedFile, 'w') or debugExit("Could not create cache file($cachedFile).");

fwrite($handle, $content);

fclose($handle);

}

header('Content-Length: ' . strlen($content));

echo $content;

} else {

header('Content-Length: ' . filesize($cachedFile));

readfile($cachedFile);

}

} else headerExit('304 Not Modified');

?>

<?php

/*

* SmartOptimizer CSS Minifier

*/

function convertUrl($url, $count)

{

global $settings, $mimeTypes, $fileDir;

static $baseUrl = '';

$url = trim($url);

if (preg_match('@^[^/]+:@', $url)) return $url;

$fileType = substr(strrchr($url, '.'), 1);

if (isset($mimeTypes[$fileType])) $mimeType = $mimeTypes[$fileType];

elseif (function_exists('mime_content_type')) $mimeType = mime_content_type($url);

else $mimeType = null;

if (!$settings['embed'] ||

!file_exists($fileDir.$url) ||

($settings['embedMaxSize'] > 0 && filesize($fileDir.$url) > $settings['embedMaxSize']) ||

!$fileType ||

in_array($fileType, $settings['embedExceptions']) ||

!$mimeType ||

$count > 1) {

if (strpos($_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME'].'?') === 0 ||

strpos($_SERVER['REQUEST_URI'], rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/').'/?') === 0) {

if (!$baseUrl) return $fileDir . $url;

}

return $baseUrl . $url;

}

$contents = file_get_contents($fileDir.$url);

if ($fileType == 'css') {

$oldFileDir = $fileDir;

$fileDir = rtrim(dirname($fileDir.$url), '\/').'/';

$oldBaseUrl = $baseUrl;

$baseUrl = 'http'.(@$_SERVER['HTTPS']?'s':'').'://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/').'/'.$fileDir;