function upload_by_multi_part($obj, $object, $filepath, $partsize = "5242880") { //$object = 'Mining.the.Social.Web-'.time().'.pdf'; //英文 //$filepath = "D:\\Book\\Mining.the.Social.Web.pdf"; //英文 $options = array(ALIOSS::OSS_FILE_UPLOAD => $filepath, 'partSize' => 5242880); $response = $obj->create_mpu_object(OSS_BUCKET, $object, $options); _format($response); return $response->isOK(); }
function upload_by_multi_part($obj) { $bucket = 'phpsdk1349849394'; $object = 'Mining.the.Social.Web-' . time() . '.pdf'; //英文 $filepath = "D:\\Book\\Mining.the.Social.Web.pdf"; //英文 $options = array(ALIOSS::OSS_FILE_UPLOAD => $filepath, 'partSize' => 5242880); $response = $obj->create_mpu_object($bucket, $object, $options); _format($response); }
define('M_LOG', './m.log'); //设置存储log的路径,可以放置在任意位置 define('M_FILE', './f.log'); //待上传的文件列表 $filesarr = array(); //待更新文件 if (file_exists(M_FILE)) { _log('m file is exists.'); $filesarr = unserialize(file_get_contents(M_FILE)); foreach ($filesarr as $key => $file) { _log('m file :' . $file); //上传动作: $object = str_replace($host, "", $file); $file_path = $file; $response = $oss_sdk_service->upload_file_by_file($bucket, $object, $file_path); _format($response); unset($filesarr[$key]); file_put_contents(M_FILE, serialize($filesarr)); } @unlink(M_FILE); exit; } $file_list = array(); foreach ($floder as $f) { record_md5($f); } if (file_exists(M_LOG)) { $log = unserialize(file_get_contents(M_LOG)); } else { $log = array(); }
?> <div class="b-icon b-icon__tu2_gray" title="Количество продаж услуги"></div> <span class="b-txt b-txt_lh_1 b-txt_fs_14 b-txt_padright_20" title="Количество продаж услуги"><?php echo number_format($sold_count, 0, '', ' '); ?> </span> <?php } ?> <?php if ($tservice['total_feedbacks'] != 0) { ?> <div class="b-icon b-icon__cat_thumbsup_gray b-icon__cat_thumbsup2_wh_13 b-icon_top_-1" title="Процент положительных отзывов об услуге"></div> <span class="b-txt b-txt_lh_1 b-txt_fs_14 b-txt_padright_20" title="Процент положительных отзывов об услуге"><?php echo _format($tservice['plus_feedbacks'] / $tservice['total_feedbacks'] * 100, 0); ?> %</span> <?php } ?> <div class="b-icon b-icon__time_gray" title="Срок выполнения услуги"></div> <span class="b-txt b-txt_lh_1 b-txt_fs_14" title="Срок выполнения услуги"><?php echo $tservice['days']; ?> <?php echo ending($tservice['days'], 'день', 'дня', 'дней'); ?> </span> <?php
function number2human($number, $showCurrency = true) { $currency = ''; $suffix = ''; if ($showCurrency) { // FIXME: Make currency configurable //$currency = 'ISK '; $currency = ''; } if (abs($number) >= 500000000) { $number = $number / 1000000000; $suffix = 'T'; } if (abs($number) >= 500000) { $number = $number / 1000000; $suffix = 'M'; } if (abs($number) >= 500) { $number = $number / 1000; $suffix = 'K'; } return $currency . _format($number) . $suffix; }