本文整理匯總了PHP中Vtiger_Functions::getCompressInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vtiger_Functions::getCompressInfo方法的具體用法?PHP Vtiger_Functions::getCompressInfo怎麽用?PHP Vtiger_Functions::getCompressInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vtiger_Functions
的用法示例。
在下文中一共展示了Vtiger_Functions::getCompressInfo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: checkAndConvertJsScripts
function checkAndConvertJsScripts($jsFileNames)
{
$fileExtension = 'js';
$min = Vtiger_Functions::getCompressInfo('js');
$jsScriptInstances = array();
foreach ($jsFileNames as $jsFileName) {
// TODO Handle absolute inclusions (~/...) like in checkAndConvertCssStyles
$jsScript = new Vtiger_JsScript_Model();
// external javascript source file handling
if (strpos($jsFileName, 'http://') === 0 || strpos($jsFileName, 'https://') === 0) {
$jsScriptInstances[$jsFileName] = $jsScript->set('src', $jsFileName);
continue;
}
$completeFilePath = Vtiger_Loader::resolveNameToPath($jsFileName, $fileExtension);
if (file_exists($completeFilePath)) {
if (strpos($jsFileName, '~') === 0) {
$filePath = ltrim(ltrim($jsFileName, '~'), '/');
// if ~~ (reference is outside vtiger6 folder)
if (substr_count($jsFileName, "~") == 2) {
$filePath = "../" . $filePath;
}
} else {
$filePath = str_replace('.', '/', $jsFileName) . '.' . $fileExtension;
}
$jsScriptInstances[$jsFileName] = $jsScript->set('src', $filePath);
} else {
$fallBackFilePath = Vtiger_Loader::resolveNameToPath(Vtiger_JavaScript::getBaseJavaScriptPath() . '/' . $jsFileName . $min, 'js');
if (file_exists($fallBackFilePath)) {
$filePath = str_replace('.', '/', $jsFileName) . $min . '.js';
$jsScriptInstances[$jsFileName] = $jsScript->set('src', Vtiger_JavaScript::getFilePath($filePath));
}
$fallBackFilePath = Vtiger_Loader::resolveNameToPath(Vtiger_JavaScript::getBaseJavaScriptPath() . '/' . $jsFileName, 'js');
if (file_exists($fallBackFilePath)) {
$filePath = str_replace('.', '/', $jsFileName) . '.js';
$jsScriptInstances[$jsFileName] = $jsScript->set('src', Vtiger_JavaScript::getFilePath($filePath));
}
}
}
return $jsScriptInstances;
}