当前位置: 首页>>代码示例>>PHP>>正文


PHP Qiniu_Encode函数代码示例

本文整理汇总了PHP中Qiniu_Encode函数的典型用法代码示例。如果您正苦于以下问题:PHP Qiniu_Encode函数的具体用法?PHP Qiniu_Encode怎么用?PHP Qiniu_Encode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Qiniu_Encode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testEncode

 public function testEncode()
 {
     $cases = array('abc' => 'YWJj', 'abc0=?e' => 'YWJjMD0_ZQ==');
     foreach ($cases as $k => $v) {
         $v1 = Qiniu_Encode($k);
         $this->assertEquals($v, $v1);
     }
 }
开发者ID:timelessmemory,项目名称:uhkklp,代码行数:8,代码来源:AuthDigestTest.php

示例2: Qiniu_Sign

function Qiniu_Sign($url)
{
    //$info里面的url
    $setting = C('UPLOAD_SITEIMG_QINIU');
    $duetime = NOW_TIME + 86400;
    //下载凭证有效时间
    $DownloadUrl = $url . '?e=' . $duetime;
    $Sign = hash_hmac('sha1', $DownloadUrl, $setting["driverConfig"]["secrectKey"], true);
    $EncodedSign = Qiniu_Encode($Sign);
    $Token = $setting["driverConfig"]["accessKey"] . ':' . $EncodedSign;
    $RealDownloadUrl = $DownloadUrl . '&token=' . $Token;
    return $RealDownloadUrl;
}
开发者ID:sunyang3721,项目名称:kuwuya,代码行数:13,代码来源:function.php

示例3: Qiniu_Rio_Mkfile

function Qiniu_Rio_Mkfile($self, $host, $key, $fsize, $extra)
{
    $entry = $extra->Bucket . ':' . $key;
    $url = $host . '/rs-mkfile/' . Qiniu_Encode($entry) . '/fsize/' . $fsize;
    if (!empty($extra->MimeType)) {
        $url .= '/mimeType/' . Qiniu_Encode($extra->MimeType);
    }
    $ctxs = array();
    foreach ($extra->Progresses as $prog) {
        $ctxs[] = $prog['ctx'];
    }
    $body = implode(',', $ctxs);
    return Qiniu_Client_CallWithForm($self, $url, $body, 'text/plain');
}
开发者ID:sungf,项目名称:mmfei,代码行数:14,代码来源:resumable_io.php

示例4: Qiniu_Rio_Mkfile

function Qiniu_Rio_Mkfile($self, $host, $key, $fsize, $extra)
{
    $url = $host . '/mkfile/' . $fsize;
    if ($key !== null) {
        $url .= '/key/' . Qiniu_Encode($key);
    }
    if (!empty($extra->MimeType)) {
        $url .= '/mimeType/' . Qiniu_Encode($extra->MimeType);
    }
    $ctxs = array();
    foreach ($extra->Progresses as $prog) {
        $ctxs[] = $prog['ctx'];
    }
    $body = implode(',', $ctxs);
    return Qiniu_Client_CallWithForm($self, $url, $body, 'application/octet-stream');
}
开发者ID:ijustyce,项目名称:zblogphp,代码行数:16,代码来源:resumable_io.php

示例5: SignWithData

 public function SignWithData($data)
 {
     $data = Qiniu_Encode($data);
     return $this->Sign($data) . ':' . $data;
 }
开发者ID:highestgoodlikewater,项目名称:spider-3,代码行数:5,代码来源:uploader.class.php

示例6: MakeRequest

 public function MakeRequest($url = '')
 {
     $ops = array($this->Mode);
     if (!empty($this->Text)) {
         $ops[] = 'text/' . Qiniu_Encode($this->Text);
     }
     if (!empty($this->Font)) {
         $ops[] = 'font/' . Qiniu_Encode($this->Font);
     }
     if (!empty($this->FontSize)) {
         $ops[] = 'fontsize/' . $this->FontSize;
     }
     if (!empty($this->Fill)) {
         $ops[] = 'fill/' . Qiniu_Encode($this->Fill);
     }
     if (!empty($this->Disslove)) {
         $ops[] = 'dissolve/' . $this->Disslove;
     }
     if (!empty($this->Gravity)) {
         $ops[] = 'gravity/' . $this->Gravity;
     }
     if (!empty($this->Dx)) {
         $ops[] = 'dx/' . $this->Dx;
     }
     if (!empty($this->Dy)) {
         $ops[] = 'dy/' . $this->Dy;
     }
     return $url . 'watermark/' . implode('/', $ops);
 }
