本文整理汇总了PHP中FileUtils::ForceDirectories方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUtils::ForceDirectories方法的具体用法?PHP FileUtils::ForceDirectories怎么用?PHP FileUtils::ForceDirectories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtils
的用法示例。
在下文中一共展示了FileUtils::ForceDirectories方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: picture_GenerateFileName_insert
public function picture_GenerateFileName_insert(&$filepath, &$handled, $original_file_name, $original_file_extension, $file_size)
{
$targetFolder = FormatDatasetFieldsTemplate($this->GetDataset(), 'images');
FileUtils::ForceDirectories($targetFolder);
$filename = ApplyVarablesMapToTemplate('%original_file_name%', array('original_file_name' => $original_file_name, 'original_file_extension' => $original_file_extension, 'file_size' => $file_size));
$filepath = Path::Combine($targetFolder, $filename);
$handled = true;
}
示例2: GetThumbnailFileName
private function GetThumbnailFileName($original_file_name, $original_file_extension, $file_size)
{
$result = '';
$handled = false;
$this->generateFileNameDelegate->CallFromArray(array(&$result, &$handled, $original_file_name, $original_file_extension, $file_size));
$targetFolder = FormatDatasetFieldsTemplate($this->GetDataset(), $this->directoryToSaveThumbnails);
FileUtils::ForceDirectories($this->directoryToSaveThumbnails);
if (!$handled) {
$filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
$result = Path::Combine($targetFolder, $filename);
while (file_exists($result)) {
$filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
$result = Path::Combine($targetFolder, $filename);
}
}
return $result;
}
示例3: image_GenerateFileName_insert
public function image_GenerateFileName_insert(&$filepath, &$handled, $original_file_name, $original_file_extension, $file_size)
{
$targetFolder = FormatDatasetFieldsTemplate($this->GetDataset(), 'ckupload');
FileUtils::ForceDirectories($targetFolder);
$filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
$filepath = Path::Combine($targetFolder, $filename);
while (file_exists($filepath)) {
$filename = FileUtils::AppendFileExtension(rand(), $original_file_extension);
$filepath = Path::Combine($targetFolder, $filename);
}
$handled = true;
}