├── .gitignore
├── README.md
├── class
├── PdoMySQL.class.php
├── config.php
├── doAction.php
└── url.php
├── favicon.ico
├── index.php
├── login.php
├── sql
└── chat.sql
├── static
├── css
│ ├── bootstrap.min.css
│ ├── contextMenu.css
│ ├── font-awesome.min.css
│ ├── menu.css
│ └── templatemo-style.css
├── fonts
│ ├── FontAwesome.otf
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.svg
│ ├── fontawesome-webfont.ttf
│ ├── fontawesome-webfont.woff
│ └── fontawesome-webfont.woff2
├── img
│ └── tel.jpg
├── js
│ ├── bootstrap-filestyle.min.js
│ ├── contextMenu.js
│ ├── jquery-1.11.2.min.js
│ ├── jquery-3.1.1.min.js
│ ├── jquery-migrate-1.2.1.min.js
│ ├── socket.js
│ ├── strophe-1.2.8.min.js
│ ├── strophe-1.2.8.min.js.map
│ ├── templatemo-script.js
│ ├── webim.config.js
│ └── websdk-1.4.13.js
└── layui
│ ├── css
│ ├── layui.css
│ ├── layui.demo.css
│ ├── layui.mobile.css
│ └── modules
│ │ ├── code.css
│ │ ├── laydate
│ │ └── default
│ │ │ ├── font.css
│ │ │ └── laydate.css
│ │ ├── layer
│ │ └── default
│ │ │ ├── icon-ext.png
│ │ │ ├── icon.png
│ │ │ ├── layer.css
│ │ │ ├── loading-0.gif
│ │ │ ├── loading-1.gif
│ │ │ └── loading-2.gif
│ │ └── layim
│ │ ├── html
│ │ ├── chatlog.html
│ │ ├── createGroup.html
│ │ ├── find.html
│ │ ├── getInformation.html
│ │ └── msgbox.html
│ │ ├── layim.css
│ │ ├── mobile
│ │ └── layim.css
│ │ ├── skin
│ │ ├── 1.jpg
│ │ ├── 2.jpg
│ │ ├── 3.jpg
│ │ ├── 4.jpg
│ │ ├── 5.jpg
│ │ └── logo.jpg
│ │ └── voice
│ │ └── default.mp3
│ ├── font
│ ├── iconfont.eot
│ ├── iconfont.svg
│ ├── iconfont.ttf
│ └── iconfont.woff
│ ├── images
│ ├── easemob_face
│ │ ├── ee_1.png
│ │ ├── ee_10.png
│ │ ├── ee_11.png
│ │ ├── ee_12.png
│ │ ├── ee_13.png
│ │ ├── ee_14.png
│ │ ├── ee_15.png
│ │ ├── ee_16.png
│ │ ├── ee_17.png
│ │ ├── ee_18.png
│ │ ├── ee_19.png
│ │ ├── ee_2.png
│ │ ├── ee_20.png
│ │ ├── ee_21.png
│ │ ├── ee_22.png
│ │ ├── ee_23.png
│ │ ├── ee_24.png
│ │ ├── ee_25.png
│ │ ├── ee_26.png
│ │ ├── ee_27.png
│ │ ├── ee_28.png
│ │ ├── ee_29.png
│ │ ├── ee_3.png
│ │ ├── ee_30.png
│ │ ├── ee_31.png
│ │ ├── ee_32.png
│ │ ├── ee_33.png
│ │ ├── ee_34.png
│ │ ├── ee_35.png
│ │ ├── ee_4.png
│ │ ├── ee_5.png
│ │ ├── ee_6.png
│ │ ├── ee_7.png
│ │ ├── ee_8.png
│ │ └── ee_9.png
│ └── face
│ │ ├── 0.gif
│ │ ├── 1.gif
│ │ ├── 10.gif
│ │ ├── 11.gif
│ │ ├── 12.gif
│ │ ├── 13.gif
│ │ ├── 14.gif
│ │ ├── 15.gif
│ │ ├── 16.gif
│ │ ├── 17.gif
│ │ ├── 18.gif
│ │ ├── 19.gif
│ │ ├── 2.gif
│ │ ├── 20.gif
│ │ ├── 21.gif
│ │ ├── 22.gif
│ │ ├── 23.gif
│ │ ├── 24.gif
│ │ ├── 25.gif
│ │ ├── 26.gif
│ │ ├── 27.gif
│ │ ├── 28.gif
│ │ ├── 29.gif
│ │ ├── 3.gif
│ │ ├── 30.gif
│ │ ├── 31.gif
│ │ ├── 32.gif
│ │ ├── 33.gif
│ │ ├── 34.gif
│ │ ├── 35.gif
│ │ ├── 36.gif
│ │ ├── 37.gif
│ │ ├── 38.gif
│ │ ├── 39.gif
│ │ ├── 4.gif
│ │ ├── 40.gif
│ │ ├── 41.gif
│ │ ├── 42.gif
│ │ ├── 43.gif
│ │ ├── 44.gif
│ │ ├── 45.gif
│ │ ├── 46.gif
│ │ ├── 47.gif
│ │ ├── 48.gif
│ │ ├── 49.gif
│ │ ├── 5.gif
│ │ ├── 50.gif
│ │ ├── 51.gif
│ │ ├── 52.gif
│ │ ├── 53.gif
│ │ ├── 54.gif
│ │ ├── 55.gif
│ │ ├── 56.gif
│ │ ├── 57.gif
│ │ ├── 58.gif
│ │ ├── 59.gif
│ │ ├── 6.gif
│ │ ├── 60.gif
│ │ ├── 61.gif
│ │ ├── 62.gif
│ │ ├── 63.gif
│ │ ├── 64.gif
│ │ ├── 65.gif
│ │ ├── 66.gif
│ │ ├── 67.gif
│ │ ├── 68.gif
│ │ ├── 69.gif
│ │ ├── 7.gif
│ │ ├── 70.gif
│ │ ├── 71.gif
│ │ ├── 8.gif
│ │ └── 9.gif
│ ├── lay
│ ├── all-mobile.js
│ ├── all.js
│ └── modules
│ │ ├── code.js
│ │ ├── element.js
│ │ ├── flow.js
│ │ ├── form.js
│ │ ├── jquery.js
│ │ ├── laydate.js
│ │ ├── layedit.js
│ │ ├── layer.js
│ │ ├── laypage.js
│ │ ├── laytpl.js
│ │ ├── mobile.js
│ │ ├── mobile
│ │ ├── layer-mobile.js
│ │ ├── layim-mobile-open.js
│ │ ├── upload-mobile.js
│ │ └── zepto.js
│ │ ├── tree.js
│ │ ├── upload.js
│ │ └── util.js
│ └── layui.js
├── uploads
├── person
│ ├── 1570845.jpg
│ ├── 1570855.jpg
│ ├── 32403609419777.jpg
│ ├── 32403628294145.jpg
│ ├── 34331010596865.jpg
│ ├── 34501063409665.jpg
│ ├── 3492303870361.jpg
│ ├── 34923038703617.jpg
│ ├── 35297058422786.jpg
│ ├── 36682917281793.jpg
│ ├── 910992.jpg
│ ├── 911058.jpg
│ ├── 911067.jpg
│ ├── 911085.jpg
│ ├── 911088.jpg
│ ├── 911100.jpg
│ ├── 911117.jpg
│ ├── empty1.jpg
│ └── empty2.jpg
└── skin
│ ├── 910992_1514954456.png
│ └── 911117_1513692322.jpg
└── vendor
└── qiniuSDK
├── .gitignore
├── .scrutinizer.yml
├── .travis.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── autoload.php
├── composer.json
├── examples
├── README.md
├── cdn_get_bandwidth.php
├── cdn_get_flux.php
├── cdn_get_log_list.php
├── cdn_refresh_urls_dirs.php
├── cdn_timestamp_antileech.php
├── image_url_builder.php
├── persistent_fop_init.php
├── persistent_fop_status.php
├── pfop_mkzip.php
├── pfop_vframe.php
├── pfop_video_avthumb.php
├── pfop_watermark.php
├── php-logo.png
├── prefop.php
├── qetag.php
├── rs_batch_change_mime.php
├── rs_batch_change_type.php
├── rs_batch_copy.php
├── rs_batch_delete.php
├── rs_batch_delete_after_days.php
├── rs_batch_move.php
├── rs_batch_stat.php
├── rs_bucket_domains.php
├── rs_buckets.php
├── rs_change_mime.php
├── rs_change_type.php
├── rs_copy.php
├── rs_delete.php
├── rs_delete_after_days.php
├── rs_download_urls.php
├── rs_fetch.php
├── rs_move.php
├── rs_prefetch.php
├── rs_stat.php
├── rsf_list_bucket.php
├── rsf_list_files.php
├── saveas.php
├── upload_and_callback.php
├── upload_and_pfop.php
├── upload_mgr_init.php
├── upload_multi_demos.php
├── upload_simple_file.php
├── upload_tokens.php
└── upload_verify_callback.php
├── phpunit.xml.dist
├── src
└── Qiniu
│ ├── Auth.php
│ ├── Cdn
│ └── CdnManager.php
│ ├── Config.php
│ ├── Etag.php
│ ├── Http
│ ├── Client.php
│ ├── Error.php
│ ├── Request.php
│ └── Response.php
│ ├── Processing
│ ├── ImageUrlBuilder.php
│ ├── Operation.php
│ └── PersistentFop.php
│ ├── Storage
│ ├── BucketManager.php
│ ├── FormUploader.php
│ ├── ResumeUploader.php
│ └── UploadManager.php
│ ├── Zone.php
│ └── functions.php
├── test-env.sh
└── tests
├── Qiniu
└── Tests
│ ├── AuthTest.php
│ ├── Base64Test.php
│ ├── BucketTest.php
│ ├── CdnManagerTest.php
│ ├── Crc32Test.php
│ ├── DownloadTest.php
│ ├── EtagTest.php
│ ├── FopTest.php
│ ├── FormUpTest.php
│ ├── HttpTest.php
│ ├── ImageUrlBuilderTest.php
│ ├── PfopTest.php
│ ├── ResumeUpTest.php
│ └── ZoneTest.php
└── bootstrap.php
/.gitignore:
--------------------------------------------------------------------------------
1 | .history
2 | static/layui/lay/modules
--------------------------------------------------------------------------------
/class/config.php:
--------------------------------------------------------------------------------
1 |
';
43 | print_r($data);
44 | echo '
';
45 | }
--------------------------------------------------------------------------------
/class/url.php:
--------------------------------------------------------------------------------
1 | window.parent.location.href='login.php';";
4 | }else{
5 | $uinfo = $_SESSION['info'];
6 | }
7 |
--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/favicon.ico
--------------------------------------------------------------------------------
/login.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | layim - Login WebIM - 登录
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | layim WebIM
20 |
21 |
39 |
40 |
41 |
Powered by layim
42 |
43 |
44 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/static/css/contextMenu.css:
--------------------------------------------------------------------------------
1 | .ul-context-menu {
2 | list-style: none;
3 | position: absolute;
4 | top: 0;
5 | left: 0;
6 | z-index: 99999999;
7 | padding: 5px 0;
8 | min-width: 80px;
9 | margin: 0;
10 | display: none;
11 | font-family: "微软雅黑";
12 | font-size: 14px;
13 | background-color: #fff;
14 | border: 1px solid rgba(0, 0, 0, .15);
15 | box-sizing: border-box;
16 | border-radius: 4px;
17 | -webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
18 | -moz-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
19 | -ms-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
20 | -o-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
21 | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
22 | }
23 |
24 | .ul-context-menu .ui-context-menu-item {
25 | margin: 0;
26 | padding: 0;
27 | }
28 |
29 | .ul-context-menu .ui-context-menu-item a {
30 | display: block;
31 | padding: 0 10px;
32 | color: #333;
33 | white-space: nowrap;
34 | text-decoration: none;
35 | }
36 |
37 | .ul-context-menu .ui-context-menu-item a:hover {
38 | text-decoration: none;
39 | color: #262626;
40 | }
41 |
42 | .ul-context-menu .ui-context-menu-item .icon {
43 | width: 16px;
44 | height: 16px;
45 | margin-right: 8px;
46 | vertical-align: sub;
47 | border: 0;
48 | }
49 | /*这里编辑自定义样式*/
50 | .move:hover ul{
51 | display: block;
52 | width: 110px;
53 | position: absolute;
54 | background: #d9d9d9;
55 | left: -112px;
56 | bottom: 34px;
57 | margin-top: -30px;
58 | border: 1px solid rgba(0, 0, 0, .15);
59 | }
60 |
61 | .gag ul,.move ul{
62 | display: none;
63 | }
64 | .gag:hover ul{
65 | display: block;
66 | width: 110px;
67 | position: absolute;
68 | background: #d9d9d9;
69 | right: -112px;
70 | margin-top: -30px;
71 | border: 1px solid rgba(0, 0, 0, .15);
72 | }
73 | .gag ul li a,.move ul li a{
74 | display: block;
75 | padding: 0 10px;
76 | white-space: nowrap;
77 | text-decoration: none;
78 | color: rgb(51, 51, 51);
79 | font-size: 15px;
80 | height: 30px;
81 | line-height: 30px;
82 | background-color: rgb(255, 255, 255);
83 | }
84 | .gag ul li a:hover,.move ul li a:hover {
85 | text-decoration: none;
86 | background-color: rgb(0, 155, 221);
87 | }
88 |
89 |
--------------------------------------------------------------------------------
/static/css/menu.css:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 | /* smartMenu.css by zhangxinxu */
3 | .smart_menu_box{display:none; width:140px; position:absolute; z-index:1000000000000000;}
4 | .smart_menu_body{padding:1px; border:1px solid #B8CBCB; background-color:#fff; -moz-box-shadow:2px 2px 5px #666; -webkit-box-shadow:2px 2px 5px #666; box-shadow:2px 2px 5px #666;}
5 | .smart_menu_ul{margin:0; padding:0; list-style-type:none;}
6 | .smart_menu_li{position:relative;}
7 | .smart_menu_a{display:block; height:25px; line-height:24px; padding:0 5px 0 25px; color:#000; font-size:12px; text-decoration:none; overflow:hidden;}
8 | .smart_menu_a:hover, .smart_menu_a_hover{background-color:#348CCC; color:#fff; text-decoration:none;}
9 | .smart_menu_li_separate{line-height:0; margin:3px; border-bottom:1px solid #B8CBCB; font-size:0;}
10 | .smart_menu_triangle{width:0; height:0; border:5px dashed transparent; border-left:5px solid #666; overflow:hidden; position:absolute; top:7px; right:5px;}
11 | .smart_menu_a:hover .smart_menu_triangle, .smart_menu_a_hover .smart_menu_triangle{border-left-color:#fff;}
12 | .smart_menu_li_hover .smart_menu_box{top:-1px; left:130px;}
13 |
14 |
15 |
--------------------------------------------------------------------------------
/static/fonts/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/fonts/FontAwesome.otf
--------------------------------------------------------------------------------
/static/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/static/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/static/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/static/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/static/img/tel.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/img/tel.jpg
--------------------------------------------------------------------------------
/static/js/contextMenu.js:
--------------------------------------------------------------------------------
1 | layui.define('jquery', function (exports) {
2 | "use strict";
3 | var $ = layui.jquery;
4 | !function(t,n,e,i){var o=function(t,n){this.init(t,n)};o.prototype={init:function(t,n){this.ele=t,this.defaults={menu:[{text:"菜单一",callback:function(t){}}],target:function(t){},width:140,itemHeight:30,bgColor:"#fff",color:"#333",fontSize:15,hoverBgColor:"#009bdd",hoverColor:"#fff"},this.opts=e.extend(!0,{},this.defaults,n),this.random=(new Date).getTime()+parseInt(1e3*Math.random()),this.eventBind()},renderMenu:function(){$(".ul-context-menu").remove();var t=this,n="#uiContextMenu_"+this.random;if(!(e(n).length>0)){var t=this,i='';e.each(this.opts.menu,function(t,n){
5 | n.nav ? (
6 | n.icon ? i += '"
7 | : i += '"
8 | ):(
9 | n.icon ? i += '"
10 | : i += '"
11 | )
12 | }),i+="
",e("body").append(i).find(".ul-context-menu").hide(),this.initStyle(n),e(n).on("click",".ui-context-menu-item",function(n){t.menuItemClick(e(this)),n.stopPropagation()})}},initStyle:function(t){var n=this.opts;e(t).css({width:n.width,backgroundColor:n.bgColor}).find(".ui-context-menu-item a").css({color:n.color,fontSize:n.fontSize,height:n.itemHeight,lineHeight:n.itemHeight+"px"}).hover(function(){e(this).css({backgroundColor:n.hoverBgColor,color:n.hoverColor})},function(){e(this).css({backgroundColor:n.bgColor,color:n.color})})},menuItemClick:function(t){var n=this,e=t.index();t.parent(".ul-context-menu").hide(),n.opts.menu[e].callback&&"function"==typeof n.opts.menu[e].callback&&n.opts.menu[e].callback(t)},setPosition:function(t){var n = this.opts;var obj_h = n.menu.length * n.itemHeight + 12;var obj_w = n.width;var max_x = $(window).width();var max_y = $(window).height();var this_x = t.clientX ;var this_y = t.clientY ;var x = t.clientX+4;var y = t.clientY+4;if (max_x-this_x < (obj_w-4)) {x = max_x -obj_w;}if (max_y-this_y < (obj_h-4)) {y = max_y -obj_h;}e("#uiContextMenu_"+this.random).css({left:x,top:y }).show();
13 |
14 | },eventBind:function(){var t=this;this.ele.on("contextmenu",function(n){n.preventDefault(),t.renderMenu(),t.setPosition(n),t.opts.target&&"function"==typeof t.opts.target&&t.opts.target(e(this))}),e(n).on("click",function(){e(".ul-context-menu").hide()})}},e.fn.contextMenu=function(t){return new o(this,t),this}}(window,document,$);
15 | exports('contextMenu');
16 | });
17 |
--------------------------------------------------------------------------------
/static/js/templatemo-script.js:
--------------------------------------------------------------------------------
1 | /*
2 | * www.templatemo.com
3 | *******************************************************/
4 |
5 | /* HTML document is loaded. DOM is ready.
6 | -----------------------------------------*/
7 | $(document).ready(function(){
8 |
9 | /* Mobile menu */
10 | $('.mobile-menu-icon').click(function(){
11 | $('.templatemo-left-nav').slideToggle();
12 | });
13 |
14 | /* Close the widget when clicked on close button */
15 | $('.templatemo-content-widget .fa-times').click(function(){
16 | $(this).parent().slideUp(function(){
17 | $(this).hide();
18 | });
19 | });
20 | });
--------------------------------------------------------------------------------
/static/js/webim.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * git do not control webim.config.js
3 | * everyone should copy webim.config.js.demo to webim.config.js
4 | * and have their own configs.
5 | * In this way , others won't be influenced by this config while git pull.
6 | *
7 | */
8 | var WebIM = {};
9 | WebIM.config = {
10 | /*
11 | * XMPP server
12 | */
13 | xmppURL: 'im-api.easemob.com',
14 | /*
15 | * Backend REST API URL
16 | */
17 | apiURL: (location.protocol === 'https:' ? 'https:' : 'http:') + '//a1.easemob.com',
18 | /*
19 | * Application AppKey
20 | */
21 | appkey: 'XXXXXXXXXXXX#XXXXXXX',//修改为自己的
22 |
23 | /*
24 | * Whether to use wss
25 | * @parameter {Boolean} true or false
26 | */
27 | https: false,
28 | /*
29 | * isMultiLoginSessions
30 | * true: A visitor can sign in to multiple webpages and receive messages at all the webpages.
31 | * false: A visitor can sign in to only one webpage and receive messages at the webpage.
32 | */
33 | isMultiLoginSessions: true,
34 | /*
35 | * set presence after login
36 | */
37 | isAutoLogin: true,
38 | /**
39 | * Whether to use window.doQuery()
40 | * @parameter {Boolean} true or false
41 | */
42 | isWindowSDK: false,
43 | /**
44 | * isSandBox=true: xmppURL: 'im-api-sandbox.easemob.com', apiURL: '//a1-sdb.easemob.com',
45 | * isSandBox=false: xmppURL: 'im-api.easemob.com', apiURL: '//a1.easemob.com',
46 | * @parameter {Boolean} true or false
47 | */
48 | isSandBox: false,
49 | /**
50 | * Whether to console.log in strophe.log()
51 | * @parameter {Boolean} true or false
52 | */
53 | isDebug: false,
54 | /**
55 | * will auto connect the xmpp server autoReconnectNumMax times in background when client is offline.
56 | * won't auto connect if autoReconnectNumMax=0.
57 | */
58 | autoReconnectNumMax: 2,
59 | /**
60 | * the interval seconds between each auto reconnectting.
61 | * works only if autoReconnectMaxNum >= 2.
62 | */
63 | autoReconnectInterval: 2,
64 | /**
65 | * webrtc supports WebKit and https only
66 | */
67 | isWebRTC: (/Firefox/.test(navigator.userAgent) || /WebKit/.test(navigator.userAgent)) && /^https\:$/.test(window.location.protocol),
68 | /**
69 | * after login, send empty message to xmpp server like heartBeat every 45s, to keep the ws connection alive.
70 | */
71 | heartBeatWait: 4500,
72 | /**
73 | * while http access,use ip directly,instead of ServerName,avoiding DNS problem.
74 | */
75 | isHttpDNS: false,
76 |
77 | /**
78 | * Will show the status of messages in single chat
79 | * msgStatus: true show
80 | * msgStatus: true hide
81 | */
82 | msgStatus: true,
83 |
84 | /**
85 | * When a message arrived, the receiver send an ack message to the
86 | * sender, in order to tell the sender the message has delivered.
87 | * See call back function onReceivedMessage
88 | */
89 | delivery: true,
90 |
91 | /**
92 | * When a message read, the receiver send an ack message to the
93 | * sender, in order to tell the sender the message has been read.
94 | * See call back function onReadMessage
95 | */
96 | read: true,
97 |
98 | /**
99 | * When a message sent or arrived, will save it into the localStorage,
100 | * true: Store the chat record
101 | * false: Don't store the chat record
102 | */
103 | saveLocal: false,
104 |
105 | /**
106 | * Will encrypt text message and emoji message
107 | * {type:'none'} no encrypt
108 | * {type:'base64'} encrypt with base64
109 | * {type:'aes',mode: 'ebc',key: '123456789easemob',iv: '0000000000000000'} encrypt with aes(ebc)
110 | * {type:'aes',mode: 'cbc',key: '123456789easemob',iv: '0000000000000000'} encrypt with aes(cbc)
111 | */
112 | encrypt: {
113 | type: 'none'
114 | }
115 | };
116 |
--------------------------------------------------------------------------------
/static/layui/css/modules/code.css:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | @Name: layui.code
4 | @Author: 贤心
5 | @Site: http://www.layui.com
6 |
7 | */
8 |
9 | /* 加载就绪标志 */
10 | html #layuicss-skincodecss{display:none; position: absolute; width:1989px;}
11 |
12 | /* 默认风格 */
13 | .layui-code-view{display: block; position: relative; margin: 10px 0; padding: 0; border: 1px solid #e2e2e2; border-left-width: 6px; background-color: #F2F2F2; color: #333; font-family: Courier New; font-size: 12px;}
14 | .layui-code-h3{position: relative; padding: 0 10px; height: 32px; line-height: 32px; border-bottom: 1px solid #e2e2e2; font-size: 12px;}
15 | .layui-code-h3 a{position: absolute; right: 10px; top: 0; color: #999;}
16 | .layui-code-view .layui-code-ol{position: relative; overflow: auto;}
17 | .layui-code-view .layui-code-ol li{position: relative; margin-left: 45px; line-height: 20px; padding: 0 5px; border-left: 1px solid #e2e2e2; list-style-type: decimal-leading-zero; *list-style-type: decimal; background-color: #fff;}
18 | .layui-code-view pre{margin: 0;}
19 |
20 | /* notepadd++风格 */
21 | .layui-code-notepad{border: 1px solid #0C0C0C; border-left-color: #3F3F3F; background-color: #0C0C0C; color: #C2BE9E}
22 | .layui-code-notepad .layui-code-h3{border-bottom: none;}
23 | .layui-code-notepad .layui-code-ol li{background-color: #3F3F3F; border-left: none;}
--------------------------------------------------------------------------------
/static/layui/css/modules/laydate/default/font.css:
--------------------------------------------------------------------------------
1 | /** 图标字体 **/
2 | @font-face {font-family: 'laydate-icon';
3 | src: url('./font/iconfont.eot');
4 | src: url('./font/iconfont.eot#iefix') format('embedded-opentype'),
5 | url('./font/iconfont.svg#iconfont') format('svg'),
6 | url('./font/iconfont.woff') format('woff'),
7 | url('./font/iconfont.ttf') format('truetype');
8 | }
9 |
10 | .laydate-icon{
11 | font-family:"laydate-icon" !important;
12 | font-size: 16px;
13 | font-style: normal;
14 | -webkit-font-smoothing: antialiased;
15 | -moz-osx-font-smoothing: grayscale;
16 | }
--------------------------------------------------------------------------------
/static/layui/css/modules/layer/default/icon-ext.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/css/modules/layer/default/icon-ext.png
--------------------------------------------------------------------------------
/static/layui/css/modules/layer/default/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/css/modules/layer/default/icon.png
--------------------------------------------------------------------------------
/static/layui/css/modules/layer/default/loading-0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/css/modules/layer/default/loading-0.gif
--------------------------------------------------------------------------------
/static/layui/css/modules/layer/default/loading-1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/css/modules/layer/default/loading-1.gif
--------------------------------------------------------------------------------
/static/layui/css/modules/layer/default/loading-2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/css/modules/layer/default/loading-2.gif
--------------------------------------------------------------------------------
/static/layui/css/modules/layim/html/chatlog.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 聊天记录
9 |
10 |
11 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
26 |
39 |
40 |
44 |
45 |
46 |
47 |
48 |
49 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/static/layui/css/modules/layim/html/createGroup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 创建群
9 |
10 |
11 |
56 |
57 |
58 |
59 |
60 |
88 |
89 |
90 |
125 |
126 |
127 |
128 |
--------------------------------------------------------------------------------
/static/layui/css/modules/layim/skin/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/css/modules/layim/skin/1.jpg
--------------------------------------------------------------------------------
/static/layui/css/modules/layim/skin/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/css/modules/layim/skin/2.jpg
--------------------------------------------------------------------------------
/static/layui/css/modules/layim/skin/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/css/modules/layim/skin/3.jpg
--------------------------------------------------------------------------------
/static/layui/css/modules/layim/skin/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/css/modules/layim/skin/4.jpg
--------------------------------------------------------------------------------
/static/layui/css/modules/layim/skin/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/css/modules/layim/skin/5.jpg
--------------------------------------------------------------------------------
/static/layui/css/modules/layim/skin/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/css/modules/layim/skin/logo.jpg
--------------------------------------------------------------------------------
/static/layui/css/modules/layim/voice/default.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/css/modules/layim/voice/default.mp3
--------------------------------------------------------------------------------
/static/layui/font/iconfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/font/iconfont.eot
--------------------------------------------------------------------------------
/static/layui/font/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/font/iconfont.ttf
--------------------------------------------------------------------------------
/static/layui/font/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/font/iconfont.woff
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_1.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_10.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_11.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_12.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_13.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_14.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_15.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_16.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_17.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_18.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_19.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_2.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_20.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_21.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_22.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_23.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_24.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_25.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_26.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_26.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_27.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_28.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_28.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_29.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_3.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_30.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_30.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_31.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_32.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_33.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_33.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_34.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_34.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_35.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_35.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_4.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_5.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_6.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_7.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_8.png
--------------------------------------------------------------------------------
/static/layui/images/easemob_face/ee_9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/easemob_face/ee_9.png
--------------------------------------------------------------------------------
/static/layui/images/face/0.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/0.gif
--------------------------------------------------------------------------------
/static/layui/images/face/1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/1.gif
--------------------------------------------------------------------------------
/static/layui/images/face/10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/10.gif
--------------------------------------------------------------------------------
/static/layui/images/face/11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/11.gif
--------------------------------------------------------------------------------
/static/layui/images/face/12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/12.gif
--------------------------------------------------------------------------------
/static/layui/images/face/13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/13.gif
--------------------------------------------------------------------------------
/static/layui/images/face/14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/14.gif
--------------------------------------------------------------------------------
/static/layui/images/face/15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/15.gif
--------------------------------------------------------------------------------
/static/layui/images/face/16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/16.gif
--------------------------------------------------------------------------------
/static/layui/images/face/17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/17.gif
--------------------------------------------------------------------------------
/static/layui/images/face/18.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/18.gif
--------------------------------------------------------------------------------
/static/layui/images/face/19.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/19.gif
--------------------------------------------------------------------------------
/static/layui/images/face/2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/2.gif
--------------------------------------------------------------------------------
/static/layui/images/face/20.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/20.gif
--------------------------------------------------------------------------------
/static/layui/images/face/21.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/21.gif
--------------------------------------------------------------------------------
/static/layui/images/face/22.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/22.gif
--------------------------------------------------------------------------------
/static/layui/images/face/23.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/23.gif
--------------------------------------------------------------------------------
/static/layui/images/face/24.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/24.gif
--------------------------------------------------------------------------------
/static/layui/images/face/25.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/25.gif
--------------------------------------------------------------------------------
/static/layui/images/face/26.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/26.gif
--------------------------------------------------------------------------------
/static/layui/images/face/27.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/27.gif
--------------------------------------------------------------------------------
/static/layui/images/face/28.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/28.gif
--------------------------------------------------------------------------------
/static/layui/images/face/29.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/29.gif
--------------------------------------------------------------------------------
/static/layui/images/face/3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/3.gif
--------------------------------------------------------------------------------
/static/layui/images/face/30.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/30.gif
--------------------------------------------------------------------------------
/static/layui/images/face/31.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/31.gif
--------------------------------------------------------------------------------
/static/layui/images/face/32.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/32.gif
--------------------------------------------------------------------------------
/static/layui/images/face/33.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/33.gif
--------------------------------------------------------------------------------
/static/layui/images/face/34.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/34.gif
--------------------------------------------------------------------------------
/static/layui/images/face/35.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/35.gif
--------------------------------------------------------------------------------
/static/layui/images/face/36.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/36.gif
--------------------------------------------------------------------------------
/static/layui/images/face/37.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/37.gif
--------------------------------------------------------------------------------
/static/layui/images/face/38.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/38.gif
--------------------------------------------------------------------------------
/static/layui/images/face/39.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/39.gif
--------------------------------------------------------------------------------
/static/layui/images/face/4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/4.gif
--------------------------------------------------------------------------------
/static/layui/images/face/40.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/40.gif
--------------------------------------------------------------------------------
/static/layui/images/face/41.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/41.gif
--------------------------------------------------------------------------------
/static/layui/images/face/42.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/42.gif
--------------------------------------------------------------------------------
/static/layui/images/face/43.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/43.gif
--------------------------------------------------------------------------------
/static/layui/images/face/44.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/44.gif
--------------------------------------------------------------------------------
/static/layui/images/face/45.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/45.gif
--------------------------------------------------------------------------------
/static/layui/images/face/46.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/46.gif
--------------------------------------------------------------------------------
/static/layui/images/face/47.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/47.gif
--------------------------------------------------------------------------------
/static/layui/images/face/48.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/48.gif
--------------------------------------------------------------------------------
/static/layui/images/face/49.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/49.gif
--------------------------------------------------------------------------------
/static/layui/images/face/5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/5.gif
--------------------------------------------------------------------------------
/static/layui/images/face/50.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/50.gif
--------------------------------------------------------------------------------
/static/layui/images/face/51.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/51.gif
--------------------------------------------------------------------------------
/static/layui/images/face/52.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/52.gif
--------------------------------------------------------------------------------
/static/layui/images/face/53.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/53.gif
--------------------------------------------------------------------------------
/static/layui/images/face/54.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/54.gif
--------------------------------------------------------------------------------
/static/layui/images/face/55.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/55.gif
--------------------------------------------------------------------------------
/static/layui/images/face/56.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/56.gif
--------------------------------------------------------------------------------
/static/layui/images/face/57.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/57.gif
--------------------------------------------------------------------------------
/static/layui/images/face/58.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/58.gif
--------------------------------------------------------------------------------
/static/layui/images/face/59.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/59.gif
--------------------------------------------------------------------------------
/static/layui/images/face/6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/6.gif
--------------------------------------------------------------------------------
/static/layui/images/face/60.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/60.gif
--------------------------------------------------------------------------------
/static/layui/images/face/61.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/61.gif
--------------------------------------------------------------------------------
/static/layui/images/face/62.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/62.gif
--------------------------------------------------------------------------------
/static/layui/images/face/63.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/63.gif
--------------------------------------------------------------------------------
/static/layui/images/face/64.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/64.gif
--------------------------------------------------------------------------------
/static/layui/images/face/65.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/65.gif
--------------------------------------------------------------------------------
/static/layui/images/face/66.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/66.gif
--------------------------------------------------------------------------------
/static/layui/images/face/67.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/67.gif
--------------------------------------------------------------------------------
/static/layui/images/face/68.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/68.gif
--------------------------------------------------------------------------------
/static/layui/images/face/69.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/69.gif
--------------------------------------------------------------------------------
/static/layui/images/face/7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/7.gif
--------------------------------------------------------------------------------
/static/layui/images/face/70.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/70.gif
--------------------------------------------------------------------------------
/static/layui/images/face/71.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/71.gif
--------------------------------------------------------------------------------
/static/layui/images/face/8.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/8.gif
--------------------------------------------------------------------------------
/static/layui/images/face/9.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/static/layui/images/face/9.gif
--------------------------------------------------------------------------------
/static/layui/lay/all-mobile.js:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | @Name:用于打包移动完整版
4 | @Author:贤心
5 | @License:LGPL
6 |
7 | */
8 |
9 | layui.define(function(exports){
10 | exports('layui.mobile', layui.v);
11 | });
12 |
--------------------------------------------------------------------------------
/static/layui/lay/all.js:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | @Name:用于打包PC完整版,即包含layui.js和所有模块的完整合并(该文件不会存在于构建后的目录)
4 | @Author:贤心
5 | @License:LGPL
6 |
7 | */
8 |
9 | layui.define(function(exports){
10 | var cache = layui.cache;
11 | layui.config({
12 | dir: cache.dir.replace(/lay\/dest\/$/, '')
13 | });
14 | exports('layui.all', layui.v);
15 | });
16 |
--------------------------------------------------------------------------------
/static/layui/lay/modules/code.js:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | @Name:layui.code 代码修饰器
4 | @Author:贤心
5 | @License:MIT
6 |
7 | */
8 |
9 | layui.define('jquery', function(exports){
10 | "use strict";
11 |
12 | var $ = layui.$;
13 | var about = 'http://www.layui.com/doc/modules/code.html'; //关于信息
14 |
15 | exports('code', function(options){
16 | var elems = [];
17 | options = options || {};
18 | options.elem = $(options.elem||'.layui-code');
19 | options.about = 'about' in options ? options.about : true;
20 |
21 | options.elem.each(function(){
22 | elems.push(this);
23 | });
24 |
25 | layui.each(elems.reverse(), function(index, item){
26 | var othis = $(item), html = othis.html();
27 |
28 | //转义HTML标签
29 | if(othis.attr('lay-encode') || options.encode){
30 | html = html.replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&')
31 | .replace(//g, '>').replace(/'/g, ''').replace(/"/g, '"')
32 | }
33 |
34 | othis.html('- ' + html.replace(/[\r\t\n]+/g, '
- ') + '
')
35 |
36 | if(!othis.find('>.layui-code-h3')[0]){
37 | othis.prepend(''+ (othis.attr('lay-title')||options.title||'code') + (options.about ? 'layui.code' : '') + '
');
38 | }
39 |
40 | var ol = othis.find('>.layui-code-ol');
41 | othis.addClass('layui-box layui-code-view');
42 |
43 | //识别皮肤
44 | if(othis.attr('lay-skin') || options.skin){
45 | othis.addClass('layui-code-' +(othis.attr('lay-skin') || options.skin));
46 | }
47 |
48 | //按行数适配左边距
49 | if((ol.find('li').length/100|0) > 0){
50 | ol.css('margin-left', (ol.find('li').length/100|0) + 'px');
51 | }
52 |
53 | //设置最大高度
54 | if(othis.attr('lay-height') || options.height){
55 | ol.css('max-height', othis.attr('lay-height') || options.height);
56 | }
57 |
58 | });
59 |
60 | });
61 | }).addcss('modules/code.css', 'skincodecss');
--------------------------------------------------------------------------------
/static/layui/lay/modules/flow.js:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | @Name:layui.flow 流加载
4 | @Author:贤心
5 | @License:MIT
6 |
7 | */
8 |
9 |
10 | layui.define('jquery', function(exports){
11 | "use strict";
12 |
13 | var $ = layui.$, Flow = function(options){}
14 | ,ELEM_MORE = 'layui-flow-more'
15 | ,ELEM_LOAD = '';
16 |
17 | //主方法
18 | Flow.prototype.load = function(options){
19 | var that = this, page = 0, lock, isOver, lazyimg, timer;
20 | options = options || {};
21 |
22 | var elem = $(options.elem); if(!elem[0]) return;
23 | var scrollElem = $(options.scrollElem || document); //滚动条所在元素
24 | var mb = options.mb || 50; //与底部的临界距离
25 | var isAuto = 'isAuto' in options ? options.isAuto : true; //是否自动滚动加载
26 | var end = options.end || '没有更多了'; //“末页”显示文案
27 |
28 | //滚动条所在元素是否为document
29 | var notDocment = options.scrollElem && options.scrollElem !== document;
30 |
31 | //加载更多
32 | var ELEM_TEXT = '加载更多'
33 | ,more = $('');
34 |
35 | if(!elem.find('.layui-flow-more')[0]){
36 | elem.append(more);
37 | }
38 |
39 | //加载下一个元素
40 | var next = function(html, over){
41 | html = $(html);
42 | more.before(html);
43 | over = over == 0 ? true : null;
44 | over ? more.html(end) : more.find('a').html(ELEM_TEXT);
45 | isOver = over;
46 | lock = null;
47 | lazyimg && lazyimg();
48 | };
49 |
50 | //触发请求
51 | var done = function(){
52 | lock = true;
53 | more.find('a').html(ELEM_LOAD);
54 | typeof options.done === 'function' && options.done(++page, next);
55 | };
56 |
57 | done();
58 |
59 | //不自动滚动加载
60 | more.find('a').on('click', function(){
61 | var othis = $(this);
62 | if(isOver) return;
63 | lock || done();
64 | });
65 |
66 | //如果允许图片懒加载
67 | if(options.isLazyimg){
68 | var lazyimg = that.lazyimg({
69 | elem: options.elem + ' img'
70 | ,scrollElem: options.scrollElem
71 | });
72 | }
73 |
74 | if(!isAuto) return that;
75 |
76 | scrollElem.on('scroll', function(){
77 | var othis = $(this), top = othis.scrollTop();
78 |
79 | if(timer) clearTimeout(timer);
80 | if(isOver) return;
81 |
82 | timer = setTimeout(function(){
83 | //计算滚动所在容器的可视高度
84 | var height = notDocment ? othis.height() : $(window).height();
85 |
86 | //计算滚动所在容器的实际高度
87 | var scrollHeight = notDocment
88 | ? othis.prop('scrollHeight')
89 | : document.documentElement.scrollHeight;
90 |
91 | //临界点
92 | if(scrollHeight - top - height <= mb){
93 | lock || done();
94 | }
95 | }, 100);
96 | });
97 | return that;
98 | };
99 |
100 | //图片懒加载
101 | Flow.prototype.lazyimg = function(options){
102 | var that = this, index = 0, haveScroll;
103 | options = options || {};
104 |
105 | var scrollElem = $(options.scrollElem || document); //滚动条所在元素
106 | var elem = options.elem || 'img';
107 |
108 | //滚动条所在元素是否为document
109 | var notDocment = options.scrollElem && options.scrollElem !== document;
110 |
111 | //显示图片
112 | var show = function(item, height){
113 | var start = scrollElem.scrollTop(), end = start + height;
114 | var elemTop = notDocment ? function(){
115 | return item.offset().top - scrollElem.offset().top + start;
116 | }() : item.offset().top;
117 |
118 | /* 始终只加载在当前屏范围内的图片 */
119 | if(elemTop >= start && elemTop <= end){
120 | if(!item.attr('src')){
121 | var src = item.attr('lay-src');
122 | layui.img(src, function(){
123 | var next = that.lazyimg.elem.eq(index);
124 | item.attr('src', src).removeAttr('lay-src');
125 |
126 | /* 当前图片加载就绪后,检测下一个图片是否在当前屏 */
127 | next[0] && render(next);
128 | index++;
129 | });
130 | }
131 | }
132 | }, render = function(othis, scroll){
133 |
134 | //计算滚动所在容器的可视高度
135 | var height = notDocment ? (scroll||scrollElem).height() : $(window).height();
136 | var start = scrollElem.scrollTop(), end = start + height;
137 |
138 | that.lazyimg.elem = $(elem);
139 |
140 | if(othis){
141 | show(othis, height);
142 | } else {
143 | //计算未加载过的图片
144 | for(var i = 0; i < that.lazyimg.elem.length; i++){
145 | var item = that.lazyimg.elem.eq(i), elemTop = notDocment ? function(){
146 | return item.offset().top - scrollElem.offset().top + start;
147 | }() : item.offset().top;
148 |
149 | show(item, height);
150 | index = i;
151 |
152 | //如果图片的top坐标,超出了当前屏,则终止后续图片的遍历
153 | if(elemTop > end) break;
154 | }
155 | }
156 | };
157 |
158 | render();
159 |
160 | if(!haveScroll){
161 | var timer;
162 | scrollElem.on('scroll', function(){
163 | var othis = $(this);
164 | if(timer) clearTimeout(timer)
165 | timer = setTimeout(function(){
166 | render(null, othis);
167 | }, 50);
168 | });
169 | haveScroll = true;
170 | }
171 | return render;
172 | };
173 |
174 | //暴露接口
175 | exports('flow', new Flow());
176 | });
177 |
--------------------------------------------------------------------------------
/static/layui/lay/modules/laytpl.js:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | @Name : layui.laytpl 模板引擎
4 | @Author:贤心
5 | @License:MIT
6 |
7 | */
8 |
9 | layui.define(function(exports){
10 |
11 | "use strict";
12 |
13 | var config = {
14 | open: '{{',
15 | close: '}}'
16 | };
17 |
18 | var tool = {
19 | exp: function(str){
20 | return new RegExp(str, 'g');
21 | },
22 | //匹配满足规则内容
23 | query: function(type, _, __){
24 | var types = [
25 | '#([\\s\\S])+?', //js语句
26 | '([^{#}])*?' //普通字段
27 | ][type || 0];
28 | return exp((_||'') + config.open + types + config.close + (__||''));
29 | },
30 | escape: function(html){
31 | return String(html||'').replace(/&(?!#?[a-zA-Z0-9]+;)/g, '&')
32 | .replace(//g, '>').replace(/'/g, ''').replace(/"/g, '"');
33 | },
34 | error: function(e, tplog){
35 | var error = 'Laytpl Error:';
36 | typeof console === 'object' && console.error(error + e + '\n'+ (tplog || ''));
37 | return error + e;
38 | }
39 | };
40 |
41 | var exp = tool.exp, Tpl = function(tpl){
42 | this.tpl = tpl;
43 | };
44 |
45 | Tpl.pt = Tpl.prototype;
46 |
47 | window.errors = 0;
48 |
49 | //编译模版
50 | Tpl.pt.parse = function(tpl, data){
51 | var that = this, tplog = tpl;
52 | var jss = exp('^'+config.open+'#', ''), jsse = exp(config.close+'$', '');
53 |
54 | tpl = tpl.replace(/\s+|\r|\t|\n/g, ' ')
55 | .replace(exp(config.open+'#'), config.open+'# ')
56 | .replace(exp(config.close+'}'), '} '+config.close).replace(/\\/g, '\\\\')
57 |
58 | //不匹配指定区域的内容
59 | .replace(exp(config.open + '!(.+?)!' + config.close), function(str){
60 | str = str.replace(exp('^'+ config.open + '!'), '')
61 | .replace(exp('!'+ config.close), '')
62 | .replace(exp(config.open + '|' + config.close), function(tag){
63 | return tag.replace(/(.)/g, '\\$1')
64 | });
65 | return str
66 | })
67 |
68 | //匹配JS规则内容
69 | .replace(/(?="|')/g, '\\').replace(tool.query(), function(str){
70 | str = str.replace(jss, '').replace(jsse, '');
71 | return '";' + str.replace(/\\/g, '') + ';view+="';
72 | })
73 |
74 | //匹配普通字段
75 | .replace(tool.query(1), function(str){
76 | var start = '"+(';
77 | if(str.replace(/\s/g, '') === config.open+config.close){
78 | return '';
79 | }
80 | str = str.replace(exp(config.open+'|'+config.close), '');
81 | if(/^=/.test(str)){
82 | str = str.replace(/^=/, '');
83 | start = '"+_escape_(';
84 | }
85 | return start + str.replace(/\\/g, '') + ')+"';
86 | });
87 |
88 | tpl = '"use strict";var view = "' + tpl + '";return view;';
89 |
90 | try{
91 | that.cache = tpl = new Function('d, _escape_', tpl);
92 | return tpl(data, tool.escape);
93 | } catch(e){
94 | delete that.cache;
95 | return tool.error(e, tplog);
96 | }
97 | };
98 |
99 | Tpl.pt.render = function(data, callback){
100 | var that = this, tpl;
101 | if(!data) return tool.error('no data');
102 | tpl = that.cache ? that.cache(data, tool.escape) : that.parse(that.tpl, data);
103 | if(!callback) return tpl;
104 | callback(tpl);
105 | };
106 |
107 | var laytpl = function(tpl){
108 | if(typeof tpl !== 'string') return tool.error('Template not found');
109 | return new Tpl(tpl);
110 | };
111 |
112 | laytpl.config = function(options){
113 | options = options || {};
114 | for(var i in options){
115 | config[i] = options[i];
116 | }
117 | };
118 |
119 | laytpl.v = '1.2.0';
120 |
121 | exports('laytpl', laytpl);
122 |
123 | });
--------------------------------------------------------------------------------
/static/layui/lay/modules/mobile.js:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | @Name:layui 移动模块入口 | 构建后则为移动模块集合
4 | @Author:贤心
5 | @License:MIT
6 |
7 | */
8 |
9 |
10 | if(!layui['layui.mobile']){
11 | layui.config({
12 | base: layui.cache.dir + 'lay/modules/mobile/'
13 | }).extend({
14 | 'layer-mobile': 'layer-mobile'
15 | ,'zepto': 'zepto'
16 | ,'upload-mobile': 'upload-mobile'
17 | ,'layim-mobile': 'layim-mobile'
18 | });
19 | }
20 |
21 | layui.define([
22 | 'layer-mobile'
23 | ,'zepto'
24 | ,'layim-mobile'
25 | ], function(exports){
26 | exports('mobile', {
27 | layer: layui['layer-mobile'] //弹层
28 | ,layim: layui['layim-mobile'] //WebIM
29 | });
30 | });
--------------------------------------------------------------------------------
/static/layui/lay/modules/mobile/layim-mobile-open.js:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | @Name:layim mobile 开源包
4 | @Author:贤心
5 | @License:MIT
6 |
7 | */
8 |
9 | layui.define(function(exports){
10 | exports('layim-mobile', layui.v);
11 | });
--------------------------------------------------------------------------------
/static/layui/lay/modules/mobile/upload-mobile.js:
--------------------------------------------------------------------------------
1 | /*!
2 |
3 | @Title: layui.upload 单文件上传 - 全浏览器兼容版
4 | @Author: 贤心
5 | @License:MIT
6 |
7 | */
8 |
9 | layui.define(['layer-mobile', 'zepto'] , function(exports){
10 | "use strict";
11 |
12 | var $ = layui.zepto;
13 | var layer = layui['layer-mobile'];
14 | var device = layui.device();
15 |
16 | var elemDragEnter = 'layui-upload-enter';
17 | var elemIframe = 'layui-upload-iframe';
18 |
19 | var msgConf = {
20 | icon: 2
21 | ,shift: 6
22 | }, fileType = {
23 | file: '文件'
24 | ,video: '视频'
25 | ,audio: '音频'
26 | };
27 |
28 | layer.msg = function(content){
29 | return layer.open({
30 | content: content || ''
31 | ,skin: 'msg'
32 | ,time: 2 //2秒后自动关闭
33 | });
34 | };
35 |
36 | var Upload = function(options){
37 | this.options = options;
38 | };
39 |
40 | //初始化渲染
41 | Upload.prototype.init = function(){
42 | var that = this, options = that.options;
43 | var body = $('body'), elem = $(options.elem || '.layui-upload-file');
44 | var iframe = $('');
45 |
46 | //插入iframe
47 | $('#'+elemIframe)[0] || body.append(iframe);
48 |
49 | return elem.each(function(index, item){
50 | item = $(item);
51 | var form = '';
52 |
53 | var type = item.attr('lay-type') || options.type; //获取文件类型
54 |
55 | //包裹ui元素
56 | if(!options.unwrap){
57 | form = '' + form + ''+ (
58 | item.attr('lay-title') || options.title|| ('上传'+ (fileType[type]||'图片') )
59 | ) +'
';
60 | }
61 |
62 | form = $(form);
63 |
64 | //拖拽支持
65 | if(!options.unwrap){
66 | form.on('dragover', function(e){
67 | e.preventDefault();
68 | $(this).addClass(elemDragEnter);
69 | }).on('dragleave', function(){
70 | $(this).removeClass(elemDragEnter);
71 | }).on('drop', function(){
72 | $(this).removeClass(elemDragEnter);
73 | });
74 | }
75 |
76 | //如果已经实例化,则移除包裹元素
77 | if(item.parent('form').attr('target') === elemIframe){
78 | if(options.unwrap){
79 | item.unwrap();
80 | } else {
81 | item.parent().next().remove();
82 | item.unwrap().unwrap();
83 | }
84 | };
85 |
86 | //包裹元素
87 | item.wrap(form);
88 |
89 | //触发上传
90 | item.off('change').on('change', function(){
91 | that.action(this, type);
92 | });
93 | });
94 | };
95 |
96 | //提交上传
97 | Upload.prototype.action = function(input, type){
98 | var that = this, options = that.options, val = input.value;
99 | var item = $(input), ext = item.attr('lay-ext') || options.ext || ''; //获取支持上传的文件扩展名;
100 |
101 | if(!val){
102 | return;
103 | };
104 |
105 | //校验文件
106 | switch(type){
107 | case 'file': //一般文件
108 | if(ext && !RegExp('\\w\\.('+ ext +')$', 'i').test(escape(val))){
109 | layer.msg('不支持该文件格式', msgConf);
110 | return input.value = '';
111 | }
112 | break;
113 | case 'video': //视频文件
114 | if(!RegExp('\\w\\.('+ (ext||'avi|mp4|wma|rmvb|rm|flash|3gp|flv') +')$', 'i').test(escape(val))){
115 | layer.msg('不支持该视频格式', msgConf);
116 | return input.value = '';
117 | }
118 | break;
119 | case 'audio': //音频文件
120 | if(!RegExp('\\w\\.('+ (ext||'mp3|wav|mid') +')$', 'i').test(escape(val))){
121 | layer.msg('不支持该音频格式', msgConf);
122 | return input.value = '';
123 | }
124 | break;
125 | default: //图片文件
126 | if(!RegExp('\\w\\.('+ (ext||'jpg|png|gif|bmp|jpeg') +')$', 'i').test(escape(val))){
127 | layer.msg('不支持该图片格式', msgConf);
128 | return input.value = '';
129 | }
130 | break;
131 | }
132 |
133 | options.before && options.before(input);
134 | item.parent().submit();
135 |
136 | var iframe = $('#'+elemIframe), timer = setInterval(function() {
137 | var res;
138 | try {
139 | res = iframe.contents().find('body').text();
140 | } catch(e) {
141 | layer.msg('上传接口存在跨域', msgConf);
142 | clearInterval(timer);
143 | }
144 | if(res){
145 | clearInterval(timer);
146 | iframe.contents().find('body').html('');
147 | try {
148 | res = JSON.parse(res);
149 | } catch(e){
150 | res = {};
151 | return layer.msg('请对上传接口返回JSON字符', msgConf);
152 | }
153 | typeof options.success === 'function' && options.success(res, input);
154 | }
155 | }, 30);
156 |
157 | input.value = '';
158 | };
159 |
160 | //暴露接口
161 | exports('upload-mobile', function(options){
162 | var upload = new Upload(options = options || {});
163 | upload.init();
164 | });
165 | });
166 |
167 |
--------------------------------------------------------------------------------
/static/layui/lay/modules/util.js:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | @Name:layui.util 工具集
4 | @Author:贤心
5 | @License:MIT
6 |
7 | */
8 |
9 | layui.define('jquery', function(exports){
10 | "use strict";
11 |
12 | var $ = layui.$
13 |
14 | //外部接口
15 | ,util = {
16 | //固定块
17 | fixbar: function(options){
18 | var ELEM = 'layui-fixbar', TOP_BAR = 'layui-fixbar-top'
19 | ,dom = $(document), body = $('body')
20 | ,is, timer;
21 |
22 | options = $.extend({
23 | showHeight: 200 //出现TOP的滚动条高度临界值
24 | }, options);
25 |
26 | options.bar1 = options.bar1 === true ? '' : options.bar1;
27 | options.bar2 = options.bar2 === true ? '' : options.bar2;
28 | options.bgcolor = options.bgcolor ? ('background-color:' + options.bgcolor) : '';
29 |
30 | var icon = [options.bar1, options.bar2, ''] //图标:信息、问号、TOP
31 | ,elem = $([''
32 | ,options.bar1 ? '- '+ icon[0] +'
' : ''
33 | ,options.bar2 ? '- '+ icon[1] +'
' : ''
34 | ,'- '+ icon[2] +'
'
35 | ,'
'].join(''))
36 | ,topBar = elem.find('.'+TOP_BAR)
37 | ,scroll = function(){
38 | var stop = dom.scrollTop();
39 | if(stop >= (options.showHeight)){
40 | is || (topBar.show(), is = 1);
41 | } else {
42 | is && (topBar.hide(), is = 0);
43 | }
44 | };
45 | if($('.'+ ELEM)[0]) return;
46 |
47 | typeof options.css === 'object' && elem.css(options.css);
48 | body.append(elem), scroll();
49 |
50 | //bar点击事件
51 | elem.find('li').on('click', function(){
52 | var othis = $(this), type = othis.attr('lay-type');
53 | if(type === 'top'){
54 | $('html,body').animate({
55 | scrollTop : 0
56 | }, 200);
57 | }
58 | options.click && options.click.call(this, type);
59 | });
60 |
61 | //Top显示控制
62 | dom.on('scroll', function(){
63 | clearTimeout(timer);
64 | timer = setTimeout(function(){
65 | scroll();
66 | }, 100);
67 | });
68 | }
69 |
70 | //倒计时
71 | ,countdown: function(endTime, serverTime, callback){
72 | var that = this
73 | ,type = typeof serverTime === 'function'
74 | ,end = new Date(endTime).getTime()
75 | ,now = new Date((!serverTime || type) ? new Date().getTime() : serverTime).getTime()
76 | ,count = end - now
77 | ,time = [
78 | Math.floor(count/(1000*60*60*24)) //天
79 | ,Math.floor(count/(1000*60*60)) % 24 //时
80 | ,Math.floor(count/(1000*60)) % 60 //分
81 | ,Math.floor(count/1000) % 60 //秒
82 | ];
83 |
84 | if(type) callback = serverTime;
85 |
86 | var timer = setTimeout(function(){
87 | that.countdown(endTime, now + 1000, callback);
88 | }, 1000);
89 |
90 | callback && callback(count > 0 ? time : [0,0,0,0], serverTime, timer);
91 |
92 | if(count <= 0) clearTimeout(timer);
93 | return timer;
94 | }
95 |
96 | //某个时间在当前时间的多久前
97 | ,timeAgo: function(time, onlyDate){
98 | var that = this
99 | ,arr = [[], []]
100 | ,stamp = new Date().getTime() - new Date(time).getTime();
101 |
102 | //返回具体日期
103 | if(stamp > 1000*60*60*24*8){
104 | stamp = new Date(time);
105 | arr[0][0] = that.digit(stamp.getFullYear(), 4);
106 | arr[0][1] = that.digit(stamp.getMonth() + 1);
107 | arr[0][2] = that.digit(stamp.getDate());
108 |
109 | //是否输出时间
110 | if(!onlyDate){
111 | arr[1][0] = that.digit(stamp.getHours());
112 | arr[1][1] = that.digit(stamp.getMinutes());
113 | arr[1][2] = that.digit(stamp.getSeconds());
114 | }
115 | return arr[0].join('-') + ' ' + arr[1].join(':');
116 | }
117 |
118 | //30天以内,返回“多久前”
119 | if(stamp >= 1000*60*60*24){
120 | return ((stamp/1000/60/60/24)|0) + '天前';
121 | } else if(stamp >= 1000*60*60){
122 | return ((stamp/1000/60/60)|0) + '小时前';
123 | } else if(stamp >= 1000*60*2){ //2分钟以内为:刚刚
124 | return ((stamp/1000/60)|0) + '分钟前';
125 | } else if(stamp < 0){
126 | return '未来';
127 | } else {
128 | return '刚刚';
129 | }
130 | }
131 |
132 | //数字前置补零
133 | ,digit: function(num, length){
134 | var str = '';
135 | num = String(num);
136 | length = length || 2;
137 | for(var i = num.length; i < length; i++){
138 | str += '0';
139 | }
140 | return num < Math.pow(10, length) ? str + (num|0) : num;
141 | }
142 |
143 | //转化为日期格式字符
144 | ,toDateString: function(time, format){
145 | var that = this
146 | ,date = new Date(parseInt(time) || new Date())
147 | ,ymd = [
148 | that.digit(date.getFullYear(), 4)
149 | ,that.digit(date.getMonth() + 1)
150 | ,that.digit(date.getDate())
151 | ]
152 | ,hms = [
153 | that.digit(date.getHours())
154 | ,that.digit(date.getMinutes())
155 | ,that.digit(date.getSeconds())
156 | ];
157 |
158 | format = format || 'yyyy-MM-dd HH:mm:ss';
159 |
160 | return format.replace(/yyyy/g, ymd[0])
161 | .replace(/MM/g, ymd[1])
162 | .replace(/dd/g, ymd[2])
163 | .replace(/HH/g, hms[0])
164 | .replace(/mm/g, hms[1])
165 | .replace(/ss/g, hms[2]);
166 | }
167 | };
168 |
169 | exports('util', util);
170 | });
--------------------------------------------------------------------------------
/uploads/person/1570845.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/1570845.jpg
--------------------------------------------------------------------------------
/uploads/person/1570855.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/1570855.jpg
--------------------------------------------------------------------------------
/uploads/person/32403609419777.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/32403609419777.jpg
--------------------------------------------------------------------------------
/uploads/person/32403628294145.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/32403628294145.jpg
--------------------------------------------------------------------------------
/uploads/person/34331010596865.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/34331010596865.jpg
--------------------------------------------------------------------------------
/uploads/person/34501063409665.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/34501063409665.jpg
--------------------------------------------------------------------------------
/uploads/person/3492303870361.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/3492303870361.jpg
--------------------------------------------------------------------------------
/uploads/person/34923038703617.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/34923038703617.jpg
--------------------------------------------------------------------------------
/uploads/person/35297058422786.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/35297058422786.jpg
--------------------------------------------------------------------------------
/uploads/person/36682917281793.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/36682917281793.jpg
--------------------------------------------------------------------------------
/uploads/person/910992.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/910992.jpg
--------------------------------------------------------------------------------
/uploads/person/911058.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/911058.jpg
--------------------------------------------------------------------------------
/uploads/person/911067.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/911067.jpg
--------------------------------------------------------------------------------
/uploads/person/911085.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/911085.jpg
--------------------------------------------------------------------------------
/uploads/person/911088.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/911088.jpg
--------------------------------------------------------------------------------
/uploads/person/911100.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/911100.jpg
--------------------------------------------------------------------------------
/uploads/person/911117.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/911117.jpg
--------------------------------------------------------------------------------
/uploads/person/empty1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/empty1.jpg
--------------------------------------------------------------------------------
/uploads/person/empty2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/person/empty2.jpg
--------------------------------------------------------------------------------
/uploads/skin/910992_1514954456.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/skin/910992_1514954456.png
--------------------------------------------------------------------------------
/uploads/skin/911117_1513692322.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/uploads/skin/911117_1513692322.jpg
--------------------------------------------------------------------------------
/vendor/qiniuSDK/.gitignore:
--------------------------------------------------------------------------------
1 | *.phar
2 | *.zip
3 | build/artifacts
4 | phpunit.xml
5 | phpunit.functional.xml
6 | .DS_Store
7 | .swp
8 | .build
9 | composer.lock
10 | vendor
11 | src/package.xml
12 | .idea/
13 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/.scrutinizer.yml:
--------------------------------------------------------------------------------
1 | filter:
2 | excluded_paths: [tests/*]
3 | checks:
4 | php:
5 | code_rating: true
6 | remove_extra_empty_lines: true
7 | remove_php_closing_tag: true
8 | remove_trailing_whitespace: true
9 | fix_use_statements:
10 | remove_unused: true
11 | preserve_multiple: false
12 | preserve_blanklines: true
13 | order_alphabetically: true
14 | fix_php_opening_tag: true
15 | fix_linefeed: true
16 | fix_line_ending: true
17 | fix_identation_4spaces: true
18 | fix_doc_comments: true
19 | tools:
20 | external_code_coverage:
21 | timeout: 1200
22 | runs: 3
23 | php_analyzer: true
24 | php_code_coverage: false
25 | php_code_sniffer:
26 | config:
27 | standard: PSR2
28 | filter:
29 | paths: ['src']
30 | php_loc:
31 | enabled: true
32 | excluded_dirs: [vendor, tests]
33 | php_cpd:
34 | enabled: true
35 | excluded_dirs: [vendor, tests]
36 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 | language: php
3 |
4 | php:
5 | - 5.4
6 | - 5.5
7 | - 5.6
8 | - 7.0
9 |
10 | before_script:
11 | - export QINIU_TEST_ENV="travis"
12 | - travis_retry composer self-update
13 | - travis_retry composer install --no-interaction --prefer-source --dev
14 |
15 | script:
16 | - ./vendor/bin/phpcs --standard=PSR2 src
17 | - ./vendor/bin/phpcs --standard=PSR2 examples
18 | - ./vendor/bin/phpcs --standard=PSR2 tests
19 | - ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover tests/Qiniu/Tests/
20 |
21 | after_script:
22 | - wget https://scrutinizer-ci.com/ocular.phar
23 | - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
24 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 7.2.2 (2017-11-06
4 | ### 增加
5 | * Qiniu算法的鉴权方法
6 |
7 | ## 7.1.4 (2017-06-21)
8 | ### 增加
9 | * cdn 文件/目录 刷新
10 | * cdn 获取 流量/带宽
11 | * cdn 获取域名的访问日志列表
12 | * cdn 对资源链接进行时间戳防盗链签名
13 |
14 | ## 7.1.3 (2016-11-18)
15 | ### 增加
16 | * move, copy操作增加force参数
17 |
18 | ## 7.1.2 (2016-11-12)
19 | ### 修正
20 | * 明确抛出获取各区域域名失败时的报错
21 |
22 | ## 7.1.1 (2016-11-02)
23 | ### 修正
24 | * 多区域配置文件存储目录从home修改到tmp目录
25 |
26 |
27 | ## 7.1.0 (2016-10-22)
28 | ### 增加
29 | * 多存储区域的支持
30 |
31 | ## 7.0.8 (2016-07-19)
32 | ### 增加
33 | * demo
34 | * https url 支持
35 | * deleteAfterDays 策略
36 | * 添加图片处理链接统一拼接方法 by @SherlockRen
37 |
38 | ## 7.0.7 (2016-01-12)
39 | ### 修正
40 | * PersistentFop参数pipeline和notify_url失效
41 | * resume 模式 close file inputstream
42 |
43 | ## 7.0.6 (2015-12-05)
44 | ### 修正
45 | * php7.0 Json 对空字符串解析单元测试报错
46 | * 开启安全模式或者设置可操作目录树时,设置CURLOPT_FOLLOWLOCATION报错, by @twocabbages
47 | * fetch 支持不指定key, by @sinkcup
48 |
49 | ## 7.0.5 (2015-10-29)
50 | ### 增加
51 | * 增加上传策略最小文件大小限制 fsizeMin
52 | * 增加常见examples
53 |
54 | ## 7.0.4 (2015-07-23)
55 | ### 修正
56 | * 一些地方的严格比较检查
57 | * resumeupload 备用地址失效
58 |
59 | ## 7.0.3 (2015-07-10)
60 | ### 修改
61 | * 多zone 支持
62 |
63 | ## 7.0.2 (2015-04-18)
64 | ### 修改
65 | * fetch 接口返回内容调整
66 | * pfop 接口调整
67 |
68 | ###修正
69 | * exception 类调用
70 |
71 | ## 7.0.1 (2015-03-27)
72 | ### 增加
73 | * 增加代码注释
74 |
75 | ## 7.0.0 (2015-02-03)
76 |
77 | ### 增加
78 | * 简化上传接口
79 | * 自动选择断点续上传还是直传
80 | * 重构代码,接口和内部结构更清晰
81 | * 改变mime
82 | * 代码覆盖度报告
83 | * policy改为array, 便于灵活增加,并加入过期字段检查
84 | * 文件列表支持目录形式
85 | * 利用元编程方式支持 fop 和 pfop
86 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # 贡献代码指南
2 |
3 | 我们非常欢迎大家来贡献代码,我们会向贡献者致以最诚挚的敬意。
4 |
5 | 一般可以通过在Github上提交[Pull Request](https://github.com/qiniu/php-sdk)来贡献代码。
6 |
7 | ## Pull Request要求
8 |
9 | - **[PSR-2 编码风格标准](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** 。要通过项目中的code sniffer检查。
10 |
11 | - **代码格式** 提交前 请按 ./vendor/bin/phpcbf --standard=PSR2 进行格式化。
12 |
13 | - **必须添加测试!** - 如果没有测试(单元测试、集成测试都可以),那么提交的补丁是不会通过的。
14 |
15 | - **记得更新文档** - 保证`README.md`以及其他相关文档及时更新,和代码的变更保持一致性。
16 |
17 | - **考虑我们的发布周期** - 我们的版本号会服从[SemVer v2.0.0](http://semver.org/),我们绝对不会随意变更对外的API。
18 |
19 | - **创建feature分支** - 最好不要从你的master分支提交 pull request。
20 |
21 | - **一个feature提交一个pull请求** - 如果你的代码变更了多个操作,那就提交多个pull请求吧。
22 |
23 | - **清晰的commit历史** - 保证你的pull请求的每次commit操作都是有意义的。如果你开发中需要执行多次的即时commit操作,那么请把它们放到一起再提交pull请求。
24 |
25 | ## 运行测试
26 |
27 | ``` bash
28 | ./vendor/bin/phpunit tests/Qiniu/Tests/
29 |
30 | ```
31 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Qiniu, Ltd.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/README.md:
--------------------------------------------------------------------------------
1 | # Qiniu Resource Storage SDK for PHP
2 | [](http://doxygen.io/github.com/qiniu/php-sdk/)
3 | [](LICENSE)
4 | [](https://travis-ci.org/qiniu/php-sdk)
5 | [](https://packagist.org/packages/qiniu/php-sdk)
6 | [](https://packagist.org/packages/qiniu/php-sdk)
7 | [](https://scrutinizer-ci.com/g/qiniu/php-sdk/?branch=master)
8 | [](https://scrutinizer-ci.com/g/qiniu/php-sdk/?branch=master)
9 | [](https://gitter.im/qiniu/php-sdk?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
10 | [](http://weibo.com/qiniutek)
11 |
12 | ## 安装
13 |
14 | * 通过composer,这是推荐的方式,可以使用composer.json 声明依赖,或者运行下面的命令。SDK 包已经放到这里 [`qiniu/php-sdk`][install-packagist] 。
15 | ```bash
16 | $ composer require qiniu/php-sdk
17 | ```
18 | * 直接下载安装,SDK 没有依赖其他第三方库,但需要参照 composer的autoloader,增加一个自己的autoloader程序。
19 |
20 | ## 运行环境
21 |
22 | | Qiniu SDK版本 | PHP 版本 |
23 | |:--------------------:|:---------------------------:|
24 | | 7.x | cURL extension, 5.3 - 5.6,7.0 |
25 | | 6.x | cURL extension, 5.2 - 5.6 |
26 |
27 | ## 使用方法
28 |
29 | ### 上传
30 | ```php
31 | use Qiniu\Storage\UploadManager;
32 | use Qiniu\Auth;
33 | ...
34 | $upManager = new UploadManager();
35 | $auth = new Auth($accessKey, $secretKey);
36 | $token = $auth->uploadToken($bucketName);
37 | list($ret, $error) = $upManager->put($token, 'formput', 'hello world');
38 | ...
39 | ```
40 |
41 | ## 测试
42 |
43 | ``` bash
44 | $ ./vendor/bin/phpunit tests/Qiniu/Tests/
45 | ```
46 |
47 | ## 常见问题
48 |
49 | - $error保留了请求响应的信息,失败情况下ret 为none, 将$error可以打印出来,提交给我们。
50 | - API 的使用 demo 可以参考 [单元测试](https://github.com/qiniu/php-sdk/blob/master/tests)。
51 |
52 | ## 代码贡献
53 |
54 | 详情参考[代码提交指南](https://github.com/qiniu/php-sdk/blob/master/CONTRIBUTING.md)。
55 |
56 | ## 贡献记录
57 |
58 | - [所有贡献者](https://github.com/qiniu/php-sdk/contributors)
59 |
60 | ## 联系我们
61 |
62 | - 如果需要帮助,请提交工单(在portal右侧点击咨询和建议提交工单,或者直接向 support@qiniu.com 发送邮件)
63 | - 如果有什么问题,可以到问答社区提问,[问答社区](http://qiniu.segmentfault.com/)
64 | - 更详细的文档,见[官方文档站](http://developer.qiniu.com/)
65 | - 如果发现了bug, 欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues)
66 | - 如果有功能需求,欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues)
67 | - 如果要提交代码,欢迎提交 pull request
68 | - 欢迎关注我们的[微信](http://www.qiniu.com/#weixin) [微博](http://weibo.com/qiniutek),及时获取动态信息。
69 |
70 | ## 代码许可
71 |
72 | The MIT License (MIT).详情见 [License文件](https://github.com/qiniu/php-sdk/blob/master/LICENSE).
73 |
74 | [packagist]: http://packagist.org
75 | [install-packagist]: https://packagist.org/packages/qiniu/php-sdk
76 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/autoload.php:
--------------------------------------------------------------------------------
1 | =5.3.3"
17 | },
18 | "require-dev": {
19 | "phpunit/phpunit": "~4.0",
20 | "squizlabs/php_codesniffer": "~2.3"
21 | },
22 | "autoload": {
23 | "psr-4": {"Qiniu\\": "src/Qiniu"},
24 | "files": ["src/Qiniu/functions.php"]
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/README.md:
--------------------------------------------------------------------------------
1 | # examples
2 |
3 | 这些 examples 旨在帮助你快速了解使用七牛的sdk。这些demo都是可以直接运行的, 但是在运行之前需要填上您自己的参数。
4 |
5 | 比如:
6 |
7 | * `$bucket` 需要填上您想操作的 [bucket名字](http://developer.qiniu.com/docs/v6/api/overview/concepts.html#bucket)。
8 | * `$accessKey` 和 `$secretKey` 可以在我们的[管理后台](https://portal.qiniu.com/setting/key)找到。
9 | * 在进行`视频转码`, `压缩文件`等异步操作时 需要使用到的队列名称也可以在我们[管理后台](https://portal.qiniu.com/mps/pipeline)新建。
10 |
11 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/cdn_get_bandwidth.php:
--------------------------------------------------------------------------------
1 | getBandwidthData(
29 | $domains,
30 | $startDate,
31 | $endDate,
32 | $granularity
33 | );
34 |
35 | if ($getBandwidthErr != null) {
36 | var_dump($getBandwidthErr);
37 | } else {
38 | echo "get bandwidth data success\n";
39 | print_r($bandwidthData);
40 | }
41 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/cdn_get_flux.php:
--------------------------------------------------------------------------------
1 | getFluxData($domains, $startDate, $endDate, $granularity);
29 | if ($getFluxErr != null) {
30 | var_dump($getFluxErr);
31 | } else {
32 | echo "get flux data success\n";
33 | print_r($fluxData);
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/cdn_get_log_list.php:
--------------------------------------------------------------------------------
1 | getCdnLogList($domains, $logDate);
24 | if ($getLogErr != null) {
25 | var_dump($getLogErr);
26 | } else {
27 | echo "get cdn log list success\n";
28 | print_r($logListData);
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/cdn_refresh_urls_dirs.php:
--------------------------------------------------------------------------------
1 | refreshUrlsAndDirs($urls, $dirs);
29 | if ($refreshErr != null) {
30 | var_dump($refreshErr);
31 | } else {
32 | echo "refresh request sent\n";
33 | print_r($refreshResult);
34 | }
35 |
36 | //如果只有刷新链接或者目录的需求,可以分布使用
37 |
38 | list($refreshResult, $refreshErr) = $cdnManager->refreshUrls($urls);
39 | if ($refreshErr != null) {
40 | var_dump($refreshErr);
41 | } else {
42 | echo "refresh request sent\n";
43 | print_r($refreshResult);
44 | }
45 |
46 | list($refreshResult, $refreshErr) = $cdnManager->refreshDirs($dirs);
47 | if ($refreshErr != null) {
48 | var_dump($refreshErr);
49 | } else {
50 | echo "refresh request sent\n";
51 | print_r($refreshResult);
52 | }
53 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/cdn_timestamp_antileech.php:
--------------------------------------------------------------------------------
1 |
29 | */
30 | $thumbLink = $imageUrlBuilder->thumbnail($url, 1, 100, 100);
31 |
32 | // 函数方式调用 也可拼接多个操作参数 图片+水印
33 | $thumbLink2 = \Qiniu\thumbnail($url2, 1, 100, 100);
34 | var_dump($thumbLink, $thumbLink2);
35 |
36 | /**
37 | * 图片水印
38 | *
39 | * @param string $url 图片链接
40 | * @param string $image 水印图片链接
41 | * @param numeric $dissolve 透明度 [可选]
42 | * @param string $gravity 水印位置 [可选]
43 | * @param numeric $dx 横轴边距 [可选]
44 | * @param numeric $dy 纵轴边距 [可选]
45 | * @param numeric $watermarkScale 自适应原图的短边比例 [可选]
46 | * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html
47 | * @return string
48 | * @author Sherlock Ren
49 | */
50 | $waterLink = $imageUrlBuilder->waterImg($url, $waterImage);
51 | // 函数调用方法
52 | //$waterLink = \Qiniu\waterImg($url, $waterImage);
53 | var_dump($waterLink);
54 |
55 | /**
56 | * 文字水印
57 | *
58 | * @param string $url 图片链接
59 | * @param string $text 文字
60 | * @param string $font 文字字体
61 | * @param string $fontSize 文字字号
62 | * @param string $fontColor 文字颜色 [可选]
63 | * @param numeric $dissolve 透明度 [可选]
64 | * @param string $gravity 水印位置 [可选]
65 | * @param numeric $dx 横轴边距 [可选]
66 | * @param numeric $dy 纵轴边距 [可选]
67 | * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html#text-watermark
68 | * @return string
69 | * @author Sherlock Ren
70 | */
71 | $textLink = $imageUrlBuilder->waterText($url, '你瞅啥', '微软雅黑', 300);
72 | // 函数调用方法
73 | // $textLink = \Qiniu\waterText($url, '你瞅啥', '微软雅黑', 300);
74 | var_dump($textLink);
75 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/persistent_fop_init.php:
--------------------------------------------------------------------------------
1 | execute($bucket, $key, $fops, $pipeline, $notify_url, $force);
34 |
35 | echo "\n====> pfop mkzip result: \n";
36 | if ($err != null) {
37 | var_dump($err);
38 | } else {
39 | echo "PersistentFop Id: $id\n";
40 |
41 | $res = "http://api.qiniu.com/status/get/prefop?id=$id";
42 | echo "Processing result: $res";
43 | }
44 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/pfop_vframe.php:
--------------------------------------------------------------------------------
1 | useHTTPS = true;
25 | $pfop = new PersistentFop($auth, $config);
26 |
27 | //要进行视频截图操作
28 | $fops = "vframe/jpg/offset/1/w/480/h/360/rotate/90|saveas/" .
29 | \Qiniu\base64_urlSafeEncode($bucket . ":qiniu_480x360.jpg");
30 |
31 | list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force);
32 | echo "\n====> pfop avthumb result: \n";
33 | if ($err != null) {
34 | var_dump($err);
35 | } else {
36 | echo "PersistentFop Id: $id\n";
37 | }
38 |
39 | //查询转码的进度和状态
40 | list($ret, $err) = $pfop->status($id);
41 | echo "\n====> pfop avthumb status: \n";
42 | if ($err != null) {
43 | var_dump($err);
44 | } else {
45 | var_dump($ret);
46 | }
47 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/pfop_video_avthumb.php:
--------------------------------------------------------------------------------
1 | useHTTPS=true;
26 |
27 | $pfop = new PersistentFop($auth, $config);
28 |
29 | //要进行转码的转码操作。 http://developer.qiniu.com/docs/v6/api/reference/fop/av/avthumb.html
30 | $fops = "avthumb/mp4/s/640x360/vb/1.4m|saveas/" . \Qiniu\base64_urlSafeEncode($bucket . ":qiniu_640x360.mp4");
31 |
32 | list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force);
33 | echo "\n====> pfop avthumb result: \n";
34 | if ($err != null) {
35 | var_dump($err);
36 | } else {
37 | echo "PersistentFop Id: $id\n";
38 | }
39 |
40 | //查询转码的进度和状态
41 | list($ret, $err) = $pfop->status($id);
42 | echo "\n====> pfop avthumb status: \n";
43 | if ($err != null) {
44 | var_dump($err);
45 | } else {
46 | var_dump($ret);
47 | }
48 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/pfop_watermark.php:
--------------------------------------------------------------------------------
1 | useHTTPS=true;
27 | $pfop = new PersistentFop($auth, $config);
28 |
29 | //需要添加水印的图片UrlSafeBase64
30 | //可以参考http://developer.qiniu.com/code/v6/api/dora-api/av/video-watermark.html
31 | $base64URL = Qiniu\base64_urlSafeEncode('http://devtools.qiniu.com/qiniu.png');
32 |
33 | //水印参数
34 | $fops = "avthumb/mp4/s/640x360/vb/1.4m/image/" . $base64URL . "|saveas/"
35 | . \Qiniu\base64_urlSafeEncode($bucket . ":qiniu_wm.mp4");
36 |
37 | list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force);
38 | echo "\n====> pfop avthumb result: \n";
39 | if ($err != null) {
40 | var_dump($err);
41 | } else {
42 | echo "PersistentFop Id: $id\n";
43 | }
44 |
45 | //查询转码的进度和状态
46 | list($ret, $err) = $pfop->status($id);
47 | echo "\n====> pfop avthumb status: \n";
48 | if ($err != null) {
49 | var_dump($err);
50 | } else {
51 | var_dump($ret);
52 | }
53 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/php-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shmilylbelva/webim/c3471d4cc8a9e29fb61de3ab1a1197bbc535e09e/vendor/qiniuSDK/examples/php-logo.png
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/prefop.php:
--------------------------------------------------------------------------------
1 | status($id);
24 | echo "\n====> pfop avthumb status: \n";
25 | if ($err != null) {
26 | var_dump($err);
27 | } else {
28 | var_dump($ret);
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/qetag.php:
--------------------------------------------------------------------------------
1 | 'video/x-mp4',
18 | 'qiniu.png' => 'image/x-png',
19 | 'qiniu.jpg' => 'image/x-jpg'
20 | );
21 |
22 | $ops = $bucketManager->buildBatchChangeMime($bucket, $keyMimePairs);
23 | list($ret, $err) = $bucketManager->batch($ops);
24 | if ($err) {
25 | print_r($err);
26 | } else {
27 | print_r($ret);
28 | }
29 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_batch_change_type.php:
--------------------------------------------------------------------------------
1 | buildBatchChangeType($bucket, $keyTypePairs);
29 | list($ret, $err) = $bucketManager->batch($ops);
30 | if ($err) {
31 | print_r($err);
32 | } else {
33 | print_r($ret);
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_batch_copy.php:
--------------------------------------------------------------------------------
1 | buildBatchCopy($srcBucket, $keyPairs, $destBucket, true);
31 | list($ret, $err) = $bucketManager->batch($ops);
32 | if ($err) {
33 | print_r($err);
34 | } else {
35 | print_r($ret);
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_batch_delete.php:
--------------------------------------------------------------------------------
1 | buildBatchDelete($bucket, $keys);
23 | list($ret, $err) = $bucketManager->batch($ops);
24 | if ($err) {
25 | print_r($err);
26 | } else {
27 | print_r($ret);
28 | }
29 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_batch_delete_after_days.php:
--------------------------------------------------------------------------------
1 | buildBatchDeleteAfterDays($bucket, $keyDayPairs);
29 | list($ret, $err) = $bucketManager->batch($ops);
30 | if ($err) {
31 | print_r($err);
32 | } else {
33 | print_r($ret);
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_batch_move.php:
--------------------------------------------------------------------------------
1 | buildBatchMove($srcBucket, $keyPairs, $destBucket, true);
31 | list($ret, $err) = $bucketManager->batch($ops);
32 | if ($err) {
33 | print_r($err);
34 | } else {
35 | print_r($ret);
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_batch_stat.php:
--------------------------------------------------------------------------------
1 | buildBatchStat($bucket, $keys);
23 | list($ret, $err) = $bucketManager->batch($ops);
24 | if ($err) {
25 | print_r($err);
26 | } else {
27 | print_r($ret);
28 | }
29 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_bucket_domains.php:
--------------------------------------------------------------------------------
1 | domains($bucket);
15 | if ($err) {
16 | print_r($err);
17 | } else {
18 | print_r($domains);
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_buckets.php:
--------------------------------------------------------------------------------
1 | buckets(true);
15 | if ($err) {
16 | print_r($err);
17 | } else {
18 | print_r($buckets);
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_change_mime.php:
--------------------------------------------------------------------------------
1 | changeMime($bucket, $key, $newMime);
18 | if ($err) {
19 | print_r($err);
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_change_type.php:
--------------------------------------------------------------------------------
1 | changeType($bucket, $key, $fileType);
18 | if ($err) {
19 | print_r($err);
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_copy.php:
--------------------------------------------------------------------------------
1 | copy($srcBucket, $srcKey, $destBucket, $destKey, true);
20 | if ($err) {
21 | print_r($err);
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_delete.php:
--------------------------------------------------------------------------------
1 | delete($bucket, $key);
15 | if ($err) {
16 | print_r($err);
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_delete_after_days.php:
--------------------------------------------------------------------------------
1 | deleteAfterDays($bucket, $key, $days);
18 | if ($err) {
19 | print_r($err);
20 | }
21 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_download_urls.php:
--------------------------------------------------------------------------------
1 | /
13 | $baseUrl = 'http://if-pri.qiniudn.com/qiniu.png?imageView2/1/h/500';
14 | // 对链接进行签名
15 | $signedUrl = $auth->privateDownloadUrl($baseUrl);
16 |
17 | echo $signedUrl;
18 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_fetch.php:
--------------------------------------------------------------------------------
1 | fetch($url, $bucket, $key);
19 | echo "=====> fetch $url to bucket: $bucket key: $key\n";
20 | if ($err !== null) {
21 | var_dump($err);
22 | } else {
23 | print_r($ret);
24 | }
25 |
26 | // 不指定key时,以文件内容的hash作为文件名
27 | $key = null;
28 | list($ret, $err) = $bucketManager->fetch($url, $bucket, $key);
29 | echo "=====> fetch $url to bucket: $bucket key: $(etag)\n";
30 | if ($err !== null) {
31 | var_dump($err);
32 | } else {
33 | print_r($ret);
34 | }
35 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_move.php:
--------------------------------------------------------------------------------
1 | move($srcBucket, $srcKey, $destBucket, $destKey, true);
20 | if ($err) {
21 | print_r($err);
22 | }
23 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_prefetch.php:
--------------------------------------------------------------------------------
1 | prefetch($bucket, $key);
15 | if ($err) {
16 | print_r($err);
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rs_stat.php:
--------------------------------------------------------------------------------
1 | stat($bucket, $key);
15 | if ($err) {
16 | print_r($err);
17 | } else {
18 | print_r($fileInfo);
19 | }
20 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rsf_list_bucket.php:
--------------------------------------------------------------------------------
1 | listFiles($bucket, $prefix, $marker, $limit, $delimiter);
30 | if ($err !== null) {
31 | echo "\n====> list file err: \n";
32 | var_dump($err);
33 | } else {
34 | $marker = null;
35 | if (array_key_exists('marker', $ret)) {
36 | $marker = $ret['marker'];
37 | }
38 | echo "Marker: $marker\n";
39 | echo "\nList Items====>\n";
40 | //var_dump($ret['items']);
41 | print('items count:' . count($ret['items']) . "\n");
42 | if (array_key_exists('commonPrefixes', $ret)) {
43 | print_r($ret['commonPrefixes']);
44 | }
45 | }
46 | } while (!empty($marker));
47 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/rsf_list_files.php:
--------------------------------------------------------------------------------
1 | listFiles($bucket, $prefix, $marker, $limit, $delimiter);
29 | if ($err !== null) {
30 | echo "\n====> list file err: \n";
31 | var_dump($err);
32 | } else {
33 | if (array_key_exists('marker', $ret)) {
34 | echo "Marker:" . $ret["marker"] . "\n";
35 | }
36 | echo "\nList Iterms====>\n";
37 | //var_dump($ret['items']);
38 | }
39 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/saveas.php:
--------------------------------------------------------------------------------
1 | :';//为生成缩略图的文件名
13 | //生成的值
14 | $encodedEntryURI = \Qiniu\base64_urlSafeEncode($entry);
15 |
16 | //使用SecretKey对新的下载URL进行HMAC1-SHA1签名
17 | $newurl = "78re52.com1.z0.glb.clouddn.com/resource/Ship.jpg?imageView2/2/w/200/h/200|saveas/" . $encodedEntryURI;
18 |
19 | $sign = hash_hmac("sha1", $newurl, $secretKey, true);
20 |
21 | //对签名进行URL安全的Base64编码
22 | $encodedSign = \Qiniu\base64_urlSafeEncode($sign);
23 | //最终得到的完整下载URL
24 | $finalURL = "http://" . $newurl . "/sign/" . $accessKey . ":" . $encodedSign;
25 |
26 | $callbackBody = file_get_contents("$finalURL");
27 |
28 | echo $callbackBody;
29 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/upload_and_callback.php:
--------------------------------------------------------------------------------
1 | 'http://your.domain.com/upload_verify_callback.php',
16 | 'callbackBody' => 'filename=$(fname)&filesize=$(fsize)'
17 | );
18 | $uptoken = $auth->uploadToken($bucket, null, 3600, $policy);
19 |
20 | //上传文件的本地路径
21 | $filePath = './php-logo.png';
22 |
23 | $uploadMgr = new UploadManager();
24 |
25 | list($ret, $err) = $uploadMgr->putFile($uptoken, null, $filePath);
26 | echo "\n====> putFile result: \n";
27 | if ($err !== null) {
28 | var_dump($err);
29 | } else {
30 | var_dump($ret);
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/upload_and_pfop.php:
--------------------------------------------------------------------------------
1 | uploadToken($bucket);
16 | $uploadMgr = new UploadManager();
17 |
18 | $pfop = "imageMogr2/rotate/90|saveas/" . \Qiniu\base64_urlSafeEncode($bucket . ":php-logo-rotate.png");
19 |
20 | //转码完成后通知到你的业务服务器。(公网可以访问,并相应200 OK)
21 | $notifyUrl = 'http://notify.fake.com';
22 |
23 | //独立的转码队列:https://portal.qiniu.com/mps/pipeline
24 | $pipeline = 'sdktest';
25 |
26 | $policy = array(
27 | 'persistentOps' => $pfop,
28 | 'persistentNotifyUrl' => $notifyUrl,
29 | 'persistentPipeline' => $pipeline
30 | );
31 | $token = $auth->uploadToken($bucket, null, 3600, $policy);
32 |
33 | list($ret, $err) = $uploadMgr->putFile($token, null, $key);
34 | echo "\n====> putFile result: \n";
35 | if ($err !== null) {
36 | var_dump($err);
37 | } else {
38 | var_dump($ret);
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/upload_mgr_init.php:
--------------------------------------------------------------------------------
1 | uploadToken($bucket);
16 |
17 | // 构建 UploadManager 对象
18 | $uploadMgr = new UploadManager();
19 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/upload_multi_demos.php:
--------------------------------------------------------------------------------
1 | uploadToken($bucket);
14 | $uploadMgr = new UploadManager();
15 |
16 | //----------------------------------------upload demo1 ----------------------------------------
17 | // 上传字符串到七牛
18 | list($ret, $err) = $uploadMgr->put($token, null, 'content string');
19 | echo "\n====> put result: \n";
20 | if ($err !== null) {
21 | var_dump($err);
22 | } else {
23 | var_dump($ret);
24 | }
25 |
26 |
27 | //----------------------------------------upload demo2 ----------------------------------------
28 | // 上传文件到七牛
29 | $filePath = './php-logo.png';
30 | $key = 'php-logo.png';
31 | list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath);
32 | echo "\n====> putFile result: \n";
33 | if ($err !== null) {
34 | var_dump($err);
35 | } else {
36 | var_dump($ret);
37 | }
38 |
39 |
40 | //----------------------------------------upload demo3 ----------------------------------------
41 | // 上传文件到七牛后, 七牛将文件名和文件大小回调给业务服务器.
42 | // 可参考文档: http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html
43 | $policy = array(
44 | 'callbackUrl' => 'http://172.30.251.210/upload_verify_callback.php',
45 | 'callbackBody' => 'filename=$(fname)&filesize=$(fsize)'
46 | // 'callbackBodyType' => 'application/json',
47 | // 'callbackBody' => '{"filename":$(fname), "filesize": $(fsize)}' //设置application/json格式回调
48 | );
49 | $token = $auth->uploadToken($bucket, null, 3600, $policy);
50 |
51 |
52 | list($ret, $err) = $uploadMgr->putFile($token, null, $key);
53 | echo "\n====> putFile result: \n";
54 | if ($err !== null) {
55 | var_dump($err);
56 | } else {
57 | var_dump($ret);
58 | }
59 |
60 |
61 | //----------------------------------------upload demo4 ----------------------------------------
62 | //上传视频,上传完成后进行m3u8的转码, 并给视频打水印
63 | $wmImg = Qiniu\base64_urlSafeEncode('http://devtools.qiniudn.com/qiniu.png');
64 | $pfop = "avthumb/m3u8/wmImage/$wmImg";
65 |
66 | //转码完成后回调到业务服务器。(公网可以访问,并相应200 OK)
67 | $notifyUrl = 'http://notify.fake.com';
68 |
69 | //独立的转码队列:https://portal.qiniu.com/mps/pipeline
70 |
71 |
72 | $policy = array(
73 | 'persistentOps' => $pfop,
74 | 'persistentNotifyUrl' => $notifyUrl,
75 | 'persistentPipeline' => $pipeline
76 | );
77 | $token = $auth->uploadToken($bucket, null, 3600, $policy);
78 | print($token);
79 | list($ret, $err) = $uploadMgr->putFile($token, null, $key);
80 | echo "\n====> putFile result: \n";
81 | if ($err !== null) {
82 | var_dump($err);
83 | } else {
84 | var_dump($ret);
85 | }
86 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/upload_simple_file.php:
--------------------------------------------------------------------------------
1 | uploadToken($bucket);
20 |
21 | // 要上传文件的本地路径
22 | $filePath = './php-logo.png';
23 |
24 | // 上传到七牛后保存的文件名
25 | $key = 'my-php-logo.png';
26 |
27 | // 初始化 UploadManager 对象并进行文件的上传。
28 | $uploadMgr = new UploadManager();
29 |
30 | // 调用 UploadManager 的 putFile 方法进行文件的上传。
31 | list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath);
32 | echo "\n====> putFile result: \n";
33 | if ($err !== null) {
34 | var_dump($err);
35 | } else {
36 | var_dump($ret);
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/upload_tokens.php:
--------------------------------------------------------------------------------
1 | uploadToken($bucket, null, $expires, $policy, true);
18 | print($upToken . "\n");
19 |
20 | // 自定义凭证有效期(示例2小时)
21 | $expires = 7200;
22 | $upToken = $auth->uploadToken($bucket, null, $expires, $policy, true);
23 | print($upToken . "\n");
24 |
25 | // 覆盖上传凭证
26 | $expires = 3600;
27 | $keyToOverwrite = 'qiniu.mp4';
28 | $upToken = $auth->uploadToken($bucket, $keyToOverwrite, $expires, $policy, true);
29 | print($upToken . "\n");
30 |
31 | //自定义上传回复(非callback模式)凭证
32 | $returnBody = '{"key":"$(key)","hash":"$(etag)","fsize":$(fsize),"bucket":"$(bucket)","name":"$(x:name)"}';
33 | $policy = array(
34 | 'returnBody' => $returnBody
35 | );
36 | $upToken = $auth->uploadToken($bucket, null, $expires, $policy, true);
37 | print($upToken . "\n");
38 |
39 | //带回调业务服务器的凭证(application/json)
40 | $policy = array(
41 | 'callbackUrl' => 'http://api.example.com/qiniu/upload/callback',
42 | 'callbackBody' => '{"key":"$(key)","hash":"$(etag)","fsize":$(fsize),"bucket":"$(bucket)","name":"$(x:name)"}',
43 | 'callbackBodyType' => 'application/json'
44 | );
45 | $upToken = $auth->uploadToken($bucket, null, $expires, $policy, true);
46 | print($upToken . "\n");
47 |
48 |
49 | //带回调业务服务器的凭证(application/x-www-form-urlencoded)
50 | $policy = array(
51 | 'callbackUrl' => 'http://api.example.com/qiniu/upload/callback',
52 | 'callbackBody' => 'key=$(key)&hash=$(etag)&bucket=$(bucket)&fsize=$(fsize)&name=$(x:name)'
53 | );
54 | $upToken = $auth->uploadToken($bucket, null, $expires, $policy, true);
55 | print($upToken . "\n");
56 |
57 | //带数据处理的凭证
58 | $saveMp4Entry = \Qiniu\base64_urlSafeEncode($bucket . ":avthumb_test_target.mp4");
59 | $saveJpgEntry = \Qiniu\base64_urlSafeEncode($bucket . ":vframe_test_target.jpg");
60 | $avthumbMp4Fop = "avthumb/mp4|saveas/" . $saveMp4Entry;
61 | $vframeJpgFop = "vframe/jpg/offset/1|saveas/" . $saveJpgEntry;
62 | $policy = array(
63 | 'persistentOps' => $avthumbMp4Fop . ";" . $vframeJpgFop,
64 | 'persistentPipeline' => "video-pipe",
65 | 'persistentNotifyUrl' => "http://api.example.com/qiniu/pfop/notify",
66 | );
67 | $upToken = $auth->uploadToken($bucket, null, $expires, $policy, true);
68 | print($upToken . "\n");
69 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/examples/upload_verify_callback.php:
--------------------------------------------------------------------------------
1 | verifyCallback($contentType, $authorization, $url, $callbackBody);
25 |
26 | if ($isQiniuCallback) {
27 | $resp = array('ret' => 'success');
28 | } else {
29 | $resp = array('ret' => 'failed');
30 | }
31 |
32 | echo json_encode($resp);
33 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | tests
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/src/Qiniu/Auth.php:
--------------------------------------------------------------------------------
1 | accessKey = $accessKey;
14 | $this->secretKey = $secretKey;
15 | }
16 |
17 | public function getAccessKey()
18 | {
19 | return $this->accessKey;
20 | }
21 |
22 | public function sign($data)
23 | {
24 | $hmac = hash_hmac('sha1', $data, $this->secretKey, true);
25 | return $this->accessKey . ':' . \Qiniu\base64_urlSafeEncode($hmac);
26 | }
27 |
28 | public function signWithData($data)
29 | {
30 | $encodedData = \Qiniu\base64_urlSafeEncode($data);
31 | return $this->sign($encodedData) . ':' . $encodedData;
32 | }
33 |
34 | public function signRequest($urlString, $body, $contentType = null)
35 | {
36 | $url = parse_url($urlString);
37 | $data = '';
38 | if (array_key_exists('path', $url)) {
39 | $data = $url['path'];
40 | }
41 | if (array_key_exists('query', $url)) {
42 | $data .= '?' . $url['query'];
43 | }
44 | $data .= "\n";
45 |
46 | if ($body !== null && $contentType === 'application/x-www-form-urlencoded') {
47 | $data .= $body;
48 | }
49 | return $this->sign($data);
50 | }
51 |
52 | public function verifyCallback($contentType, $originAuthorization, $url, $body)
53 | {
54 | $authorization = 'QBox ' . $this->signRequest($url, $body, $contentType);
55 | return $originAuthorization === $authorization;
56 | }
57 |
58 | public function privateDownloadUrl($baseUrl, $expires = 3600)
59 | {
60 | $deadline = time() + $expires;
61 |
62 | $pos = strpos($baseUrl, '?');
63 | if ($pos !== false) {
64 | $baseUrl .= '&e=';
65 | } else {
66 | $baseUrl .= '?e=';
67 | }
68 | $baseUrl .= $deadline;
69 |
70 | $token = $this->sign($baseUrl);
71 | return "$baseUrl&token=$token";
72 | }
73 |
74 | public function uploadToken($bucket, $key = null, $expires = 3600, $policy = null, $strictPolicy = true)
75 | {
76 | $deadline = time() + $expires;
77 | $scope = $bucket;
78 | if ($key !== null) {
79 | $scope .= ':' . $key;
80 | }
81 |
82 | $args = self::copyPolicy($args, $policy, $strictPolicy);
83 | $args['scope'] = $scope;
84 | $args['deadline'] = $deadline;
85 |
86 | $b = json_encode($args);
87 | return $this->signWithData($b);
88 | }
89 |
90 | /**
91 | *上传策略,参数规格详见
92 | *http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html
93 | */
94 | private static $policyFields = array(
95 | 'callbackUrl',
96 | 'callbackBody',
97 | 'callbackHost',
98 | 'callbackBodyType',
99 | 'callbackFetchKey',
100 |
101 | 'returnUrl',
102 | 'returnBody',
103 |
104 | 'endUser',
105 | 'saveKey',
106 | 'insertOnly',
107 |
108 | 'detectMime',
109 | 'mimeLimit',
110 | 'fsizeMin',
111 | 'fsizeLimit',
112 |
113 | 'persistentOps',
114 | 'persistentNotifyUrl',
115 | 'persistentPipeline',
116 |
117 | 'deleteAfterDays',
118 | 'fileType',
119 | 'isPrefixalScope',
120 | );
121 |
122 | private static function copyPolicy(&$policy, $originPolicy, $strictPolicy)
123 | {
124 | if ($originPolicy === null) {
125 | return array();
126 | }
127 | foreach ($originPolicy as $key => $value) {
128 | if (!$strictPolicy || in_array((string)$key, self::$policyFields, true)) {
129 | $policy[$key] = $value;
130 | }
131 | }
132 | return $policy;
133 | }
134 |
135 | public function authorization($url, $body = null, $contentType = null)
136 | {
137 | $authorization = 'QBox ' . $this->signRequest($url, $body, $contentType);
138 | return array('Authorization' => $authorization);
139 | }
140 |
141 | public function authorizationV2($url, $method, $body = null, $contentType = null)
142 | {
143 | $urlItems = parse_url($url);
144 | $host = $urlItems['host'];
145 |
146 | if (isset($urlItems['port'])) {
147 | $port = $urlItems['port'];
148 | } else {
149 | $port = '';
150 | }
151 |
152 | $path = $urlItems['path'];
153 | if (isset($urlItems['query'])) {
154 | $query = $urlItems['query'];
155 | } else {
156 | $query = '';
157 | }
158 |
159 | //write request uri
160 | $toSignStr = $method . ' ' . $path;
161 | if (!empty($query)) {
162 | $toSignStr .= '?' . $query;
163 | }
164 |
165 | //write host and port
166 | $toSignStr .= "\nHost: " . $host;
167 | if (!empty($port)) {
168 | $toSignStr .= ":" . $port;
169 | }
170 |
171 | //write content type
172 | if (!empty($contentType)) {
173 | $toSignStr .= "\nContent-Type: " . $contentType;
174 | }
175 |
176 | $toSignStr .= "\n\n";
177 |
178 | //write body
179 | if (!empty($body)) {
180 | $toSignStr .= $body;
181 | }
182 |
183 | $sign = $this->sign($toSignStr);
184 | $auth = 'Qiniu ' . $sign;
185 | return array('Authorization' => $auth);
186 | }
187 | }
188 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/src/Qiniu/Config.php:
--------------------------------------------------------------------------------
1 | zone = $z;
28 | $this->useHTTPS = false;
29 | $this->useCdnDomains = false;
30 | $this->zoneCache = array();
31 | }
32 |
33 | public function getUpHost($accessKey, $bucket)
34 | {
35 | $zone = $this->getZone($accessKey, $bucket);
36 | if ($this->useHTTPS === true) {
37 | $scheme = "https://";
38 | } else {
39 | $scheme = "http://";
40 | }
41 |
42 | $host = $zone->srcUpHosts[0];
43 | if ($this->useCdnDomains === true) {
44 | $host = $zone->cdnUpHosts[0];
45 | }
46 |
47 | return $scheme . $host;
48 | }
49 |
50 | public function getUpBackupHost($accessKey, $bucket)
51 | {
52 | $zone = $this->getZone($accessKey, $bucket);
53 | if ($this->useHTTPS === true) {
54 | $scheme = "https://";
55 | } else {
56 | $scheme = "http://";
57 | }
58 |
59 | $host = $zone->cdnUpHosts[0];
60 | if ($this->useCdnDomains === true) {
61 | $host = $zone->srcUpHosts[0];
62 | }
63 |
64 | return $scheme . $host;
65 | }
66 |
67 | public function getRsHost($accessKey, $bucket)
68 | {
69 | $zone = $this->getZone($accessKey, $bucket);
70 |
71 | if ($this->useHTTPS === true) {
72 | $scheme = "https://";
73 | } else {
74 | $scheme = "http://";
75 | }
76 |
77 | return $scheme . $zone->rsHost;
78 | }
79 |
80 | public function getRsfHost($accessKey, $bucket)
81 | {
82 | $zone = $this->getZone($accessKey, $bucket);
83 |
84 | if ($this->useHTTPS === true) {
85 | $scheme = "https://";
86 | } else {
87 | $scheme = "http://";
88 | }
89 |
90 | return $scheme . $zone->rsfHost;
91 | }
92 |
93 | public function getIovipHost($accessKey, $bucket)
94 | {
95 | $zone = $this->getZone($accessKey, $bucket);
96 |
97 | if ($this->useHTTPS === true) {
98 | $scheme = "https://";
99 | } else {
100 | $scheme = "http://";
101 | }
102 |
103 | return $scheme . $zone->iovipHost;
104 | }
105 |
106 | public function getApiHost($accessKey, $bucket)
107 | {
108 | $zone = $this->getZone($accessKey, $bucket);
109 |
110 | if ($this->useHTTPS === true) {
111 | $scheme = "https://";
112 | } else {
113 | $scheme = "http://";
114 | }
115 |
116 | return $scheme . $zone->apiHost;
117 | }
118 |
119 | private function getZone($accessKey, $bucket)
120 | {
121 | $cacheId = "$accessKey:$bucket";
122 |
123 | if (isset($this->zoneCache[$cacheId])) {
124 | $zone = $this->zoneCache[$cacheId];
125 | } elseif (isset($this->zone)) {
126 | $zone = $this->zone;
127 | $this->zoneCache[$cacheId] = $zone;
128 | } else {
129 | $zone = Zone::queryZone($accessKey, $bucket);
130 | $this->zoneCache[$cacheId] = $zone;
131 | }
132 | return $zone;
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/src/Qiniu/Etag.php:
--------------------------------------------------------------------------------
1 | $val) {
35 | array_push($data, '--' . $mimeBoundary);
36 | array_push($data, "Content-Disposition: form-data; name=\"$key\"");
37 | array_push($data, '');
38 | array_push($data, $val);
39 | }
40 |
41 | array_push($data, '--' . $mimeBoundary);
42 | $finalMimeType = empty($mimeType) ? 'application/octet-stream' : $mimeType;
43 | $finalFileName = self::escapeQuotes($fileName);
44 | array_push($data, "Content-Disposition: form-data; name=\"$name\"; filename=\"$finalFileName\"");
45 | array_push($data, "Content-Type: $finalMimeType");
46 | array_push($data, '');
47 | array_push($data, $fileBody);
48 |
49 | array_push($data, '--' . $mimeBoundary . '--');
50 | array_push($data, '');
51 |
52 | $body = implode("\r\n", $data);
53 | $contentType = 'multipart/form-data; boundary=' . $mimeBoundary;
54 | $headers['Content-Type'] = $contentType;
55 | $request = new Request('POST', $url, $headers, $body);
56 | return self::sendRequest($request);
57 | }
58 |
59 | private static function userAgent()
60 | {
61 | $sdkInfo = "QiniuPHP/" . Config::SDK_VER;
62 |
63 | $systemInfo = php_uname("s");
64 | $machineInfo = php_uname("m");
65 |
66 | $envInfo = "($systemInfo/$machineInfo)";
67 |
68 | $phpVer = phpversion();
69 |
70 | $ua = "$sdkInfo $envInfo PHP/$phpVer";
71 | return $ua;
72 | }
73 |
74 | public static function sendRequest($request)
75 | {
76 | $t1 = microtime(true);
77 | $ch = curl_init();
78 | $options = array(
79 | CURLOPT_USERAGENT => self::userAgent(),
80 | CURLOPT_RETURNTRANSFER => true,
81 | CURLOPT_SSL_VERIFYPEER => false,
82 | CURLOPT_SSL_VERIFYHOST => false,
83 | CURLOPT_HEADER => true,
84 | CURLOPT_NOBODY => false,
85 | CURLOPT_CUSTOMREQUEST => $request->method,
86 | CURLOPT_URL => $request->url
87 | );
88 |
89 | // Handle open_basedir & safe mode
90 | if (!ini_get('safe_mode') && !ini_get('open_basedir')) {
91 | $options[CURLOPT_FOLLOWLOCATION] = true;
92 | }
93 |
94 | if (!empty($request->headers)) {
95 | $headers = array();
96 | foreach ($request->headers as $key => $val) {
97 | array_push($headers, "$key: $val");
98 | }
99 | $options[CURLOPT_HTTPHEADER] = $headers;
100 | }
101 | curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
102 |
103 | if (!empty($request->body)) {
104 | $options[CURLOPT_POSTFIELDS] = $request->body;
105 | }
106 | curl_setopt_array($ch, $options);
107 | $result = curl_exec($ch);
108 | $t2 = microtime(true);
109 | $duration = round($t2 - $t1, 3);
110 | $ret = curl_errno($ch);
111 | if ($ret !== 0) {
112 | $r = new Response(-1, $duration, array(), null, curl_error($ch));
113 | curl_close($ch);
114 | return $r;
115 | }
116 | $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
117 | $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
118 | $headers = self::parseHeaders(substr($result, 0, $header_size));
119 | $body = substr($result, $header_size);
120 | curl_close($ch);
121 | return new Response($code, $duration, $headers, $body, null);
122 | }
123 |
124 | private static function parseHeaders($raw)
125 | {
126 | $headers = array();
127 | $headerLines = explode("\r\n", $raw);
128 | foreach ($headerLines as $line) {
129 | $headerLine = trim($line);
130 | $kv = explode(':', $headerLine);
131 | if (count($kv) > 1) {
132 | $headers[$kv[0]] = trim($kv[1]);
133 | }
134 | }
135 | return $headers;
136 | }
137 |
138 | private static function escapeQuotes($str)
139 | {
140 | $find = array("\\", "\"");
141 | $replace = array("\\\\", "\\\"");
142 | return str_replace($find, $replace, $str);
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/src/Qiniu/Http/Error.php:
--------------------------------------------------------------------------------
1 |
7 | * {"error" : "detailed error message"}
8 | *
9 | */
10 | final class Error
11 | {
12 | private $url;
13 | private $response;
14 |
15 | public function __construct($url, $response)
16 | {
17 | $this->url = $url;
18 | $this->response = $response;
19 | }
20 |
21 | public function code()
22 | {
23 | return $this->response->statusCode;
24 | }
25 |
26 | public function getResponse()
27 | {
28 | return $this->response;
29 | }
30 |
31 | public function message()
32 | {
33 | return $this->response->error;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/src/Qiniu/Http/Request.php:
--------------------------------------------------------------------------------
1 | method = strtoupper($method);
14 | $this->url = $url;
15 | $this->headers = $headers;
16 | $this->body = $body;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/src/Qiniu/Http/Response.php:
--------------------------------------------------------------------------------
1 | 'Continue',
20 | 101 => 'Switching Protocols',
21 | 102 => 'Processing',
22 | 200 => 'OK',
23 | 201 => 'Created',
24 | 202 => 'Accepted',
25 | 203 => 'Non-Authoritative Information',
26 | 204 => 'No Content',
27 | 205 => 'Reset Content',
28 | 206 => 'Partial Content',
29 | 207 => 'Multi-Status',
30 | 208 => 'Already Reported',
31 | 226 => 'IM Used',
32 | 300 => 'Multiple Choices',
33 | 301 => 'Moved Permanently',
34 | 302 => 'Found',
35 | 303 => 'See Other',
36 | 304 => 'Not Modified',
37 | 305 => 'Use Proxy',
38 | 307 => 'Temporary Redirect',
39 | 308 => 'Permanent Redirect',
40 | 400 => 'Bad Request',
41 | 401 => 'Unauthorized',
42 | 402 => 'Payment Required',
43 | 403 => 'Forbidden',
44 | 404 => 'Not Found',
45 | 405 => 'Method Not Allowed',
46 | 406 => 'Not Acceptable',
47 | 407 => 'Proxy Authentication Required',
48 | 408 => 'Request Timeout',
49 | 409 => 'Conflict',
50 | 410 => 'Gone',
51 | 411 => 'Length Required',
52 | 412 => 'Precondition Failed',
53 | 413 => 'Request Entity Too Large',
54 | 414 => 'Request-URI Too Long',
55 | 415 => 'Unsupported Media Type',
56 | 416 => 'Requested Range Not Satisfiable',
57 | 417 => 'Expectation Failed',
58 | 422 => 'Unprocessable Entity',
59 | 423 => 'Locked',
60 | 424 => 'Failed Dependency',
61 | 425 => 'Reserved for WebDAV advanced collections expired proposal',
62 | 426 => 'Upgrade required',
63 | 428 => 'Precondition Required',
64 | 429 => 'Too Many Requests',
65 | 431 => 'Request Header Fields Too Large',
66 | 500 => 'Internal Server Error',
67 | 501 => 'Not Implemented',
68 | 502 => 'Bad Gateway',
69 | 503 => 'Service Unavailable',
70 | 504 => 'Gateway Timeout',
71 | 505 => 'HTTP Version Not Supported',
72 | 506 => 'Variant Also Negotiates (Experimental)',
73 | 507 => 'Insufficient Storage',
74 | 508 => 'Loop Detected',
75 | 510 => 'Not Extended',
76 | 511 => 'Network Authentication Required',
77 | );
78 |
79 | /**
80 | * @param int $code 状态码
81 | * @param double $duration 请求时长
82 | * @param array $headers 响应头部
83 | * @param string $body 响应内容
84 | * @param string $error 错误描述
85 | */
86 | public function __construct($code, $duration, array $headers = array(), $body = null, $error = null)
87 | {
88 | $this->statusCode = $code;
89 | $this->duration = $duration;
90 | $this->headers = $headers;
91 | $this->body = $body;
92 | $this->error = $error;
93 | $this->jsonData = null;
94 | if ($error !== null) {
95 | return;
96 | }
97 |
98 | if ($body === null) {
99 | if ($code >= 400) {
100 | $this->error = self::$statusTexts[$code];
101 | }
102 | return;
103 | }
104 | if (self::isJson($headers)) {
105 | try {
106 | $jsonData = self::bodyJson($body);
107 | if ($code >= 400) {
108 | $this->error = $body;
109 | if ($jsonData['error'] !== null) {
110 | $this->error = $jsonData['error'];
111 | }
112 | }
113 | $this->jsonData = $jsonData;
114 | } catch (\InvalidArgumentException $e) {
115 | $this->error = $body;
116 | if ($code >= 200 && $code < 300) {
117 | $this->error = $e->getMessage();
118 | }
119 | }
120 | } elseif ($code >= 400) {
121 | $this->error = $body;
122 | }
123 | return;
124 | }
125 |
126 | public function json()
127 | {
128 | return $this->jsonData;
129 | }
130 |
131 | private static function bodyJson($body)
132 | {
133 | return \Qiniu\json_decode((string)$body, true, 512);
134 | }
135 |
136 | public function xVia()
137 | {
138 | $via = $this->headers['X-Via'];
139 | if ($via === null) {
140 | $via = $this->headers['X-Px'];
141 | }
142 | if ($via === null) {
143 | $via = $this->headers['Fw-Via'];
144 | }
145 | return $via;
146 | }
147 |
148 | public function xLog()
149 | {
150 | return $this->headers['X-Log'];
151 | }
152 |
153 | public function xReqId()
154 | {
155 | return $this->headers['X-Reqid'];
156 | }
157 |
158 | public function ok()
159 | {
160 | return $this->statusCode >= 200 && $this->statusCode < 300 && $this->error === null;
161 | }
162 |
163 | public function needRetry()
164 | {
165 | $code = $this->statusCode;
166 | if ($code < 0 || ($code / 100 === 5 and $code !== 579) || $code === 996) {
167 | return true;
168 | }
169 | }
170 |
171 | private static function isJson($headers)
172 | {
173 | return array_key_exists('Content-Type', $headers) &&
174 | strpos($headers['Content-Type'], 'application/json') === 0;
175 | }
176 | }
177 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/src/Qiniu/Processing/Operation.php:
--------------------------------------------------------------------------------
1 | auth = $auth;
18 | $this->domain = $domain;
19 | $this->token_expire = $token_expire;
20 | }
21 |
22 |
23 | /**
24 | * 对资源文件进行处理
25 | *
26 | * @param $key 待处理的资源文件名
27 | * @param $fops string|array fop操作,多次fop操作以array的形式传入。
28 | * eg. imageView2/1/w/200/h/200, imageMogr2/thumbnail/!75px
29 | *
30 | * @return array 文件处理后的结果及错误。
31 | *
32 | * @link http://developer.qiniu.com/docs/v6/api/reference/fop/
33 | */
34 | public function execute($key, $fops)
35 | {
36 | $url = $this->buildUrl($key, $fops);
37 | $resp = Client::get($url);
38 | if (!$resp->ok()) {
39 | return array(null, new Error($url, $resp));
40 | }
41 | if ($resp->json() !== null) {
42 | return array($resp->json(), null);
43 | }
44 | return array($resp->body, null);
45 | }
46 |
47 | public function buildUrl($key, $fops, $protocol = 'http')
48 | {
49 | if (is_array($fops)) {
50 | $fops = implode('|', $fops);
51 | }
52 |
53 | $url = $protocol . "://$this->domain/$key?$fops";
54 | if ($this->auth !== null) {
55 | $url = $this->auth->privateDownloadUrl($url, $this->token_expire);
56 | }
57 |
58 | return $url;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/src/Qiniu/Processing/PersistentFop.php:
--------------------------------------------------------------------------------
1 | auth = $auth;
30 | if ($config == null) {
31 | $this->config = new Config();
32 | } else {
33 | $this->config = $config;
34 | }
35 | }
36 |
37 | /**
38 | * 对资源文件进行异步持久化处理
39 | * @param $bucket 资源所在空间
40 | * @param $key 待处理的源文件
41 | * @param $fops string|array 待处理的pfop操作,多个pfop操作以array的形式传入。
42 | * eg. avthumb/mp3/ab/192k, vframe/jpg/offset/7/w/480/h/360
43 | * @param $pipeline 资源处理队列
44 | * @param $notify_url 处理结果通知地址
45 | * @param $force 是否强制执行一次新的指令
46 | *
47 | *
48 | * @return array 返回持久化处理的persistentId, 和返回的错误。
49 | *
50 | * @link http://developer.qiniu.com/docs/v6/api/reference/fop/
51 | */
52 | public function execute($bucket, $key, $fops, $pipeline = null, $notify_url = null, $force = false)
53 | {
54 | if (is_array($fops)) {
55 | $fops = implode(';', $fops);
56 | }
57 | $params = array('bucket' => $bucket, 'key' => $key, 'fops' => $fops);
58 | \Qiniu\setWithoutEmpty($params, 'pipeline', $pipeline);
59 | \Qiniu\setWithoutEmpty($params, 'notifyURL', $notify_url);
60 | if ($force) {
61 | $params['force'] = 1;
62 | }
63 | $data = http_build_query($params);
64 | $scheme = "http://";
65 | if ($this->config->useHTTPS === true) {
66 | $scheme = "https://";
67 | }
68 | $url = $scheme . Config::API_HOST . '/pfop/';
69 | $headers = $this->auth->authorization($url, $data, 'application/x-www-form-urlencoded');
70 | $headers['Content-Type'] = 'application/x-www-form-urlencoded';
71 | $response = Client::post($url, $data, $headers);
72 | if (!$response->ok()) {
73 | return array(null, new Error($url, $response));
74 | }
75 | $r = $response->json();
76 | $id = $r['persistentId'];
77 | return array($id, null);
78 | }
79 |
80 | public function status($id)
81 | {
82 | $scheme = "http://";
83 |
84 | if ($this->config->useHTTPS === true) {
85 | $scheme = "https://";
86 | }
87 | $url = $scheme . Config::API_HOST . "/status/get/prefop?id=$id";
88 | $response = Client::get($url);
89 | if (!$response->ok()) {
90 | return array(null, new Error($url, $response));
91 | }
92 | return array($response->json(), null);
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/src/Qiniu/Storage/FormUploader.php:
--------------------------------------------------------------------------------
1 | "",
24 | * "key" => ""
25 | * ]
26 | */
27 | public static function put(
28 | $upToken,
29 | $key,
30 | $data,
31 | $config,
32 | $params,
33 | $mime
34 | ) {
35 |
36 | $fields = array('token' => $upToken);
37 | if ($key === null) {
38 | $fname = 'filename';
39 | } else {
40 | $fname = $key;
41 | $fields['key'] = $key;
42 | }
43 |
44 | //enable crc32 check by default
45 | $fields['crc32'] = \Qiniu\crc32_data($data);
46 |
47 | if ($params) {
48 | foreach ($params as $k => $v) {
49 | $fields[$k] = $v;
50 | }
51 | }
52 |
53 | list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($upToken);
54 | if ($err != null) {
55 | return array(null, $err);
56 | }
57 |
58 | $upHost = $config->getUpHost($accessKey, $bucket);
59 |
60 | $response = Client::multipartPost($upHost, $fields, 'file', $fname, $data, $mime);
61 | if (!$response->ok()) {
62 | return array(null, new Error($upHost, $response));
63 | }
64 | return array($response->json(), null);
65 | }
66 |
67 | /**
68 | * 上传文件到七牛,内部使用
69 | *
70 | * @param $upToken 上传凭证
71 | * @param $key 上传文件名
72 | * @param $filePath 上传文件的路径
73 | * @param $config 上传配置
74 | * @param $params 自定义变量,规格参考
75 | * http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
76 | * @param $mime 上传数据的mimeType
77 | *
78 | * @return array 包含已上传文件的信息,类似:
79 | * [
80 | * "hash" => "",
81 | * "key" => ""
82 | * ]
83 | */
84 | public static function putFile(
85 | $upToken,
86 | $key,
87 | $filePath,
88 | $config,
89 | $params,
90 | $mime
91 | ) {
92 |
93 |
94 | $fields = array('token' => $upToken, 'file' => self::createFile($filePath, $mime));
95 | if ($key !== null) {
96 | $fields['key'] = $key;
97 | }
98 |
99 | $fields['crc32'] = \Qiniu\crc32_file($filePath);
100 |
101 | if ($params) {
102 | foreach ($params as $k => $v) {
103 | $fields[$k] = $v;
104 | }
105 | }
106 | $fields['key'] = $key;
107 | $headers = array('Content-Type' => 'multipart/form-data');
108 |
109 | list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($upToken);
110 | if ($err != null) {
111 | return array(null, $err);
112 | }
113 |
114 | $upHost = $config->getUpHost($accessKey, $bucket);
115 |
116 | $response = Client::post($upHost, $fields, $headers);
117 | if (!$response->ok()) {
118 | return array(null, new Error($upHost, $response));
119 | }
120 | return array($response->json(), null);
121 | }
122 |
123 | private static function createFile($filename, $mime)
124 | {
125 | // PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
126 | // See: https://wiki.php.net/rfc/curl-file-upload
127 | if (function_exists('curl_file_create')) {
128 | return curl_file_create($filename, $mime);
129 | }
130 |
131 | // Use the old style if using an older version of PHP
132 | $value = "@{$filename}";
133 | if (!empty($mime)) {
134 | $value .= ';type=' . $mime;
135 | }
136 |
137 | return $value;
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/src/Qiniu/Storage/ResumeUploader.php:
--------------------------------------------------------------------------------
1 | upToken = $upToken;
51 | $this->key = $key;
52 | $this->inputStream = $inputStream;
53 | $this->size = $size;
54 | $this->params = $params;
55 | $this->mime = $mime;
56 | $this->contexts = array();
57 | $this->config = $config;
58 |
59 | list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($upToken);
60 | if ($err != null) {
61 | return array(null, $err);
62 | }
63 |
64 | $upHost = $config->getUpHost($accessKey, $bucket);
65 | if ($err != null) {
66 | throw new \Exception($err->message(), 1);
67 | }
68 | $this->host = $upHost;
69 | }
70 |
71 | /**
72 | * 上传操作
73 | */
74 | public function upload()
75 | {
76 | $uploaded = 0;
77 | while ($uploaded < $this->size) {
78 | $blockSize = $this->blockSize($uploaded);
79 | $data = fread($this->inputStream, $blockSize);
80 | if ($data === false) {
81 | throw new \Exception("file read failed", 1);
82 | }
83 | $crc = \Qiniu\crc32_data($data);
84 | $response = $this->makeBlock($data, $blockSize);
85 | $ret = null;
86 | if ($response->ok() && $response->json() != null) {
87 | $ret = $response->json();
88 | }
89 | if ($response->statusCode < 0) {
90 | list($accessKey, $bucket, $err) = \Qiniu\explodeUpToken($this->upToken);
91 | if ($err != null) {
92 | return array(null, $err);
93 | }
94 |
95 | $upHostBackup = $this->config->getUpBackupHost($accessKey, $bucket);
96 | $this->host = $upHostBackup;
97 | }
98 | if ($response->needRetry() || !isset($ret['crc32']) || $crc != $ret['crc32']) {
99 | $response = $this->makeBlock($data, $blockSize);
100 | $ret = $response->json();
101 | }
102 |
103 | if (!$response->ok() || !isset($ret['crc32']) || $crc != $ret['crc32']) {
104 | return array(null, new Error($this->currentUrl, $response));
105 | }
106 | array_push($this->contexts, $ret['ctx']);
107 | $uploaded += $blockSize;
108 | }
109 | return $this->makeFile();
110 | }
111 |
112 | /**
113 | * 创建块
114 | */
115 | private function makeBlock($block, $blockSize)
116 | {
117 | $url = $this->host . '/mkblk/' . $blockSize;
118 | return $this->post($url, $block);
119 | }
120 |
121 | private function fileUrl()
122 | {
123 | $url = $this->host . '/mkfile/' . $this->size;
124 | $url .= '/mimeType/' . \Qiniu\base64_urlSafeEncode($this->mime);
125 | if ($this->key != null) {
126 | $url .= '/key/' . \Qiniu\base64_urlSafeEncode($this->key);
127 | }
128 | if (!empty($this->params)) {
129 | foreach ($this->params as $key => $value) {
130 | $val = \Qiniu\base64_urlSafeEncode($value);
131 | $url .= "/$key/$val";
132 | }
133 | }
134 | return $url;
135 | }
136 |
137 | /**
138 | * 创建文件
139 | */
140 | private function makeFile()
141 | {
142 | $url = $this->fileUrl();
143 | $body = implode(',', $this->contexts);
144 | $response = $this->post($url, $body);
145 | if ($response->needRetry()) {
146 | $response = $this->post($url, $body);
147 | }
148 | if (!$response->ok()) {
149 | return array(null, new Error($this->currentUrl, $response));
150 | }
151 | return array($response->json(), null);
152 | }
153 |
154 | private function post($url, $data)
155 | {
156 | $this->currentUrl = $url;
157 | $headers = array('Authorization' => 'UpToken ' . $this->upToken);
158 | return Client::post($url, $data, $headers);
159 | }
160 |
161 | private function blockSize($uploaded)
162 | {
163 | if ($this->size < $uploaded + Config::BLOCK_SIZE) {
164 | return $this->size - $uploaded;
165 | }
166 | return Config::BLOCK_SIZE;
167 | }
168 | }
169 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/src/Qiniu/Storage/UploadManager.php:
--------------------------------------------------------------------------------
1 | config = $config;
24 | }
25 |
26 | /**
27 | * 上传二进制流到七牛
28 | *
29 | * @param $upToken 上传凭证
30 | * @param $key 上传文件名
31 | * @param $data 上传二进制流
32 | * @param $params 自定义变量,规格参考
33 | * http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
34 | * @param $mime 上传数据的mimeType
35 | * @param $checkCrc 是否校验crc32
36 | *
37 | * @return array 包含已上传文件的信息,类似:
38 | * [
39 | * "hash" => "",
40 | * "key" => ""
41 | * ]
42 | */
43 | public function put(
44 | $upToken,
45 | $key,
46 | $data,
47 | $params = null,
48 | $mime = 'application/octet-stream',
49 | $checkCrc = false
50 | ) {
51 | $params = self::trimParams($params);
52 | return FormUploader::put(
53 | $upToken,
54 | $key,
55 | $data,
56 | $this->config,
57 | $params,
58 | $mime,
59 | $checkCrc
60 | );
61 | }
62 |
63 |
64 | /**
65 | * 上传文件到七牛
66 | *
67 | * @param $upToken 上传凭证
68 | * @param $key 上传文件名
69 | * @param $filePath 上传文件的路径
70 | * @param $params 自定义变量,规格参考
71 | * http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
72 | * @param $mime 上传数据的mimeType
73 | * @param $checkCrc 是否校验crc32
74 | *
75 | * @return array 包含已上传文件的信息,类似:
76 | * [
77 | * "hash" => "",
78 | * "key" => ""
79 | * ]
80 | */
81 | public function putFile(
82 | $upToken,
83 | $key,
84 | $filePath,
85 | $params = null,
86 | $mime = 'application/octet-stream',
87 | $checkCrc = false
88 | ) {
89 | $file = fopen($filePath, 'rb');
90 | if ($file === false) {
91 | throw new \Exception("file can not open", 1);
92 | }
93 | $params = self::trimParams($params);
94 | $stat = fstat($file);
95 | $size = $stat['size'];
96 | if ($size <= Config::BLOCK_SIZE) {
97 | $data = fread($file, $size);
98 | fclose($file);
99 | if ($data === false) {
100 | throw new \Exception("file can not read", 1);
101 | }
102 | return FormUploader::put(
103 | $upToken,
104 | $key,
105 | $data,
106 | $this->config,
107 | $params,
108 | $mime,
109 | $checkCrc
110 | );
111 | }
112 |
113 | $up = new ResumeUploader(
114 | $upToken,
115 | $key,
116 | $file,
117 | $size,
118 | $params,
119 | $mime,
120 | $this->config
121 | );
122 | $ret = $up->upload();
123 | fclose($file);
124 | return $ret;
125 | }
126 |
127 | public static function trimParams($params)
128 | {
129 | if ($params === null) {
130 | return null;
131 | }
132 | $ret = array();
133 | foreach ($params as $k => $v) {
134 | $pos = strpos($k, 'x:');
135 | if ($pos === 0 && !empty($v)) {
136 | $ret[$k] = $v;
137 | }
138 | }
139 | return $ret;
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/src/Qiniu/Zone.php:
--------------------------------------------------------------------------------
1 | srcUpHosts = $srcUpHosts;
34 | $this->cdnUpHosts = $cdnUpHosts;
35 | $this->rsHost = $rsHost;
36 | $this->rsfHost = $rsfHost;
37 | $this->apiHost = $apiHost;
38 | $this->iovipHost = $iovipHost;
39 | }
40 |
41 | //华东机房
42 | public static function zone0()
43 | {
44 | $Zone_z0 = new Zone(
45 | array("up.qiniup.com", 'up-nb.qiniup.com', 'up-xs.qiniup.com'),
46 | array('upload.qiniup.com', 'upload-nb.qiniup.com', 'upload-xs.qiniup.com'),
47 | 'rs.qiniu.com',
48 | 'rsf.qiniu.com',
49 | 'api.qiniu.com',
50 | 'iovip.qbox.me'
51 | );
52 | return $Zone_z0;
53 | }
54 |
55 | //华北机房
56 | public static function zone1()
57 | {
58 | $Zone_z1 = new Zone(
59 | array('up-z1.qiniup.com'),
60 | array('upload-z1.qiniup.com'),
61 | "rs-z1.qiniu.com",
62 | "rsf-z1.qiniu.com",
63 | "api-z1.qiniu.com",
64 | "iovip-z1.qbox.me"
65 | );
66 |
67 | return $Zone_z1;
68 | }
69 |
70 | //华南机房
71 | public static function zone2()
72 | {
73 | $Zone_z2 = new Zone(
74 | array('up-z2.qiniup.com', 'up-gz.qiniup.com', 'up-fs.qiniup.com'),
75 | array('upload-z2.qiniup.com', 'upload-gz.qiniup.com', 'upload-fs.qiniup.com'),
76 | "rs-z2.qiniu.com",
77 | "rsf-z2.qiniu.com",
78 | "api-z2.qiniu.com",
79 | "iovip-z2.qbox.me"
80 | );
81 | return $Zone_z2;
82 | }
83 |
84 | //北美机房
85 | public static function zoneNa0()
86 | {
87 | //北美机房
88 | $Zone_na0 = new Zone(
89 | array('up-na0.qiniup.com'),
90 | array('upload-na0.qiniup.com'),
91 | "rs-na0.qiniu.com",
92 | "rsf-na0.qiniu.com",
93 | "api-na0.qiniu.com",
94 | "iovip-na0.qbox.me"
95 | );
96 | return $Zone_na0;
97 | }
98 |
99 | /*
100 | * GET /v2/query?ak=&&bucket=
101 | **/
102 | public static function queryZone($ak, $bucket)
103 | {
104 | $zone = new Zone();
105 | $url = Config::UC_HOST . '/v2/query' . "?ak=$ak&bucket=$bucket";
106 | $ret = Client::Get($url);
107 | if (!$ret->ok()) {
108 | return array(null, new Error($url, $ret));
109 | }
110 | $r = ($ret->body === null) ? array() : $ret->json();
111 | //parse zone;
112 |
113 | $iovipHost = $r['io']['src']['main'][0];
114 | $zone->iovipHost = $iovipHost;
115 | $accMain = $r['up']['acc']['main'][0];
116 | array_push($zone->cdnUpHosts, $accMain);
117 | if (isset($r['up']['acc']['backup'])) {
118 | foreach ($r['up']['acc']['backup'] as $key => $value) {
119 | array_push($zone->cdnUpHosts, $value);
120 | }
121 | }
122 | $srcMain = $r['up']['src']['main'][0];
123 | array_push($zone->srcUpHosts, $srcMain);
124 | if (isset($r['up']['src']['backup'])) {
125 | foreach ($r['up']['src']['backup'] as $key => $value) {
126 | array_push($zone->srcUpHosts, $value);
127 | }
128 | }
129 |
130 | //set specific hosts
131 | if (strstr($zone->iovipHost, "z1") !== false) {
132 | $zone->rsHost = "rs-z1.qiniu.com";
133 | $zone->rsfHost = "rsf-z1.qiniu.com";
134 | $zone->apiHost = "api-z1.qiniu.com";
135 | } elseif (strstr($zone->iovipHost, "z2") !== false) {
136 | $zone->rsHost = "rs-z2.qiniu.com";
137 | $zone->rsfHost = "rsf-z2.qiniu.com";
138 | $zone->apiHost = "api-z2.qiniu.com";
139 | } elseif (strstr($zone->iovipHost, "na0") !== false) {
140 | $zone->rsHost = "rs-na0.qiniu.com";
141 | $zone->rsfHost = "rsf-na0.qiniu.com";
142 | $zone->apiHost = "api-na0.qiniu.com";
143 | } else {
144 | $zone->rsHost = "rs.qiniu.com";
145 | $zone->rsfHost = "rsf.qiniu.com";
146 | $zone->apiHost = "api.qiniu.com";
147 | }
148 |
149 | return $zone;
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/test-env.sh:
--------------------------------------------------------------------------------
1 | export QINIU_ACCESS_KEY=xxx
2 | export QINIU_SECRET_KEY=xxx
3 | export QINIU_TEST_BUCKET=phpsdk
4 | export QINIU_TEST_DOMAIN=phpsdk.qiniudn.com
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/Qiniu/Tests/AuthTest.php:
--------------------------------------------------------------------------------
1 | sign('test');
25 | $this->assertEquals('abcdefghklmnopq:mSNBTR7uS2crJsyFr2Amwv1LaYg=', $token);
26 | }
27 |
28 | public function testSignWithData()
29 | {
30 | global $dummyAuth;
31 | $token = $dummyAuth->signWithData('test');
32 | $this->assertEquals('abcdefghklmnopq:-jP8eEV9v48MkYiBGs81aDxl60E=:dGVzdA==', $token);
33 | }
34 |
35 | public function testSignRequest()
36 | {
37 | global $dummyAuth;
38 | $token = $dummyAuth->signRequest('http://www.qiniu.com?go=1', 'test', '');
39 | $this->assertEquals('abcdefghklmnopq:cFyRVoWrE3IugPIMP5YJFTO-O-Y=', $token);
40 | $ctype = 'application/x-www-form-urlencoded';
41 | $token = $dummyAuth->signRequest('http://www.qiniu.com?go=1', 'test', $ctype);
42 | $this->assertEquals($token, 'abcdefghklmnopq:svWRNcacOE-YMsc70nuIYdaa1e4=');
43 | }
44 |
45 | public function testPrivateDownloadUrl()
46 | {
47 | global $dummyAuth;
48 | $_SERVER['override_qiniu_auth_time'] = true;
49 | $url = $dummyAuth->privateDownloadUrl('http://www.qiniu.com?go=1');
50 | $expect = 'http://www.qiniu.com?go=1&e=1234571490&token=abcdefghklmnopq:8vzBeLZ9W3E4kbBLFLW0Xe0u7v4=';
51 | $this->assertEquals($expect, $url);
52 | unset($_SERVER['override_qiniu_auth_time']);
53 | }
54 |
55 | public function testUploadToken()
56 | {
57 | global $dummyAuth;
58 | $_SERVER['override_qiniu_auth_time'] = true;
59 | $token = $dummyAuth->uploadToken('1', '2', 3600, array('endUser' => 'y'));
60 | // @codingStandardsIgnoreStart
61 | $exp = 'abcdefghklmnopq:yyeexeUkPOROoTGvwBjJ0F0VLEo=:eyJlbmRVc2VyIjoieSIsInNjb3BlIjoiMToyIiwiZGVhZGxpbmUiOjEyMzQ1NzE0OTB9';
62 | // @codingStandardsIgnoreEnd
63 | $this->assertEquals($exp, $token);
64 | unset($_SERVER['override_qiniu_auth_time']);
65 | }
66 |
67 | public function testVerifyCallback()
68 | {
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/Qiniu/Tests/Base64Test.php:
--------------------------------------------------------------------------------
1 | assertEquals($a, \Qiniu\base64_urlSafeDecode($b));
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/Qiniu/Tests/CdnManagerTest.php:
--------------------------------------------------------------------------------
1 | cdnManager = new CdnManager($testAuth);
27 | $this->encryptKey = $timestampAntiLeechEncryptKey;
28 | $this->imgUrl = $customDomain . '/24.jpg';
29 | }
30 |
31 | public function testCreateTimestampAntiLeechUrl()
32 | {
33 |
34 | $signUrl = $this->cdnManager->createTimestampAntiLeechUrl($this->imgUrl, $this->encryptKey, 3600);
35 |
36 | $response = Client::get($signUrl);
37 | $this->assertEquals($response->statusCode, 200);
38 | $this->assertNull($response->error);
39 |
40 | $url2 = $this->imgUrl . '?imageInfo';
41 | $signUrl2 = $this->cdnManager->createTimestampAntiLeechUrl($url2, $this->encryptKey, 3600);
42 |
43 | $response = Client::get($signUrl2);
44 | $imgInfo = $response->json();
45 |
46 | $this->assertEquals($response->statusCode, 200);
47 | $this->assertEquals($imgInfo['size'], 2196145);
48 | $this->assertNull($response->error);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/Qiniu/Tests/Crc32Test.php:
--------------------------------------------------------------------------------
1 | assertEquals('1352841281', $b);
13 | }
14 |
15 | public function testFile()
16 | {
17 | $b = \Qiniu\crc32_file(__file__);
18 | $c = \Qiniu\crc32_file(__file__);
19 | $this->assertEquals($c, $b);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/Qiniu/Tests/DownloadTest.php:
--------------------------------------------------------------------------------
1 | privateDownloadUrl($base_url);
13 | $response = Client::get($private_url);
14 | $this->assertEquals(200, $response->statusCode);
15 | }
16 |
17 | public function testFop()
18 | {
19 | global $testAuth;
20 | $base_url = 'http://private-res.qiniudn.com/gogopher.jpg?exif';
21 | $private_url = $testAuth->privateDownloadUrl($base_url);
22 | $response = Client::get($private_url);
23 | $this->assertEquals(200, $response->statusCode);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/Qiniu/Tests/EtagTest.php:
--------------------------------------------------------------------------------
1 | assertEquals('Fto5o-5ea0sNMlW_75VgGJCv2AcJ', $r);
14 | $this->assertNull($error);
15 | }
16 |
17 | public function testLess4M()
18 | {
19 | $file = qiniuTempFile(3 * 1024 * 1024);
20 | list($r, $error) = Etag::sum($file);
21 | unlink($file);
22 | $this->assertEquals('Fs5BpnAjRykYTg6o5E09cjuXrDkG', $r);
23 | $this->assertNull($error);
24 | }
25 |
26 | public function test4M()
27 | {
28 | $file = qiniuTempFile(4 * 1024 * 1024);
29 | list($r, $error) = Etag::sum($file);
30 | unlink($file);
31 | $this->assertEquals('FiuKULnybewpEnrfTmxjsxc-3dWp', $r);
32 | $this->assertNull($error);
33 | }
34 |
35 | public function testMore4M()
36 | {
37 | $file = qiniuTempFile(5 * 1024 * 1024);
38 | list($r, $error) = Etag::sum($file);
39 | unlink($file);
40 | $this->assertEquals('lhvyfIWMYFTq4s4alzlhXoAkqfVL', $r);
41 | $this->assertNull($error);
42 | }
43 |
44 | public function test8M()
45 | {
46 | $file = qiniuTempFile(8 * 1024 * 1024);
47 | list($r, $error) = Etag::sum($file);
48 | unlink($file);
49 | $this->assertEquals('lmRm9ZfGZ86bnMys4wRTWtJj9ClG', $r);
50 | $this->assertNull($error);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/Qiniu/Tests/FopTest.php:
--------------------------------------------------------------------------------
1 | execute('gogopher.jpg', 'exif');
13 | $this->assertNull($error);
14 | $this->assertNotNull($exif);
15 | }
16 |
17 | public function testExifPrivate()
18 | {
19 | global $testAuth;
20 | $fop = new Operation('private-res.qiniudn.com', $testAuth);
21 | list($exif, $error) = $fop->execute('noexif.jpg', 'exif');
22 | $this->assertNotNull($error);
23 | $this->assertNull($exif);
24 | }
25 |
26 | public function testbuildUrl()
27 | {
28 | $fops = 'imageView2/2/h/200';
29 | $fop = new Operation('testres.qiniudn.com');
30 | $url = $fop->buildUrl('gogopher.jpg', $fops);
31 | $this->assertEquals($url, 'http://testres.qiniudn.com/gogopher.jpg?imageView2/2/h/200');
32 |
33 | $fops = array('imageView2/2/h/200', 'imageInfo');
34 | $url = $fop->buildUrl('gogopher.jpg', $fops);
35 | $this->assertEquals($url, 'http://testres.qiniudn.com/gogopher.jpg?imageView2/2/h/200|imageInfo');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/Qiniu/Tests/FormUpTest.php:
--------------------------------------------------------------------------------
1 | bucketName = $bucketName;
18 |
19 | global $testAuth;
20 | $this->auth = $testAuth;
21 | $this->cfg = new Config();
22 | }
23 |
24 | public function testData()
25 | {
26 | $token = $this->auth->uploadToken($this->bucketName);
27 | list($ret, $error) = FormUploader::put($token, 'formput', 'hello world', $this->cfg, null, 'text/plain', true);
28 | $this->assertNull($error);
29 | $this->assertNotNull($ret['hash']);
30 | }
31 |
32 | public function testData2()
33 | {
34 | $upManager = new UploadManager();
35 | $token = $this->auth->uploadToken($this->bucketName);
36 | list($ret, $error) = $upManager->put($token, 'formput', 'hello world', null, 'text/plain', true);
37 | $this->assertNull($error);
38 | $this->assertNotNull($ret['hash']);
39 | }
40 |
41 | public function testFile()
42 | {
43 | $key = 'formPutFile';
44 | $token = $this->auth->uploadToken($this->bucketName, $key);
45 | list($ret, $error) = FormUploader::putFile($token, $key, __file__, $this->cfg, null, 'text/plain', true);
46 | $this->assertNull($error);
47 | $this->assertNotNull($ret['hash']);
48 | }
49 |
50 | public function testFile2()
51 | {
52 | $key = 'formPutFile';
53 | $token = $this->auth->uploadToken($this->bucketName, $key);
54 | $upManager = new UploadManager();
55 | list($ret, $error) = $upManager->putFile($token, $key, __file__, null, 'text/plain', true);
56 | $this->assertNull($error);
57 | $this->assertNotNull($ret['hash']);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/Qiniu/Tests/HttpTest.php:
--------------------------------------------------------------------------------
1 | assertEquals($response->statusCode, 200);
12 | $this->assertNotNull($response->body);
13 | $this->assertNull($response->error);
14 | }
15 |
16 | public function testGetQiniu()
17 | {
18 | $response = Client::get('up.qiniu.com');
19 | $this->assertEquals(405, $response->statusCode);
20 | $this->assertNotNull($response->body);
21 | $this->assertNotNull($response->xReqId());
22 | $this->assertNotNull($response->xLog());
23 | $this->assertNotNull($response->error);
24 | }
25 |
26 | public function testPost()
27 | {
28 | $response = Client::post('baidu.com', null);
29 | $this->assertEquals($response->statusCode, 200);
30 | $this->assertNotNull($response->body);
31 | $this->assertNull($response->error);
32 | }
33 |
34 | public function testPostQiniu()
35 | {
36 | $response = Client::post('up.qiniu.com', null);
37 | $this->assertEquals($response->statusCode, 400);
38 | $this->assertNotNull($response->body);
39 | $this->assertNotNull($response->xReqId());
40 | $this->assertNotNull($response->xLog());
41 | $this->assertNotNull($response->error);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/Qiniu/Tests/PfopTest.php:
--------------------------------------------------------------------------------
1 | execute($bucket, $key, $fops);
18 | $this->assertNull($error);
19 | list($status, $error) = $pfop->status($id);
20 | $this->assertNotNull($status);
21 | $this->assertNull($error);
22 | }
23 |
24 |
25 | public function testPfops()
26 | {
27 | global $testAuth;
28 | $bucket = 'testres';
29 | $key = 'sintel_trailer.mp4';
30 | $fops = array(
31 | 'avthumb/m3u8/segtime/10/vcodec/libx264/s/320x240',
32 | 'vframe/jpg/offset/7/w/480/h/360',
33 | );
34 | $pfop = new PersistentFop($testAuth, null);
35 |
36 | list($id, $error) = $pfop->execute($bucket, $key, $fops);
37 | $this->assertNull($error);
38 |
39 | list($status, $error) = $pfop->status($id);
40 | $this->assertNotNull($status);
41 | $this->assertNull($error);
42 | }
43 |
44 | public function testMkzip()
45 | {
46 | global $testAuth;
47 | $bucket = 'phpsdk';
48 | $key = 'php-logo.png';
49 | $pfop = new PersistentFop($testAuth, null);
50 |
51 | $url1 = 'http://phpsdk.qiniudn.com/php-logo.png';
52 | $url2 = 'http://phpsdk.qiniudn.com/php-sdk.html';
53 | $zipKey = 'test.zip';
54 |
55 | $fops = 'mkzip/2/url/' . \Qiniu\base64_urlSafeEncode($url1);
56 | $fops .= '/url/' . \Qiniu\base64_urlSafeEncode($url2);
57 | $fops .= '|saveas/' . \Qiniu\base64_urlSafeEncode("$bucket:$zipKey");
58 |
59 | list($id, $error) = $pfop->execute($bucket, $key, $fops);
60 | $this->assertNull($error);
61 |
62 | list($status, $error) = $pfop->status($id);
63 | $this->assertNotNull($status);
64 | $this->assertNull($error);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/Qiniu/Tests/ResumeUpTest.php:
--------------------------------------------------------------------------------
1 | bucketName = $bucketName;
18 |
19 | global $testAuth;
20 | $this->auth = $testAuth;
21 | }
22 |
23 | public function test4ML()
24 | {
25 | $key = 'resumePutFile4ML';
26 | $upManager = new UploadManager();
27 | $token = $this->auth->uploadToken($this->bucketName, $key);
28 | $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10);
29 | list($ret, $error) = $upManager->putFile($token, $key, $tempFile);
30 | $this->assertNull($error);
31 | $this->assertNotNull($ret['hash']);
32 | unlink($tempFile);
33 | }
34 |
35 | public function test4ML2()
36 | {
37 | $key = 'resumePutFile4ML';
38 | $zone = new Zone(array('up.fake.qiniu.com'), array('up.qiniup.com'));
39 | $cfg = new Config($zone);
40 | $upManager = new UploadManager($cfg);
41 | $token = $this->auth->uploadToken($this->bucketName, $key);
42 | $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10);
43 | list($ret, $error) = $upManager->putFile($token, $key, $tempFile);
44 | $this->assertNull($error);
45 | $this->assertNotNull($ret['hash']);
46 | unlink($tempFile);
47 | }
48 |
49 | // public function test8M()
50 | // {
51 | // $key = 'resumePutFile8M';
52 | // $upManager = new UploadManager();
53 | // $token = $this->auth->uploadToken($this->bucketName, $key);
54 | // $tempFile = qiniuTempFile(8*1024*1024+10);
55 | // list($ret, $error) = $upManager->putFile($token, $key, $tempFile);
56 | // $this->assertNull($error);
57 | // $this->assertNotNull($ret['hash']);
58 | // unlink($tempFile);
59 | // }
60 | }
61 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/Qiniu/Tests/ZoneTest.php:
--------------------------------------------------------------------------------
1 | bucketName = $bucketName;
22 |
23 | global $bucketNameBC;
24 | $this->bucketNameBC = $bucketNameBC;
25 |
26 | global $bucketNameNA;
27 | $this->bucketNameNA = $bucketNameNA;
28 |
29 | global $accessKey;
30 | $this->ak = $accessKey;
31 |
32 | $this->zone = new Zone();
33 | $this->zoneHttps = new Zone('https');
34 | }
35 |
36 | public function testUpHosts()
37 | {
38 | $zone = Zone::queryZone($this->ak, $this->bucketName);
39 | print_r($zone);
40 | $this->assertContains('upload.qiniup.com', $zone->cdnUpHosts);
41 |
42 | $zone = Zone::queryZone($this->ak, $this->bucketNameBC);
43 | $this->assertContains('upload-z1.qiniup.com', $zone->cdnUpHosts);
44 |
45 | $zone = Zone::queryZone($this->ak, $this->bucketNameNA);
46 | $this->assertContains('upload-na0.qiniup.com', $zone->cdnUpHosts);
47 | }
48 |
49 | public function testIoHosts()
50 | {
51 | $zone = Zone::queryZone($this->ak, $this->bucketName);
52 | $this->assertEquals($zone->iovipHost, 'iovip.qbox.me');
53 |
54 | $zone = Zone::queryZone($this->ak, $this->bucketNameBC);
55 | $this->assertEquals($zone->iovipHost, 'iovip-z1.qbox.me');
56 |
57 | $zone = Zone::queryZone($this->ak, $this->bucketNameNA);
58 | $this->assertEquals($zone->iovipHost, 'iovip-na0.qbox.me');
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/vendor/qiniuSDK/tests/bootstrap.php:
--------------------------------------------------------------------------------
1 | 0) {
38 | fseek($file, $size - 1);
39 | fwrite($file, ' ');
40 | }
41 | fclose($file);
42 | return $fileName;
43 | }
44 |
--------------------------------------------------------------------------------