开发者ID:zuozuoba,项目名称:zpf,代码行数:29,代码来源:fop.php

示例7: Qiniu_RS_URIMove

function Qiniu_RS_URIMove($bucketSrc, $keySrc, $bucketDest, $keyDest)
{
    return '/move/' . Qiniu_Encode("{$bucketSrc}:{$keySrc}") . '/' . Qiniu_Encode("{$bucketDest}:{$keyDest}");
}
开发者ID:sungf,项目名称:mmfei,代码行数:4,代码来源:rs.php

示例8: Qiniu_accessToken

/**
 * generate_access_token
 * @desc 生成 AccessToken
 * @param string $url
 * @param string $body
 * @return string
 */
function Qiniu_accessToken($url, $body)
{
    $setting = C('UPLOAD_SITEIMG_QINIU');
    $access_key = $setting["driverConfig"]["accessKey"];
    $secret_key = $setting["driverConfig"]["secrectKey"];
    $parsed_url = parse_url($url);
    $path = $parsed_url['path'];
    $access = $path;
    if (isset($parsed_url['query'])) {
        $access .= "?" . $parsed_url['query'];
    }
    $access .= "\n";
    if ($body) {
        $access .= $body;
    }
    $digest = hash_hmac('sha1', $access, $secret_key, true);
    return $access_key . ':' . Qiniu_Encode($digest);
}
开发者ID:CodingBingo,项目名称:VideoSystem,代码行数:25,代码来源:functions.php

示例9: Qiniu_Encode

<?php

require_once "../../qiniu/http.php";
require_once "../../qiniu/auth_digest.php";
require_once "../../qiniu/utils.php";
$accessKey = "";
$secretKey = "";
$bucket = "";
$key = "";
$entry = "{$bucket}:{$key}";
$encodedEntry = Qiniu_Encode($entry);
$apiHost = "http://iovip.qbox.me";
$apiPath = "/prefetch/{$encodedEntry}";
$requestBody = "";
$mac = new Qiniu_Mac($accessKey, $secretKey);
$client = new Qiniu_MacHttpClient($mac);
list($ret, $err) = Qiniu_Client_CallWithForm($client, $apiHost . $apiPath, $requestBody);
if ($err !== null) {
    echo "failed\n";
    var_dump($err);
} else {
    echo "success\n";
}
开发者ID:timelessmemory,项目名称:uhkklp,代码行数:23,代码来源:prefetch.php

示例10: header

<?php

header("Content-Type:application/json");
require_once "../../lib/qiniu/rs.php";
require_once "../../lib/qiniu/utils.php";
require_once "../../qiniu_config.php";
Qiniu_SetKeys($Qiniu_AccessKey, $Qiniu_SecretKey);
$putPolicy = new Qiniu_RS_PutPolicy($Qiniu_Public_Bucket);
$saveBucket = $Qiniu_Public_Bucket;
$saveKey = "test_2.mp4";
//转码指令
$putPolicy->PersistentOps = "avthumb/mp4|saveas/" + Qiniu_Encode($saveBucket + ":" + $saveKey);
//转码队列
$putPolicy->PersistentPipeline = "jemy";
//转码结果通知地址
$putPolicy->PersistentNotifyUrl = "http://www.abc.com/fake/notifyURL";
$token = $putPolicy->Token(null);
$respData = array("uptoken" => $token);
$respBody = json_encode($respData);
echo $respBody;
开发者ID:qiniudemo,项目名称:qiniu-api-server,代码行数:20,代码来源:with_avthumb_mp4.php

