本文整理汇总了PHP中URLify::GetLatinSafeFileName方法的典型用法代码示例。如果您正苦于以下问题:PHP URLify::GetLatinSafeFileName方法的具体用法?PHP URLify::GetLatinSafeFileName怎么用?PHP URLify::GetLatinSafeFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URLify
的用法示例。
在下文中一共展示了URLify::GetLatinSafeFileName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UploadTovarImage
function UploadTovarImage($AFileInputName, $APath, $ANewFileName, $AMax_image_x, $AMax_image_y, $AWatermark_position = '', $AWatermark_FileRelativeURL = '', $AFixedSourceFileName = '', $ANewFileExt = '')
{
$vError = "";
$vFileRelativeURL = "";
if (empty($AFixedSourceFileName)) {
$ImgUploader = new Upload($_FILES[$AFileInputName], "ru_RU");
} else {
$ImgUploader = new Upload($AFixedSourceFileName, "ru_RU");
}
if ($ImgUploader->uploaded) {
$ImgUploader->file_overwrite = true;
//$ImgUploader->file_new_name_body = $ANewFileName;
$ImgUploader->file_new_name_body = URLify::GetLatinSafeFileName($ANewFileName);
if (!empty($ANewFileExt)) {
$ImgUploader->file_new_name_ext = $ANewFileExt;
}
if (!empty($AWatermark_position) && $AWatermark_position != '00' && !empty($AWatermark_FileRelativeURL)) {
$ImgUploader->image_watermark_position = $AWatermark_position;
$ImgUploader->image_watermark = DIR_DBIMAGES . 'comission/' . $AWatermark_FileRelativeURL;
}
if ($AMax_image_x != 0 && $AMax_image_y != 0) {
if ($ImgUploader->image_src_x > $AMax_image_x || $ImgUploader->image_src_y > $AMax_image_y) {
$ImgUploader->image_resize = true;
$ImgUploader->image_x = $AMax_image_x;
$ImgUploader->image_y = $AMax_image_y;
$ImgUploader->image_ratio = true;
} else {
$ImgUploader->image_resize = false;
$ImgUploader->image_x = $ImgUploader->image_src_x;
$ImgUploader->image_y = $ImgUploader->image_src_y;
$ImgUploader->image_ratio = false;
}
}
//$ImgUploader->image_convert = gif;
//$ImgUploader->image_ratio_y = true;
$UploadDir = MakeDirForWrite($APath);
$ImgUploader->Process($UploadDir);
if ($ImgUploader->processed) {
$vFileRelativeURL = $APath . $ANewFileName . "." . $ImgUploader->file_dst_name_ext;
$ImgUploader->Clean();
} else {
$vError = $ImgUploader->error;
}
} else {
$vError = $ImgUploader->error;
}
return array($vError, $vFileRelativeURL);
}