本文整理匯總了PHP中PerchUtil::initialise_resource_bucket方法的典型用法代碼示例。如果您正苦於以下問題:PHP PerchUtil::initialise_resource_bucket方法的具體用法?PHP PerchUtil::initialise_resource_bucket怎麽用?PHP PerchUtil::initialise_resource_bucket使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PerchUtil
的用法示例。
在下文中一共展示了PerchUtil::initialise_resource_bucket方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
case 'dynamic':
$Album = $Albums->find($albumID);
if (is_object($Album)) {
$bucket_name = $Album->albumSlug();
}
break;
default:
$bucket_name = $Settings->get('perch_gallery_bucket')->val();
break;
}
if ($bucket_name == '') {
$bucket_name = 'default';
}
$Perch = Perch::fetch();
$bucket = $Perch->get_resource_bucket($bucket_name);
PerchUtil::initialise_resource_bucket($bucket);
$targetDir = $bucket['file_path'];
$image_folder_writable = is_writable($targetDir);
$filesize = 0;
if (isset($_FILES['upload'])) {
$file = $_FILES['upload']['name'];
$filesize = $_FILES['upload']['size'];
}
// if file is greater than 0 process it into resources
if ($filesize > 0) {
if ($image_folder_writable && isset($file)) {
$filename = PerchUtil::tidy_file_name($file);
if (strpos($filename, '.php') !== false) {
$filename .= '.txt';
}
//checking for naughty uploading of php files.