示例11: getZipInfo

 public static function getZipInfo($fileList = array(), $saveas = '')
 {
     require_once __DIR__ . '/../qiniu/http.php';
     require_once __DIR__ . '/../qiniu/auth_digest.php';
     require_once __DIR__ . '/../qiniu/utils.php';
     $fops = 'mkzip/2';
     $extraKey = null;
     // var_export($fileList);
     foreach ($fileList as $key => $value) {
         if (preg_match('/^http:\\/\\//', $value)) {
             if (is_int($key)) {
                 $fops .= '/url/' . Qiniu_Encode($value);
             } else {
                 $fops .= '/url/' . Qiniu_Encode($value);
                 // $fops .= '/alias/'.Qiniu_Encode($key);
                 // var_export($key);
                 // var_export(Qiniu_Encode($key));
                 $fops .= '/alias/' . Qiniu_Encode($key);
             }
             if ($extraKey == null) {
                 $extraKey = $value;
             }
         }
     }
     if ($saveas == null) {
         $saveas = md5($fops) . '.zip';
     }
     if ($saveas != null) {
         $fops .= '|saveas/' . Qiniu_Encode(W2Config::$Qiniu_bucket . ':' . $saveas);
     }
     $persistentKey = 'mkzip.' . $saveas . '.pfop';
     $saveFileInfo = W2Qiniu::getFileInfoFromQiniu($saveas);
     if (is_array($saveFileInfo) && array_key_exists('fsize', $saveFileInfo)) {
         return $saveFileInfo;
     }
     $persistentId = W2Qiniu::getKeyContent($persistentKey);
     if (!is_null($persistentId)) {
         return W2Qiniu::getPersistentInfo($persistentId);
     }
     if (strpos($extraKey, W2Config::$Qiniu_domain) != false) {
         $extraKey = str_replace('http://' . W2Config::$Qiniu_domain . '/', '', $extraKey);
     }
     $notifyURL = "";
     $force = 0;
     $encodedBucket = urlencode(W2Config::$Qiniu_bucket);
     $encodedKey = urlencode($extraKey);
     $encodedFops = urlencode($fops);
     $encodedNotifyURL = urlencode($notifyURL);
     $apiHost = "http://api.qiniu.com";
     $apiPath = "/pfop/";
     $requestBody = "bucket={$encodedBucket}&key={$encodedKey}&fops={$encodedFops}&notifyURL={$encodedNotifyURL}";
     if ($force !== 0) {
         $requestBody .= "&force=1";
     }
     $mac = new Qiniu_Mac(W2Config::$Qiniu_accessKey, W2Config::$Qiniu_secretKey);
     $client = new Qiniu_MacHttpClient($mac);
     list($ret, $err) = Qiniu_Client_CallWithForm($client, $apiHost . $apiPath, $requestBody);
     if ($err !== null) {
         var_dump($err);
     } else {
         if (is_array($ret) && array_key_exists('persistentId', $ret)) {
             W2Qiniu::setKeyContent($persistentKey, $ret['persistentId']);
             return W2Qiniu::getPersistentInfo($ret['persistentId']);
         }
         return $ret;
     }
 }
开发者ID:alonexy,项目名称:lea,代码行数:67,代码来源:W2Qiniu.php

示例12: Qiniu_Encode

$destEntry = "{$destBucket}:{$destKey}";
$encodedEntry = Qiniu_Encode($destEntry);
$apiHost = "http://iovip.qbox.me";
$apiPath = "/fetch/{$encodedUrl}/to/{$encodedEntry}";
$requestBody = "";
$mac = new Qiniu_Mac($accessKey, $secretKey);
$client = new Qiniu_MacHttpClient($mac);
list($ret, $err) = Qiniu_Client_CallWithForm($client, $apiHost . $apiPath, $requestBody);
if ($err !== null) {
    echo "failed\n";
    var_dump($err);
} else {
    $bucket = $destBucket;
    $key = $destKey;
    Qiniu_SetKeys($accessKey, $secretKey);
    $entry = Qiniu_Encode($_POST['name'] . ':' . $_POST['title'] . $times . '.mp3');
    $url = "avthumb/mp3|saveas/{$entry}";
    $fops = $url;
    $notifyURL = "";
    $force = 0;
    $encodedBucket = urlencode($bucket);
    $encodedKey = urlencode($key);
    $encodedFops = urlencode($fops);
    $encodedNotifyURL = urlencode($notifyURL);
    $apiHost = "http://api.qiniu.com";
    $apiPath = "/pfop/";
    $requestBody = "bucket={$encodedBucket}&key={$encodedKey}&fops={$encodedFops}&notifyURL={$encodedNotifyURL}";
    if ($force !== 0) {
        $requestBody .= "&force=1";
    }
    $mac = new Qiniu_Mac($accessKey, $secretKey);
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:31,代码来源:api.php

示例13: Qiniu_Encode

<?php

require_once "../../qiniu/http.php";
require_once "../../qiniu/auth_digest.php";
require_once "../../qiniu/utils.php";
$accessKey = "";
$secretKey = "";
$targetUrl = "";
$destBucket = "";
$destKey = "";
$encodedUrl = Qiniu_Encode($targetUrl);
$destEntry = "{$destBucket}:{$destKey}";
$encodedEntry = Qiniu_Encode($destEntry);
$apiHost = "http://iovip.qbox.me";
$apiPath = "/fetch/{$encodedUrl}/to/{$encodedEntry}";
$requestBody = "";
$mac = new Qiniu_Mac($accessKey, $secretKey);
$client = new Qiniu_MacHttpClient($mac);
list($ret, $err) = Qiniu_Client_CallWithForm($client, $apiHost . $apiPath, $requestBody);
if ($err !== null) {
    echo "failed\n";
    var_dump($err);
} else {
    echo "success\n";
}
开发者ID:timelessmemory,项目名称:uhkklp,代码行数:25,代码来源:fetch.php

示例14: date

 $pfop->Key = $nfilename;
 if ($audiotype == 'music') {
     $nfilenamefop = 'FMFOPM' . date('YmdHis') . random(16) . '.mp3';
     $savedKey = $nfilenamefop;
     $entry = Qiniu_Encode("{$pfop->Bucket}:{$savedKey}");
     $pfop->Fops = "avthumb/mp3/aq/{$aq}/ar/44100|saveas/{$entry}";
 } elseif ($audiotype == 'voice') {
     $nfilenamefop = 'FMVOICEFOPM' . date('YmdHis') . random(16) . '.mp3';
     $savedKey = $nfilenamefop;
     $entry = Qiniu_Encode("{$pfop->Bucket}:{$savedKey}");
     $pfop->Fops = "avthumb/mp3/aq/{$aq}/ar/44100|saveas/{$entry}";
 } elseif ($audiotype == 'vedio') {
     $nfilenamefop = 'FMFOPV' . date('YmdHis') . random(16) . '.mp4';
     $savedKey = $nfilenamefop;
     $entry = Qiniu_Encode("{$pfop->Bucket}:{$savedKey}");
     $image = Qiniu_Encode("{$videologo}");
     $pfop->Fops = "avthumb/mp4/wmImage/{$image}/wmGravity/{$wmgravity}/vcodec/libx264/s/{$videofbl}/rotate/auto|saveas/{$entry}";
 }
 if ($pipeline) {
     $pfop->Pipeline = $pipeline;
 }
 list($ret, $err) = $pfop->MakeRequest($client);
 //$pfop->Force = 1;
 //echo "\n\n====> pfop result: \n";
 if ($err !== null) {
     //var_dump($err);
     $fmdata = array("success" => -1, "msg" => $err);
     //echo json_encode($fmdata);
     echo json_encode($fmdata);
     exit;
 } else {
开发者ID:eduNeusoft,项目名称:weixin,代码行数:31,代码来源:api.php

示例15: Qiniu_RS_Fetch

function Qiniu_RS_Fetch($self, $url, $bucket, $key)
{
    global $QINIU_IOVIP_HOST;
    $path = '/fetch/' . Qiniu_Encode($url) . '/to/' . Qiniu_Encode("{$bucket}:{$key}");
    return Qiniu_Client_CallNoRet($self, $QINIU_IOVIP_HOST . $path);
}
开发者ID:huangbinzd,项目名称:kppwGit,代码行数:6,代码来源:rs.php


注:本文中的Qiniu_Encode函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。