正在显示
96 个修改的文件
包含
4600 行增加
和
0 行删除
404.html
0 → 100755
| 1 | +<!doctype html> | ||
| 2 | +<html> | ||
| 3 | +<head> | ||
| 4 | +<meta charset="utf-8"> | ||
| 5 | +<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
| 6 | +<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | ||
| 7 | +<title>404</title> | ||
| 8 | +<style> | ||
| 9 | + body{ | ||
| 10 | + background-color:#444; | ||
| 11 | + font-size:14px; | ||
| 12 | + } | ||
| 13 | + h3{ | ||
| 14 | + font-size:60px; | ||
| 15 | + color:#eee; | ||
| 16 | + text-align:center; | ||
| 17 | + padding-top:30px; | ||
| 18 | + font-weight:normal; | ||
| 19 | + } | ||
| 20 | +</style> | ||
| 21 | +</head> | ||
| 22 | + | ||
| 23 | +<body> | ||
| 24 | +<h3>404,您请求的文件不存在!</h3> | ||
| 25 | +</body> | ||
| 26 | +</html> |
BingSiteAuth.xml
0 → 100755
admin--globalso/index.php
0 → 100755
| 1 | +<?php | ||
| 2 | +require_once( dirname(__FILE__) . '/../wp-load.php' ); | ||
| 3 | +if( is_user_logged_in() ) : ?> | ||
| 4 | +<!DOCTYPE html> | ||
| 5 | +<html class="system-market"> | ||
| 6 | +<head> | ||
| 7 | + <meta charset="UTF-8"> | ||
| 8 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
| 9 | + <meta name="renderer" content="webkit|ie-comp|ie-stand"> | ||
| 10 | + <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"> | ||
| 11 | + <meta name="screen-orientation" content="portrait"> | ||
| 12 | + <meta name="x5-orientation" content="portrait"> | ||
| 13 | + <meta name="full-screen" content="yes"> | ||
| 14 | + <meta name="x5-fullscreen" content="true"> | ||
| 15 | + <meta name="browsermode" content="application"> | ||
| 16 | + <meta name="x5-page-mode" content="app"> | ||
| 17 | + <title>全球搜V5.0 - 外贸智慧营销一站式解决方案</title> | ||
| 18 | + <link rel="stylesheet" type="text/css" href="https://admin.globalso.com/styles/css/admin.css"> | ||
| 19 | +</head> | ||
| 20 | +<body class="system-market"> | ||
| 21 | + | ||
| 22 | +<!-- wrapper start --> | ||
| 23 | +<div class="wrapper"> | ||
| 24 | + <!-- 页眉开始 --> | ||
| 25 | + <div id="admin-head" class="admin-head"> | ||
| 26 | + <div class="head-layout"> | ||
| 27 | + <div class="mobile-btn-aside"><span class="nav-btn-ico"><i></i><i></i><i></i></span></div> | ||
| 28 | + <div class="sm-btn-aside"></div> | ||
| 29 | + <i class="plane"></i> | ||
| 30 | + <div class="head-logo"> | ||
| 31 | + <span class="logo-ico"><img src="https://admin.globalso.com/styles/img/admin/logo-ico.png" alt=""></span> | ||
| 32 | + <span class="logo-img" style="color:red;font-weight:bold;">技术专用后台 {后端}</span> | ||
| 33 | + </div> | ||
| 34 | + <div class="top-notice"> | ||
| 35 | + <i class="notice-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon><path d="M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"></path></svg></i> | ||
| 36 | + <div class="notice-list"> | ||
| 37 | + <ul> | ||
| 38 | + <li><a href="#">全球搜 总部技术专用后台界面 - 直接通过后台即可登录后台</a></li> | ||
| 39 | + </ul> | ||
| 40 | + </div> | ||
| 41 | + </div> | ||
| 42 | + <div class="head-right"> | ||
| 43 | + <span class="head-right-bg"></span> | ||
| 44 | + <div class="top-quick-item sys-tips mobile-hide" data-tips="网站首页"> | ||
| 45 | + <a class="quick-item-inner wave-animate" target="_blank" href="<?php echo home_url(); ?>"><i class="top-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect><line x1="8" y1="21" x2="16" y2="21"></line><line x1="12" y1="17" x2="12" y2="21"></line></svg></i><i class="wave-animate-bg"></i></a> | ||
| 46 | + </div> | ||
| 47 | + <div class="top-quick-item sys-tips sys-tips-b-r" data-tips="系统更行"> | ||
| 48 | + <span class="quick-item-inner wave-animate quick-setting"><i class="top-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><polyline points="17 1 21 5 17 9"></polyline><path d="M3 11V9a4 4 0 0 1 4-4h14"></path><polyline points="7 23 3 19 7 15"></polyline><path d="M21 13v2a4 4 0 0 1-4 4H3"></path></svg></i><i class="wave-animate-bg"></i></span> | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | + </div> | ||
| 52 | + </div> | ||
| 53 | + <!--// 页眉结束 --> | ||
| 54 | + | ||
| 55 | + | ||
| 56 | + | ||
| 57 | + | ||
| 58 | + | ||
| 59 | + <!-- 左侧栏开始 --> | ||
| 60 | + <div id="admin-aside" class="admin-aside"> | ||
| 61 | + | ||
| 62 | + <!-- 市场大师左侧导航 --> | ||
| 63 | + <div class="aside-body aside-market"> | ||
| 64 | + <div class="aside-nav"> | ||
| 65 | + <div class="aside-nav-inner"> | ||
| 66 | + | ||
| 67 | + <ul class="aside-nav-list"> | ||
| 68 | + <li class="side-btn-item side-nav-item wave-animate"> | ||
| 69 | + <div class="item-inner"> | ||
| 70 | + <i class="side-nav-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><path d="M21.21 15.89A10 10 0 1 1 8 2.83"></path><path d="M22 12A10 10 0 0 0 12 2v10z"></path></svg></i> | ||
| 71 | + <span class="menu-txt">速达</span> | ||
| 72 | + <i class="wave-animate-bg"></i> | ||
| 73 | + </div> | ||
| 74 | + </li> | ||
| 75 | + <li class="side-btn-item side-nav-item wave-animate add_mob_hide"> | ||
| 76 | + <div class="item-inner"> | ||
| 77 | + <i class="side-nav-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg></i> | ||
| 78 | + <span class="menu-txt">网站</span> | ||
| 79 | + <i class="wave-animate-bg"></i> | ||
| 80 | + </div> | ||
| 81 | + </li> | ||
| 82 | + <li class="side-btn-item side-nav-item wave-animate add_mob_hide"> | ||
| 83 | + <div class="item-inner"> | ||
| 84 | + <i class="side-nav-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><line x1="16.5" y1="9.4" x2="7.5" y2="4.21"></line><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg></i> | ||
| 85 | + <span class="menu-txt">产品</span> | ||
| 86 | + <i class="wave-animate-bg"></i> | ||
| 87 | + </div> | ||
| 88 | + </li> | ||
| 89 | + <li class="side-btn-item side-nav-item wave-animate"> | ||
| 90 | + <div class="item-inner"> | ||
| 91 | + <i class="side-nav-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path></svg></i> | ||
| 92 | + <span class="menu-txt">社交</span> | ||
| 93 | + <i class="wave-animate-bg"></i> | ||
| 94 | + </div> | ||
| 95 | + </li> | ||
| 96 | + <li class="side-btn-item side-nav-item wave-animate"> | ||
| 97 | + <div class="item-inner"> | ||
| 98 | + <i class="side-nav-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><circle cx="18" cy="18" r="3"></circle><circle cx="6" cy="6" r="3"></circle><path d="M13 6h3a2 2 0 0 1 2 2v7"></path><line x1="6" y1="9" x2="6" y2="21"></line></svg></i> | ||
| 99 | + <span class="menu-txt">★AI</span> | ||
| 100 | + <i class="wave-animate-bg"></i> | ||
| 101 | + </div> | ||
| 102 | + </li> | ||
| 103 | + <li class="side-btn-item side-nav-item wave-animate"> | ||
| 104 | + <div class="item-inner"> | ||
| 105 | + <i class="side-nav-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline><polyline points="17 6 23 6 23 12"></polyline></svg></i> | ||
| 106 | + <span class="menu-txt">数据</span> | ||
| 107 | + <i class="wave-animate-bg"></i> | ||
| 108 | + </div> | ||
| 109 | + </li> | ||
| 110 | + <li class="side-btn-item side-nav-item wave-animate add_mob_hide"> | ||
| 111 | + <div class="item-inner"> | ||
| 112 | + <i class="side-nav-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg></i> | ||
| 113 | + <span class="menu-txt">设置</span> | ||
| 114 | + <i class="wave-animate-bg"></i> | ||
| 115 | + </div> | ||
| 116 | + </li> | ||
| 117 | + | ||
| 118 | + </ul> | ||
| 119 | + <i class="active-ico"></i> | ||
| 120 | + </div> | ||
| 121 | + </div> | ||
| 122 | + <!-- 二级菜单 --> | ||
| 123 | + <div class="aside-menu"> | ||
| 124 | + <div class="side-menu-group"> | ||
| 125 | + <div class="menu-group-hd"> | ||
| 126 | + <i class="side-menu-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><path d="M21.21 15.89A10 10 0 1 1 8 2.83"></path><path d="M22 12A10 10 0 0 0 12 2v10z"></path></svg></i> | ||
| 127 | + <span class="side-menu-txt">速达</span> | ||
| 128 | + </div> | ||
| 129 | + <div class="menu-group-bd"> | ||
| 130 | + <ul class="menu-group-list"> | ||
| 131 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/post.php?post=50&action=edit">网站形象</a></li> | ||
| 132 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php?post_type=page">页面管理</a></li> | ||
| 133 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php">产品列表</a></li> | ||
| 134 | + | ||
| 135 | + </ul> | ||
| 136 | + <ul class="menu-group-list"> | ||
| 137 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=cf7-data&fid=19">精准询盘</a></li> | ||
| 138 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-xptj.php">询盘统计</a></li> | ||
| 139 | + </ul> | ||
| 140 | + | ||
| 141 | + | ||
| 142 | + | ||
| 143 | + <!-- <ul class="menu-group-list"> | ||
| 144 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/plugins.php">插件管理</a></li> | ||
| 145 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=easyiit_cdn">CDN管理</a></li> | ||
| 146 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=stats_settings">数据清除</a></li> | ||
| 147 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=t9_eshopimport">数据导入</a></li> | ||
| 148 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php?post_type=acf">自定义字段</a></li> | ||
| 149 | + </ul> | ||
| 150 | + <ul class="menu-group-list"> | ||
| 151 | + <li><a target="_blank" href="<?php echo home_url(); ?>/wp-admin/plugins.php?page=prisna-translate-automate-settings">多语言翻译</a></li> | ||
| 152 | + <li><a target="_blank" href="<?php echo home_url(); ?>/wp-admin/plugins.php?page=prisna-translate-settings">翻译设置</a></li> | ||
| 153 | + </ul> --> | ||
| 154 | + </div> | ||
| 155 | + </div> | ||
| 156 | + <div class="side-menu-group"> | ||
| 157 | + <div class="menu-group-hd"> | ||
| 158 | + <i class="side-menu-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><path d="M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"></path><polygon points="12 15 17 21 7 21 12 15"></polygon></svg></i> | ||
| 159 | + <span class="side-menu-txt">网站</span> | ||
| 160 | + </div> | ||
| 161 | + <div class="menu-group-bd"> | ||
| 162 | + <ul class="menu-group-list"> | ||
| 163 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/post.php?post=50&action=edit">网站形象</a></li> | ||
| 164 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/nav-menus.php?menu=31">菜单管理</a></li> | ||
| 165 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php?post_type=page">页面管理</a></li> | ||
| 166 | + </ul> | ||
| 167 | + <ul class="menu-group-list"> | ||
| 168 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php?post_type=news">新闻管理</a></li> | ||
| 169 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit-tags.php?taxonomy=news_catalog&post_type=news">新闻分类</a></li> | ||
| 170 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php?post_type=guide">行业文章</a></li> | ||
| 171 | + </ul> | ||
| 172 | + </div> | ||
| 173 | + </div> | ||
| 174 | + <div class="side-menu-group"> | ||
| 175 | + <div class="menu-group-hd"> | ||
| 176 | + <i class="side-menu-ico side-menu-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><line x1="16.5" y1="9.4" x2="7.5" y2="4.21"></line><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"></path><polyline points="3.27 6.96 12 12.01 20.73 6.96"></polyline><line x1="12" y1="22.08" x2="12" y2="12"></line></svg></i> | ||
| 177 | + <span class="side-menu-txt">产品</span> | ||
| 178 | + </div> | ||
| 179 | + <div class="menu-group-bd"> | ||
| 180 | + <ul class="menu-group-list"> | ||
| 181 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/post-new.php">产品发布</a></li> | ||
| 182 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php">产品列表</a></li> | ||
| 183 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit-tags.php?taxonomy=category">产品分类</a></li> | ||
| 184 | + </ul> | ||
| 185 | + <ul class="menu-group-list"> | ||
| 186 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit-tags.php?taxonomy=post_tag">产品关键词</a></li> | ||
| 187 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/post.php?post=656&action=edit">产品通用属性</a></li> | ||
| 188 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/post.php?post=444&action=edit">产品通用描述</a></li> | ||
| 189 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/options-reading.php">产品列表数量</a></li> | ||
| 190 | + </ul> | ||
| 191 | + </div> | ||
| 192 | + </div> | ||
| 193 | + <div class="side-menu-group"> | ||
| 194 | + <div class="menu-group-hd"> | ||
| 195 | + <i class="side-menu-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path></svg></i> | ||
| 196 | + <span class="side-menu-txt">社交&工具</span> | ||
| 197 | + </div> | ||
| 198 | + <div class="menu-group-bd"> | ||
| 199 | + <ul class="menu-group-list"> | ||
| 200 | + <li><a class="iframe-link" href="//www.globalso.vip/">社交数据检索</a></li> | ||
| 201 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=blog2social-network">社交账号管理</a></li> | ||
| 202 | + </ul> | ||
| 203 | + <ul class="menu-group-list"> | ||
| 204 | + <li><a class="iframe-link" href="//go.quanqiusou.cn/">谷歌排名查询</a></li> | ||
| 205 | + <li><a class="iframe-link" href="//www.quanqiusou.cn/tools/waimao-tools.html">外贸工具集合 </a></li> | ||
| 206 | + </ul> | ||
| 207 | + <ul class="menu-group-list"> | ||
| 208 | + <li class="add_mob_hide"><a class="iframe-link" href="//www.quanqiusou.cn/zhongxin/">中信保数据</a></li> | ||
| 209 | + </ul> | ||
| 210 | + </div> | ||
| 211 | + </div> | ||
| 212 | + <div class="side-menu-group"> | ||
| 213 | + <div class="menu-group-hd"> | ||
| 214 | + <i class="side-menu-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><circle cx="18" cy="18" r="3"></circle><circle cx="6" cy="6" r="3"></circle><path d="M13 6h3a2 2 0 0 1 2 2v7"></path><line x1="6" y1="9" x2="6" y2="21"></line></svg></i> | ||
| 215 | + <span class="side-menu-txt">AI分析</span> | ||
| 216 | + </div> | ||
| 217 | + <div class="menu-group-bd"> | ||
| 218 | + <ul class="menu-group-list"> | ||
| 219 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=easyiit_product_publish">AI产品发布</a></li> | ||
| 220 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=easyiit_news_publish">AI新闻发布</a></li> | ||
| 221 | + <li class="add_mob_hide"><a class="iframe-link" href="//title.globalso.com/">AI标题挖掘</a></li> | ||
| 222 | + <li class="add_mob_hide"><a class="iframe-link" href="//keywords.globalso.com/">AI关键词挖掘</a></li> | ||
| 223 | + </ul> | ||
| 224 | + </div> | ||
| 225 | + </div> | ||
| 226 | + <div class="side-menu-group"> | ||
| 227 | + <div class="menu-group-hd"> | ||
| 228 | + <i class="side-menu-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline><polyline points="17 6 23 6 23 12"></polyline></svg></i> | ||
| 229 | + <span class="side-menu-txt">数据</span> | ||
| 230 | + </div> | ||
| 231 | + <div class="menu-group-bd"> | ||
| 232 | + <ul class="menu-group-list"> | ||
| 233 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-uvmx.php">访问明细</a></li> | ||
| 234 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-uvhz.php">流量趋势</a></li> | ||
| 235 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-uvly.php">访问来源</a></li> | ||
| 236 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-uvgj.php">地域分布</a></li> | ||
| 237 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-uvym.php">受访页面</a></li> | ||
| 238 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-uvzd.php">访问终端</a></li> | ||
| 239 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-report.php">月度报告</a></li> | ||
| 240 | + </ul> | ||
| 241 | + | ||
| 242 | + </div> | ||
| 243 | + </div> | ||
| 244 | + <div class="side-menu-group"> | ||
| 245 | + <div class="menu-group-hd"> | ||
| 246 | + <i class="side-menu-ico"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg></i> | ||
| 247 | + <span class="side-menu-txt">设置</span> | ||
| 248 | + </div> | ||
| 249 | + <div class="menu-group-bd"> | ||
| 250 | + <ul class="menu-group-list"> | ||
| 251 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=wp-ecommerce-settings" data-crumb-label="收款设置"><i class="item-ico ico-set"></i><span class="item-txt">收款设置</span></a></li> | ||
| 252 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/post.php?post=69&action=edit" data-crumb-label="语言地区"><i class="item-ico ico-user"></i><span class="item-txt">语言地区</span></a></li> | ||
| 253 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/plugins.php?page=prisna-translate-settings&gd=1" data-crumb-label="人工翻译"><i class="item-ico ico-role"></i><span class="item-txt">人工翻译</span></a></li> | ||
| 254 | + </ul> | ||
| 255 | + | ||
| 256 | + </div> | ||
| 257 | + </div> | ||
| 258 | + | ||
| 259 | + </div> | ||
| 260 | + </div> | ||
| 261 | + | ||
| 262 | + | ||
| 263 | + | ||
| 264 | + | ||
| 265 | + | ||
| 266 | + | ||
| 267 | + | ||
| 268 | + <div class="aside-foot"> | ||
| 269 | + <div class="aside-foot-inner"> | ||
| 270 | + <p style="color:red;font-weight:bold;">全球搜操作界面</p> | ||
| 271 | + <p></p> | ||
| 272 | + </div> | ||
| 273 | + </div> | ||
| 274 | + <div class="aside-bg"></div> | ||
| 275 | + </div> | ||
| 276 | + <!--// 左侧栏结束 --> | ||
| 277 | + | ||
| 278 | + | ||
| 279 | + | ||
| 280 | + <!-- 右侧设置开始 --> | ||
| 281 | + <div id="admin-seting" class="seting-aside crumb-act-root" data-crumb-rootlabel="设置"> | ||
| 282 | + <div class="seting-hd"> | ||
| 283 | + <h4>更新</h4> | ||
| 284 | + <span class="seting-close"></span> | ||
| 285 | + </div> | ||
| 286 | + <div class="seting-bd"> | ||
| 287 | + <ul class="seting-menu"> | ||
| 288 | + <li class="wave-animate"><a href="javascript:" onClick="popShow(tipVal01,tipVal02,'1','全站页面')">全站页面更新<i class="wave-animate-bg"></i></a></li> | ||
| 289 | + <li class="wave-animate"><a href="javascript:" onClick="popShow(tipVal01,tipVal02,'2','CDN文件')">CDN文件更新<i class="wave-animate-bg"></i></a></li> | ||
| 290 | + <li class="wave-animate"><a href="javascript:" onClick="popShow(tipVal01,tipVal02,'3','CDN图片')">CDN图片更新<i class="wave-animate-bg"></i></a></li> | ||
| 291 | + <!-- | ||
| 292 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=wp-ecommerce-settings" data-crumb-label="收款设置"><i class="item-ico ico-set"></i><span class="item-txt">收款设置</span></a></li> | ||
| 293 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/post.php?post=69&action=edit" data-crumb-label="语言地区"><i class="item-ico ico-user"></i><span class="item-txt">语言地区</span></a></li> | ||
| 294 | + <li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/plugins.php?page=prisna-translate-settings&gd=1" data-crumb-label="人工翻译"><i class="item-ico ico-role"></i><span class="item-txt">人工翻译</span></a></li> | ||
| 295 | + --> | ||
| 296 | + </ul> | ||
| 297 | + </div> | ||
| 298 | + </div> | ||
| 299 | + <!--// 右侧设置结束 --> | ||
| 300 | + | ||
| 301 | + | ||
| 302 | + <!-- iframe --> | ||
| 303 | + <div class="iframe-wrap"> | ||
| 304 | + <iframe id="page-iframe" class="page-iframe" src="<?php echo home_url(); ?>/wp-admin/post.php?post=50&action=edit" frameborder="0" width="100%" height="100%" allowtransparency="true"></iframe> | ||
| 305 | + </div> | ||
| 306 | + | ||
| 307 | + | ||
| 308 | +</div> | ||
| 309 | +<!--// wrapper end --> | ||
| 310 | + | ||
| 311 | + | ||
| 312 | + | ||
| 313 | + | ||
| 314 | +<script src="https://admin.globalso.com/styles/js/jquery.min.js"></script> | ||
| 315 | +<script src="https://admin.globalso.com/styles/js/admin.js"></script> | ||
| 316 | +<script src="https://admin.globalso.com/js/layer.js"></script> | ||
| 317 | +<script> | ||
| 318 | +var tipVal01='正在提交更新任务,请稍后......' | ||
| 319 | +var tipVal02='<i style="color:red">为何要更新缓存?</i>全球搜所有客户网站均启用了全球CDN加速,不同国家节点都会有缓存,<br/>更新内容后如果需要及时生效,必须要更新CDN缓存,如果不急,需要等2-4小时缓存自动更新!'; | ||
| 320 | +var tipReVal02='请在3-5分钟后,F5刷新浏览器 或 清除浏览器缓存查看网站更新!'; | ||
| 321 | +function popShow(tip01,tip02,f_type,dis_word){ | ||
| 322 | + if($(".keyword_ranking_pop").length<1){ | ||
| 323 | + var htmlPop='<div class="keyword_ranking_pop">' | ||
| 324 | + +'<div class="keyword_ranking_wrap">' | ||
| 325 | + +'<div class="pop_wrap">' | ||
| 326 | + +'<div class="progress_bar_wrap">' | ||
| 327 | + +'<div class="progress_bar"><div class="bar"></div></div>' | ||
| 328 | + +'</div>' | ||
| 329 | + +'<div class="tip">'+tip01+'</div>' | ||
| 330 | + +'<div class="sup_notes">'+tip02+'</div>' | ||
| 331 | + +'<div class="close"><button onclick="popHide()">关闭</button></div>' | ||
| 332 | + +'</div>' | ||
| 333 | + +'</div>' | ||
| 334 | + +'</div>' | ||
| 335 | + $("body").append(htmlPop) | ||
| 336 | + $(".keyword_ranking_pop .tip").html(tipVal01) | ||
| 337 | + $(".keyword_ranking_pop .sup_notes").html(tipVal02) | ||
| 338 | + $(".keyword_ranking_pop").fadeIn() | ||
| 339 | + var percentage = 0; | ||
| 340 | + var interval = setInterval(function () { | ||
| 341 | + if (percentage < 900) { | ||
| 342 | + percentage++; | ||
| 343 | + var widthTemp = (percentage / 10).toFixed(1) + '%'; | ||
| 344 | + $('.progress_bar .bar').css('width', widthTemp); | ||
| 345 | + } else { | ||
| 346 | + clearInterval(interval); | ||
| 347 | + setTimeout(function () { | ||
| 348 | + //$(".keyword_ranking_pop .tip").html(tipReVal01) | ||
| 349 | + // $(".keyword_ranking_pop .sup_notes").html(tipReVal02) | ||
| 350 | + //$(".keyword_ranking_pop .pop_wrap .close").show() | ||
| 351 | + }, 500); | ||
| 352 | + } | ||
| 353 | + }, 2); | ||
| 354 | + } | ||
| 355 | + var id="{{$data->id}}"; | ||
| 356 | + $.ajax({ | ||
| 357 | + type:"get", | ||
| 358 | + url:'https://admin.globalso.com/api/update_image', | ||
| 359 | + data:{'id':id,'ftype':f_type}, | ||
| 360 | + success:function(data){ | ||
| 361 | + if(data == 200){ | ||
| 362 | + //alert('更新成功'); | ||
| 363 | + percentage = 1000; | ||
| 364 | + $('.progress_bar .bar').css('width', "100%"); | ||
| 365 | + $(".keyword_ranking_pop .tip").html('<i style="color:red">已成功提交'+dis_word+'更新!</i>') | ||
| 366 | + $(".keyword_ranking_pop .sup_notes").html(tipReVal02) | ||
| 367 | + $(".keyword_ranking_pop .pop_wrap .close").show() | ||
| 368 | + }else if(data == 1){ | ||
| 369 | + //alert('项目未上线,不能更新图片'); | ||
| 370 | + $(".keyword_ranking_pop .tip").html('<i style="color:red">项目未上线,不能更新'+dis_word+'!</i>') | ||
| 371 | + $(".keyword_ranking_pop .sup_notes").html("") | ||
| 372 | + $(".keyword_ranking_pop .pop_wrap .close").show() | ||
| 373 | + }else{ | ||
| 374 | + //alert('更新失败'); | ||
| 375 | + $(".progress_bar_wrap").hide(); | ||
| 376 | + $(".keyword_ranking_pop .tip").html('<i style="color:red">更新失败</i>') | ||
| 377 | + $(".keyword_ranking_pop .sup_notes").html("") | ||
| 378 | + $(".keyword_ranking_pop .pop_wrap .close").show() | ||
| 379 | + } | ||
| 380 | + }, | ||
| 381 | + error:function(data){ | ||
| 382 | + $(".progress_bar_wrap").hide(); | ||
| 383 | + $(".keyword_ranking_pop .tip").html('<i style="color:red">更新失败</i>') | ||
| 384 | + $(".keyword_ranking_pop .sup_notes").html("") | ||
| 385 | + $(".keyword_ranking_pop .pop_wrap .close").show() | ||
| 386 | + } | ||
| 387 | + }); | ||
| 388 | +} | ||
| 389 | +function popHide(){ | ||
| 390 | + $(".keyword_ranking_pop").remove() | ||
| 391 | + } | ||
| 392 | +</script> | ||
| 393 | + | ||
| 394 | +</body> | ||
| 395 | +</html><?php else: ?><meta http-equiv="refresh" content="0;url=<?php echo home_url(); ?>/admin.php"><?php endif; ?> |
admin.php
0 → 100755
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * WordPress User Page | ||
| 4 | + * | ||
| 5 | + * Handles authentication, registering, resetting passwords, forgot password, | ||
| 6 | + * and other user handling. | ||
| 7 | + * | ||
| 8 | + * @package WordPress | ||
| 9 | + */ | ||
| 10 | + | ||
| 11 | +/** Make sure that the WordPress bootstrap has run before continuing. */ | ||
| 12 | +require( dirname(__FILE__) . '/wp-load.php' ); | ||
| 13 | + | ||
| 14 | +// Redirect to https login if forced to use SSL | ||
| 15 | +if ( force_ssl_admin() && ! is_ssl() ) { | ||
| 16 | + if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) { | ||
| 17 | + wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ); | ||
| 18 | + exit(); | ||
| 19 | + } else { | ||
| 20 | + wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); | ||
| 21 | + exit(); | ||
| 22 | + } | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * Outputs the header for the login page. | ||
| 27 | + * | ||
| 28 | + * @uses do_action() Calls the 'login_head' for outputting HTML in the 登录 | ||
| 29 | + * header. | ||
| 30 | + * @uses apply_filters() Calls 'login_headerurl' for the top login link. | ||
| 31 | + * @uses apply_filters() Calls 'login_headertitle' for the top login title. | ||
| 32 | + * @uses apply_filters() Calls 'login_message' on the message to display in the | ||
| 33 | + * header. | ||
| 34 | + * @uses $error The error global, which is checked for displaying errors. | ||
| 35 | + * | ||
| 36 | + * @param string $title Optional. WordPress 登录 Page title to display in | ||
| 37 | + * <title/> element. | ||
| 38 | + * @param string $message Optional. Message to display in header. | ||
| 39 | + * @param WP_Error $wp_error Optional. WordPress Error Object | ||
| 40 | + */ | ||
| 41 | +function login_header($title = '登录', $message = '', $wp_error = '') { | ||
| 42 | + global $error, $interim_login, $current_site, $action; | ||
| 43 | + | ||
| 44 | + // Don't index any of these forms | ||
| 45 | + add_action( 'login_head', 'wp_no_robots' ); | ||
| 46 | + | ||
| 47 | + if ( empty($wp_error) ) | ||
| 48 | + $wp_error = new WP_Error(); | ||
| 49 | + | ||
| 50 | + // Shake it! | ||
| 51 | + $shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' ); | ||
| 52 | + $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes ); | ||
| 53 | + | ||
| 54 | + if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) ) | ||
| 55 | + add_action( 'login_head', 'wp_shake_js', 12 ); | ||
| 56 | + | ||
| 57 | + ?><!DOCTYPE html> | ||
| 58 | + <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> | ||
| 59 | + <head> | ||
| 60 | + <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> | ||
| 61 | + <title><?php bloginfo('name'); ?> › <?php echo $title; ?></title> | ||
| 62 | + | ||
| 63 | + | ||
| 64 | +<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"> | ||
| 65 | +<link rel="stylesheet" href="//www.quanqiusou.cn/adminimg/logincss/admin-login.css"> | ||
| 66 | +<script src="//www.quanqiusou.cn/adminimg/logincss/js/jquery.min.1.9.2.js"></script> | ||
| 67 | +<!--[if lt IE 10]> | ||
| 68 | +<script src="//www.quanqiusou.cn/adminimg/logincss/js/placeholder.js"></script> | ||
| 69 | +<![endif]--> | ||
| 70 | + | ||
| 71 | + <?php | ||
| 72 | + | ||
| 73 | + | ||
| 74 | + if ( 'loggedout' == $wp_error->get_error_code() ) { | ||
| 75 | + ?> | ||
| 76 | + <script>if("sessionStorage" in window){try{for(var key in sessionStorage){if(key.indexOf("wp-autosave-")!=-1){sessionStorage.removeItem(key)}}}catch(e){}};</script> | ||
| 77 | + <?php | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + | ||
| 81 | + | ||
| 82 | + $login_header_url = apply_filters( 'login_headerurl', $login_header_url ); | ||
| 83 | + $login_header_title = apply_filters( 'login_headertitle', $login_header_title ); | ||
| 84 | + | ||
| 85 | + $classes = array( 'login-action-' . $action, 'wp-core-ui' ); | ||
| 86 | + if ( wp_is_mobile() ) | ||
| 87 | + $classes[] = 'mobile'; | ||
| 88 | + if ( is_rtl() ) | ||
| 89 | + $classes[] = 'rtl'; | ||
| 90 | + if ( $interim_login ) { | ||
| 91 | + $classes[] = 'interim-login'; | ||
| 92 | + ?> | ||
| 93 | + <style type="text/css">html{background-color: transparent;}</style> | ||
| 94 | + <?php | ||
| 95 | + | ||
| 96 | + if ( 'success' === $interim_login ) | ||
| 97 | + $classes[] = 'interim-login-success'; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + $classes = apply_filters( 'login_body_class', $classes, $action ); | ||
| 101 | + | ||
| 102 | + ?> | ||
| 103 | + </head> | ||
| 104 | +<body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>"> | ||
| 105 | + | ||
| 106 | +<video class="login-bg" loop="loop" autoplay="autoplay"> | ||
| 107 | + <source src="//www.quanqiusou.cn/adminimg/login_bg.mp4" type="video/mp4" /> | ||
| 108 | + <source src="//www.quanqiusou.cn/adminimg/login_bg.ogv" type="video/ogg" /> | ||
| 109 | + <source src="//www.quanqiusou.cn/adminimg/login_bg.webm" type="video/webm" /> | ||
| 110 | +</video> | ||
| 111 | + | ||
| 112 | +<div id="login" class="login-container"> | ||
| 113 | + | ||
| 114 | + <div class="login-wrap"> | ||
| 115 | + <div class="login-logo"><img src="//www.quanqiusou.cn/adminimg/login_logo.png"></div> | ||
| 116 | + <div class="login-form"> | ||
| 117 | + <?php | ||
| 118 | + | ||
| 119 | + unset( $login_header_url, $login_header_title ); | ||
| 120 | + | ||
| 121 | + $message = apply_filters('login_message', $message); | ||
| 122 | + if ( !empty( $message ) ) | ||
| 123 | + echo $message . "\n"; | ||
| 124 | + | ||
| 125 | + // In case a plugin uses $error rather than the $wp_errors object | ||
| 126 | + if ( !empty( $error ) ) { | ||
| 127 | + $wp_error->add('error', $error); | ||
| 128 | + unset($error); | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + if ( $wp_error->get_error_code() ) { | ||
| 132 | + $errors = ''; | ||
| 133 | + $messages = ''; | ||
| 134 | + foreach ( $wp_error->get_error_codes() as $code ) { | ||
| 135 | + $severity = $wp_error->get_error_data($code); | ||
| 136 | + foreach ( $wp_error->get_error_messages($code) as $error ) { | ||
| 137 | + if ( 'message' == $severity ) | ||
| 138 | + $messages .= ' ' . $error . "<br />\n"; | ||
| 139 | + else | ||
| 140 | + $errors .= ' ' . $error . "<br />\n"; | ||
| 141 | + } | ||
| 142 | + } | ||
| 143 | + if ( !empty($errors) ) | ||
| 144 | + echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\n"; | ||
| 145 | + if ( !empty($messages) ) | ||
| 146 | + echo '<div id="login_error">' . apply_filters('login_messages', $messages) . "</div>\n"; | ||
| 147 | + } | ||
| 148 | +} // End of login_header() | ||
| 149 | + | ||
| 150 | +/** | ||
| 151 | + * Outputs the footer for the login page. | ||
| 152 | + * | ||
| 153 | + * @param string $input_id Which input to auto-focus | ||
| 154 | + */ | ||
| 155 | +function login_footer($input_id = '') { | ||
| 156 | + global $interim_login; | ||
| 157 | + | ||
| 158 | + // Don't allow interim logins to navigate away from the page. | ||
| 159 | + if ( ! $interim_login ): ?> | ||
| 160 | + <?php endif; ?> | ||
| 161 | + | ||
| 162 | + </div> | ||
| 163 | + </div> | ||
| 164 | + </div> | ||
| 165 | + | ||
| 166 | + <?php if ( !empty($input_id) ) : ?> | ||
| 167 | + <script type="text/javascript"> | ||
| 168 | + try{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){} | ||
| 169 | + if(typeof wpOnload=='function')wpOnload(); | ||
| 170 | + </script> | ||
| 171 | + <?php endif; ?> | ||
| 172 | + | ||
| 173 | + <?php do_action('login_footer'); ?> | ||
| 174 | + <div class="clear"></div> | ||
| 175 | + </body> | ||
| 176 | + </html> | ||
| 177 | + <?php | ||
| 178 | +} | ||
| 179 | + | ||
| 180 | +function wp_shake_js() { | ||
| 181 | + if ( wp_is_mobile() ) | ||
| 182 | + return; | ||
| 183 | +?> | ||
| 184 | +<script type="text/javascript"> | ||
| 185 | +addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; | ||
| 186 | +function s(id,pos){g(id).left=pos+'px';} | ||
| 187 | +function g(id){return document.getElementById(id).style;} | ||
| 188 | +function shake(id,a,d){c=a.shift();s(id,c);if(a.length>0){setTimeout(function(){shake(id,a,d);},d);}else{try{g(id).position='static';wp_attempt_focus();}catch(e){}}} | ||
| 189 | +addLoadEvent(function(){ var p=new Array(15,30,15,0,-15,-30,-15,0);p=p.concat(p.concat(p));var i=document.forms[0].id;g(i).position='relative';shake(i,p,20);}); | ||
| 190 | +</script> | ||
| 191 | +<?php | ||
| 192 | +} | ||
| 193 | + | ||
| 194 | +/** | ||
| 195 | + * Handles sending password retrieval email to user. | ||
| 196 | + * | ||
| 197 | + * @uses $wpdb WordPress Database object | ||
| 198 | + * | ||
| 199 | + * @return bool|WP_Error True: when finish. WP_Error on error | ||
| 200 | + */ | ||
| 201 | +function retrieve_password() { | ||
| 202 | + global $wpdb, $current_site; | ||
| 203 | + | ||
| 204 | + $errors = new WP_Error(); | ||
| 205 | + | ||
| 206 | + if ( empty( $_POST['user_login'] ) ) { | ||
| 207 | + $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.')); | ||
| 208 | + } else if ( strpos( $_POST['user_login'], '@' ) ) { | ||
| 209 | + $user_data = get_user_by( 'email', trim( $_POST['user_login'] ) ); | ||
| 210 | + if ( empty( $user_data ) ) | ||
| 211 | + $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.')); | ||
| 212 | + } else { | ||
| 213 | + $login = trim($_POST['user_login']); | ||
| 214 | + $user_data = get_user_by('login', $login); | ||
| 215 | + } | ||
| 216 | + | ||
| 217 | + do_action('lostpassword_post'); | ||
| 218 | + | ||
| 219 | + if ( $errors->get_error_code() ) | ||
| 220 | + return $errors; | ||
| 221 | + | ||
| 222 | + if ( !$user_data ) { | ||
| 223 | + $errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.')); | ||
| 224 | + return $errors; | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + // redefining user_login ensures we return the right case in the email | ||
| 228 | + $user_login = $user_data->user_login; | ||
| 229 | + $user_email = $user_data->user_email; | ||
| 230 | + | ||
| 231 | + do_action('retreive_password', $user_login); // Misspelled and deprecated | ||
| 232 | + do_action('retrieve_password', $user_login); | ||
| 233 | + | ||
| 234 | + $allow = apply_filters('allow_password_reset', true, $user_data->ID); | ||
| 235 | + | ||
| 236 | + if ( ! $allow ) | ||
| 237 | + return new WP_Error('no_password_reset', __('Password reset is not allowed for this user')); | ||
| 238 | + else if ( is_wp_error($allow) ) | ||
| 239 | + return $allow; | ||
| 240 | + | ||
| 241 | + $key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s", $user_login)); | ||
| 242 | + if ( empty($key) ) { | ||
| 243 | + // Generate something random for a key... | ||
| 244 | + $key = wp_generate_password(20, false); | ||
| 245 | + do_action('retrieve_password_key', $user_login, $key); | ||
| 246 | + // Now insert the new md5 key into the db | ||
| 247 | + $wpdb->update($wpdb->users, array('user_activation_key' => $key), array('user_login' => $user_login)); | ||
| 248 | + } | ||
| 249 | + $message = __('密码重设:') . "\r\n\r\n"; | ||
| 250 | + $message .= network_home_url( '/' ) . "\r\n\r\n"; | ||
| 251 | + $message .= sprintf(__('用户名: %s'), $user_login) . "\r\n\r\n"; | ||
| 252 | + $message .= __('若这不是您本人要求的,请忽略本邮件,密码不变。') . "\r\n\r\n"; | ||
| 253 | + $message .= __('要重置您的密码,请打开下面的链接:') . "\r\n\r\n"; | ||
| 254 | + $message .= '<' . network_site_url("admin.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n"; | ||
| 255 | + | ||
| 256 | + if ( is_multisite() ) | ||
| 257 | + $blogname = $GLOBALS['current_site']->site_name; | ||
| 258 | + else | ||
| 259 | + // The blogname option is escaped with esc_html on the way into the database in sanitize_option | ||
| 260 | + // we want to reverse this for the plain text arena of emails. | ||
| 261 | + $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); | ||
| 262 | + | ||
| 263 | + $title = sprintf( __('密码重设邮件[GoodaoCMS]'), $blogname ); | ||
| 264 | + | ||
| 265 | + $title = apply_filters('retrieve_password_title', $title); | ||
| 266 | + $message = apply_filters('retrieve_password_message', $message, $key); | ||
| 267 | + | ||
| 268 | + if ( $message && !wp_mail($user_email, $title, $message) ) | ||
| 269 | + wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function.') ); | ||
| 270 | + | ||
| 271 | + return true; | ||
| 272 | +} | ||
| 273 | + | ||
| 274 | +/** | ||
| 275 | + * Retrieves a user row based on password reset key and login | ||
| 276 | + * | ||
| 277 | + * @uses $wpdb WordPress Database object | ||
| 278 | + * | ||
| 279 | + * @param string $key Hash to validate sending user's password | ||
| 280 | + * @param string $login The user login | ||
| 281 | + * @return object|WP_Error User's database row on success, error object for invalid keys | ||
| 282 | + */ | ||
| 283 | +function check_password_reset_key($key, $login) { | ||
| 284 | + global $wpdb; | ||
| 285 | + | ||
| 286 | + $key = preg_replace('/[^a-z0-9]/i', '', $key); | ||
| 287 | + | ||
| 288 | + if ( empty( $key ) || !is_string( $key ) ) | ||
| 289 | + return new WP_Error('invalid_key', __('Invalid key')); | ||
| 290 | + | ||
| 291 | + if ( empty($login) || !is_string($login) ) | ||
| 292 | + return new WP_Error('invalid_key', __('Invalid key')); | ||
| 293 | + | ||
| 294 | + $user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE user_activation_key = %s AND user_login = %s", $key, $login)); | ||
| 295 | + | ||
| 296 | + if ( empty( $user ) ) | ||
| 297 | + return new WP_Error('invalid_key', __('Invalid key')); | ||
| 298 | + | ||
| 299 | + return $user; | ||
| 300 | +} | ||
| 301 | + | ||
| 302 | +/** | ||
| 303 | + * Handles resetting the user's password. | ||
| 304 | + * | ||
| 305 | + * @param object $user The user | ||
| 306 | + * @param string $new_pass New password for the user in plaintext | ||
| 307 | + */ | ||
| 308 | +function reset_password($user, $new_pass) { | ||
| 309 | + do_action('password_reset', $user, $new_pass); | ||
| 310 | + | ||
| 311 | + wp_set_password($new_pass, $user->ID); | ||
| 312 | + | ||
| 313 | + wp_password_change_notification($user); | ||
| 314 | +} | ||
| 315 | + | ||
| 316 | +/** | ||
| 317 | + * Handles registering a new user. | ||
| 318 | + * | ||
| 319 | + * @param string $user_login User's username for logging in | ||
| 320 | + * @param string $user_email User's email address to send password and add | ||
| 321 | + * @return int|WP_Error Either user's ID or error on failure. | ||
| 322 | + */ | ||
| 323 | +function register_new_user( $user_login, $user_email ) { | ||
| 324 | + $errors = new WP_Error(); | ||
| 325 | + | ||
| 326 | + $sanitized_user_login = sanitize_user( $user_login ); | ||
| 327 | + $user_email = apply_filters( 'user_registration_email', $user_email ); | ||
| 328 | + | ||
| 329 | + // Check the username | ||
| 330 | + if ( $sanitized_user_login == '' ) { | ||
| 331 | + $errors->add( 'empty_username', __( '<strong>ERROR</strong>: Please enter a username.' ) ); | ||
| 332 | + } elseif ( ! validate_username( $user_login ) ) { | ||
| 333 | + $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) ); | ||
| 334 | + $sanitized_user_login = ''; | ||
| 335 | + } elseif ( username_exists( $sanitized_user_login ) ) { | ||
| 336 | + $errors->add( 'username_exists', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ) ); | ||
| 337 | + } | ||
| 338 | + | ||
| 339 | + // Check the e-mail address | ||
| 340 | + if ( $user_email == '' ) { | ||
| 341 | + $errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please type your e-mail address.' ) ); | ||
| 342 | + } elseif ( ! is_email( $user_email ) ) { | ||
| 343 | + $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn’t correct.' ) ); | ||
| 344 | + $user_email = ''; | ||
| 345 | + } elseif ( email_exists( $user_email ) ) { | ||
| 346 | + $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ) ); | ||
| 347 | + } | ||
| 348 | + | ||
| 349 | + do_action( 'register_post', $sanitized_user_login, $user_email, $errors ); | ||
| 350 | + | ||
| 351 | + $errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email ); | ||
| 352 | + | ||
| 353 | + if ( $errors->get_error_code() ) | ||
| 354 | + return $errors; | ||
| 355 | + | ||
| 356 | + $user_pass = wp_generate_password( 12, false); | ||
| 357 | + $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email ); | ||
| 358 | + if ( ! $user_id ) { | ||
| 359 | + $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn’t register you… please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) ); | ||
| 360 | + return $errors; | ||
| 361 | + } | ||
| 362 | + | ||
| 363 | + update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag. | ||
| 364 | + | ||
| 365 | + wp_new_user_notification( $user_id, $user_pass ); | ||
| 366 | + | ||
| 367 | + return $user_id; | ||
| 368 | +} | ||
| 369 | + | ||
| 370 | +// | ||
| 371 | +// Main | ||
| 372 | +// | ||
| 373 | + | ||
| 374 | +$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login'; | ||
| 375 | +$errors = new WP_Error(); | ||
| 376 | + | ||
| 377 | +if ( isset($_GET['key']) ) | ||
| 378 | + $action = 'resetpass'; | ||
| 379 | + | ||
| 380 | +// validate action so as to default to the login screen | ||
| 381 | +if ( !in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login' ), true ) && false === has_filter( 'login_form_' . $action ) ) | ||
| 382 | + $action = 'login'; | ||
| 383 | + | ||
| 384 | +nocache_headers(); | ||
| 385 | + | ||
| 386 | +header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset')); | ||
| 387 | + | ||
| 388 | +if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set | ||
| 389 | + if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) | ||
| 390 | + $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); | ||
| 391 | + | ||
| 392 | + $url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) ); | ||
| 393 | + if ( $url != get_option( 'siteurl' ) ) | ||
| 394 | + update_option( 'siteurl', $url ); | ||
| 395 | +} | ||
| 396 | + | ||
| 397 | +//Set a cookie now to see if they are supported by the browser. | ||
| 398 | +setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN); | ||
| 399 | +if ( SITECOOKIEPATH != COOKIEPATH ) | ||
| 400 | + setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN); | ||
| 401 | + | ||
| 402 | +// allow plugins to override the default actions, and to add extra actions if they want | ||
| 403 | +do_action( 'login_init' ); | ||
| 404 | +do_action( 'login_form_' . $action ); | ||
| 405 | + | ||
| 406 | +$http_post = ('POST' == $_SERVER['REQUEST_METHOD']); | ||
| 407 | +$interim_login = isset($_REQUEST['interim-login']); | ||
| 408 | + | ||
| 409 | +switch ($action) { | ||
| 410 | + | ||
| 411 | +case 'postpass' : | ||
| 412 | + require_once ABSPATH . 'wp-includes/class-phpass.php'; | ||
| 413 | + $hasher = new PasswordHash( 8, true ); | ||
| 414 | + | ||
| 415 | + // 10 days | ||
| 416 | + setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), time() + 10 * DAY_IN_SECONDS, COOKIEPATH ); | ||
| 417 | + | ||
| 418 | + wp_safe_redirect( wp_get_referer() ); | ||
| 419 | + exit(); | ||
| 420 | + | ||
| 421 | +break; | ||
| 422 | + | ||
| 423 | +case 'logout' : | ||
| 424 | + check_admin_referer('log-out'); | ||
| 425 | + wp_logout(); | ||
| 426 | + | ||
| 427 | + $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'admin.php?loggedout=true'; | ||
| 428 | + wp_safe_redirect( $redirect_to ); | ||
| 429 | + exit(); | ||
| 430 | + | ||
| 431 | +break; | ||
| 432 | + | ||
| 433 | +case 'lostpassword' : | ||
| 434 | +case 'retrievepassword' : | ||
| 435 | + | ||
| 436 | + if ( $http_post ) { | ||
| 437 | + $errors = retrieve_password(); | ||
| 438 | + if ( !is_wp_error($errors) ) { | ||
| 439 | + $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'admin.php?checkemail=confirm'; | ||
| 440 | + wp_safe_redirect( $redirect_to ); | ||
| 441 | + exit(); | ||
| 442 | + } | ||
| 443 | + } | ||
| 444 | + | ||
| 445 | + if ( isset($_GET['error']) && 'invalidkey' == $_GET['error'] ) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.')); | ||
| 446 | + $redirect_to = apply_filters( 'lostpassword_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' ); | ||
| 447 | + | ||
| 448 | + do_action('lost_password'); | ||
| 449 | + login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username or email address. You will receive a link to create a new password via email.') . '</p>', $errors); | ||
| 450 | + | ||
| 451 | + $user_login = isset($_POST['user_login']) ? wp_unslash($_POST['user_login']) : ''; | ||
| 452 | + | ||
| 453 | +?> | ||
| 454 | + | ||
| 455 | + | ||
| 456 | + | ||
| 457 | +<?php | ||
| 458 | +login_footer('user_login'); | ||
| 459 | +break; | ||
| 460 | + | ||
| 461 | +case 'resetpass' : | ||
| 462 | +case 'rp' : | ||
| 463 | + $user = check_password_reset_key($_GET['key'], $_GET['login']); | ||
| 464 | + | ||
| 465 | + if ( is_wp_error($user) ) { | ||
| 466 | + wp_redirect( site_url('admin.php?action=lostpassword&error=invalidkey') ); | ||
| 467 | + exit; | ||
| 468 | + } | ||
| 469 | + | ||
| 470 | + $errors = new WP_Error(); | ||
| 471 | + | ||
| 472 | + if ( isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2'] ) | ||
| 473 | + $errors->add( 'password_reset_mismatch', __( 'The passwords do not match.' ) ); | ||
| 474 | + | ||
| 475 | + do_action( 'validate_password_reset', $errors, $user ); | ||
| 476 | + | ||
| 477 | + if ( ( ! $errors->get_error_code() ) && isset( $_POST['pass1'] ) && !empty( $_POST['pass1'] ) ) { | ||
| 478 | + reset_password($user, $_POST['pass1']); | ||
| 479 | + login_header( __( 'Password Reset' ), '<p class="message reset-pass">' . __( 'Your password has been reset.' ) . ' <a href="' . esc_url( wp_login_url() ) . '">' . __( '登录' ) . '</a></p>' ); | ||
| 480 | + login_footer(); | ||
| 481 | + exit; | ||
| 482 | + } | ||
| 483 | + | ||
| 484 | + wp_enqueue_script('utils'); | ||
| 485 | + wp_enqueue_script('user-profile'); | ||
| 486 | + | ||
| 487 | + login_header(__('Reset Password'), '<p class="message reset-pass">' . __('Enter your new password below.') . '</p>', $errors ); | ||
| 488 | + | ||
| 489 | +?> | ||
| 490 | + | ||
| 491 | + | ||
| 492 | +<p id="nav"> | ||
| 493 | +<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( '登录' ); ?></a> | ||
| 494 | +<?php if ( get_option( 'users_can_register' ) ) : ?> | ||
| 495 | + | <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?> | ||
| 496 | +<?php endif; ?> | ||
| 497 | +</p> | ||
| 498 | + | ||
| 499 | +<?php | ||
| 500 | +login_footer('user_pass'); | ||
| 501 | +break; | ||
| 502 | + | ||
| 503 | +case 'register' : | ||
| 504 | + if ( is_multisite() ) { | ||
| 505 | + // Multisite uses wp-signup.php | ||
| 506 | + wp_redirect( apply_filters( 'wp_signup_location', network_site_url('wp-signup.php') ) ); | ||
| 507 | + exit; | ||
| 508 | + } | ||
| 509 | + | ||
| 510 | + if ( !get_option('users_can_register') ) { | ||
| 511 | + wp_redirect( site_url('admin.php?registration=disabled') ); | ||
| 512 | + exit(); | ||
| 513 | + } | ||
| 514 | + | ||
| 515 | + $user_login = ''; | ||
| 516 | + $user_email = ''; | ||
| 517 | + if ( $http_post ) { | ||
| 518 | + $user_login = $_POST['user_login']; | ||
| 519 | + $user_email = $_POST['user_email']; | ||
| 520 | + $errors = register_new_user($user_login, $user_email); | ||
| 521 | + if ( !is_wp_error($errors) ) { | ||
| 522 | + $redirect_to = !empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'admin.php?checkemail=registered'; | ||
| 523 | + wp_safe_redirect( $redirect_to ); | ||
| 524 | + exit(); | ||
| 525 | + } | ||
| 526 | + } | ||
| 527 | + | ||
| 528 | + $redirect_to = apply_filters( 'registration_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' ); | ||
| 529 | + login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors); | ||
| 530 | +?> | ||
| 531 | + | ||
| 532 | +<?php | ||
| 533 | +login_footer('user_login'); | ||
| 534 | +break; | ||
| 535 | + | ||
| 536 | +case 'login' : | ||
| 537 | +default: | ||
| 538 | + $secure_cookie = ''; | ||
| 539 | + $customize_login = isset( $_REQUEST['customize-login'] ); | ||
| 540 | + if ( $customize_login ) | ||
| 541 | + wp_enqueue_script( 'customize-base' ); | ||
| 542 | + | ||
| 543 | + // If the user wants ssl but the session is not ssl, force a secure cookie. | ||
| 544 | + if ( !empty($_POST['log']) && !force_ssl_admin() ) { | ||
| 545 | + $user_name = sanitize_user($_POST['log']); | ||
| 546 | + if ( $user = get_user_by('login', $user_name) ) { | ||
| 547 | + if ( get_user_option('use_ssl', $user->ID) ) { | ||
| 548 | + $secure_cookie = true; | ||
| 549 | + force_ssl_admin(true); | ||
| 550 | + } | ||
| 551 | + } | ||
| 552 | + } | ||
| 553 | + | ||
| 554 | + if ( isset( $_REQUEST['redirect_to'] ) ) { | ||
| 555 | + $redirect_to = $_REQUEST['redirect_to']; | ||
| 556 | + // Redirect to https if user wants ssl | ||
| 557 | + if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') ) | ||
| 558 | + $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to); | ||
| 559 | + } else { | ||
| 560 | + $redirect_to = admin_url(); | ||
| 561 | + } | ||
| 562 | + | ||
| 563 | + $reauth = empty($_REQUEST['reauth']) ? false : true; | ||
| 564 | + | ||
| 565 | + // If the user was redirected to a secure login form from a non-secure admin page, and secure login is required but secure admin is not, then don't use a secure | ||
| 566 | + // cookie and redirect back to the referring non-secure admin page. This allows logins to always be POSTed over SSL while allowing the user to choose visiting | ||
| 567 | + // the admin via http or https. | ||
| 568 | + if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) ) | ||
| 569 | + $secure_cookie = false; | ||
| 570 | + | ||
| 571 | + $user = wp_signon('', $secure_cookie); | ||
| 572 | + | ||
| 573 | + $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user); | ||
| 574 | + | ||
| 575 | + if ( !is_wp_error($user) && !$reauth ) { | ||
| 576 | + if ( $interim_login ) { | ||
| 577 | + $message = '<p class="message">' . __('You have logged in successfully.') . '</p>'; | ||
| 578 | + $interim_login = 'success'; | ||
| 579 | + login_header( '', $message ); ?> | ||
| 580 | + </div> | ||
| 581 | + <?php do_action( 'login_footer' ); ?> | ||
| 582 | + <?php if ( $customize_login ) : ?> | ||
| 583 | + <script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script> | ||
| 584 | + <?php endif; ?> | ||
| 585 | + </body></html> | ||
| 586 | +<?php exit; | ||
| 587 | + } | ||
| 588 | + | ||
| 589 | + if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) { | ||
| 590 | + // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile. | ||
| 591 | + if ( is_multisite() && !get_active_blog_for_user($user->ID) && !is_super_admin( $user->ID ) ) | ||
| 592 | + $redirect_to = user_admin_url(); | ||
| 593 | + elseif ( is_multisite() && !$user->has_cap('read') ) | ||
| 594 | + $redirect_to = get_dashboard_url( $user->ID ); | ||
| 595 | + elseif ( !$user->has_cap('edit_posts') ) | ||
| 596 | + $redirect_to = admin_url('profile.php'); | ||
| 597 | + } | ||
| 598 | + wp_safe_redirect($redirect_to); | ||
| 599 | + exit(); | ||
| 600 | + } | ||
| 601 | + | ||
| 602 | + $errors = $user; | ||
| 603 | + // Clear errors if loggedout is set. | ||
| 604 | + if ( !empty($_GET['loggedout']) || $reauth ) | ||
| 605 | + $errors = new WP_Error(); | ||
| 606 | + | ||
| 607 | + // If cookies are disabled we can't 登录 even with a valid user+pass | ||
| 608 | + if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) ) | ||
| 609 | + $errors->add('test_cookie', __("刷新Cookie后再尝试登录")); | ||
| 610 | + | ||
| 611 | + if ( $interim_login ) { | ||
| 612 | + if ( ! $errors->get_error_code() ) | ||
| 613 | + $errors->add('expired', __('Session expired. Please 登录 again. You will not move away from this page.'), 'message'); | ||
| 614 | + } else { | ||
| 615 | + // Some parts of this script use the main login form to display a message | ||
| 616 | + if ( isset($_GET['loggedout']) && true == $_GET['loggedout'] ) | ||
| 617 | + $errors->add('loggedout', __('您已登出!'), 'message'); | ||
| 618 | + elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) | ||
| 619 | + $errors->add('registerdisabled', __('User registration is currently not allowed.')); | ||
| 620 | + elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] ) | ||
| 621 | + $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message'); | ||
| 622 | + elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] ) | ||
| 623 | + $errors->add('newpass', __('Check your e-mail for your new password.'), 'message'); | ||
| 624 | + elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) | ||
| 625 | + $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message'); | ||
| 626 | + elseif ( strpos( $redirect_to, 'about.php?updated' ) ) | ||
| 627 | + $errors->add('updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to experience the awesomeness.' ), 'message' ); | ||
| 628 | + } | ||
| 629 | + | ||
| 630 | + $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to ); | ||
| 631 | + | ||
| 632 | + // Clear any stale cookies. | ||
| 633 | + if ( $reauth ) | ||
| 634 | + wp_clear_auth_cookie(); | ||
| 635 | + | ||
| 636 | + login_header(__('登录'), '', $errors); | ||
| 637 | + | ||
| 638 | + if ( isset($_POST['log']) ) | ||
| 639 | + $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(wp_unslash($_POST['log'])) : ''; | ||
| 640 | + $rememberme = ! empty( $_POST['rememberme'] ); | ||
| 641 | +?> | ||
| 642 | + | ||
| 643 | + | ||
| 644 | +<form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'admin.php', 'login_post' ) ); ?>" method="post"> | ||
| 645 | + <div class="login-ipt-item"> | ||
| 646 | + <input type="text" name="log" id="user_login" class="input login-ipt-txt" value="<?php echo esc_attr($user_login); ?>" size="20" placeholder="用户名" required="required" /> | ||
| 647 | + </div> | ||
| 648 | + <div class="login-ipt-item"> | ||
| 649 | + <input type="password" name="pwd" id="user_pass" class="input login-ipt-txt" value="" size="20" placeholder="密 码" required="required" /> | ||
| 650 | + <div class="forgetmenot"> | ||
| 651 | + <label for="rememberme"> | ||
| 652 | + <span class="check-box"><i></i><input name="rememberme" type="checkbox" id="rememberme" value="forever" <?php checked( $rememberme ); ?> /></span> | ||
| 653 | + 记住密码 | ||
| 654 | + </label> | ||
| 655 | + </div> | ||
| 656 | + </div> | ||
| 657 | + <?php do_action('login_form'); ?> | ||
| 658 | + <div class="login-ipt-item"> | ||
| 659 | + <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large login-button" value="<?php esc_attr_e('登 录'); ?>" /> | ||
| 660 | +<?php if ( $interim_login ) { ?> | ||
| 661 | + <input type="hidden" name="interim-login" value="1" /> | ||
| 662 | +<?php } else { ?> | ||
| 663 | + <input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" /> | ||
| 664 | +<?php } ?> | ||
| 665 | +<?php if ( $customize_login ) : ?> | ||
| 666 | + <input type="hidden" name="customize-login" value="1" /> | ||
| 667 | +<?php endif; ?> | ||
| 668 | + <input type="hidden" name="testcookie" value="1" /> | ||
| 669 | + </div> | ||
| 670 | +</form> | ||
| 671 | + | ||
| 672 | + | ||
| 673 | + | ||
| 674 | + | ||
| 675 | + | ||
| 676 | +<?php if ( ! $interim_login ) { ?> | ||
| 677 | +<p id="nav"> | ||
| 678 | +<?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) : ?> | ||
| 679 | + <?php if ( get_option( 'users_can_register' ) ) : ?> | ||
| 680 | + <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?> | | ||
| 681 | + <?php endif; ?> | ||
| 682 | +<?php endif; ?> | ||
| 683 | +</p> | ||
| 684 | +<?php } ?> | ||
| 685 | + | ||
| 686 | +<script type="text/javascript"> | ||
| 687 | +function wp_attempt_focus(){ | ||
| 688 | +setTimeout( function(){ try{ | ||
| 689 | +<?php if ( $user_login || $interim_login ) { ?> | ||
| 690 | +d = document.getElementById('user_pass'); | ||
| 691 | +d.value = ''; | ||
| 692 | +<?php } else { ?> | ||
| 693 | +d = document.getElementById('user_login'); | ||
| 694 | +<?php if ( 'invalid_username' == $errors->get_error_code() ) { ?> | ||
| 695 | +if( d.value != '' ) | ||
| 696 | +d.value = ''; | ||
| 697 | +<?php | ||
| 698 | +} | ||
| 699 | +}?> | ||
| 700 | +d.focus(); | ||
| 701 | +d.select(); | ||
| 702 | +} catch(e){} | ||
| 703 | +}, 200); | ||
| 704 | +} | ||
| 705 | + | ||
| 706 | +<?php if ( !$error ) { ?> | ||
| 707 | +wp_attempt_focus(); | ||
| 708 | +<?php } ?> | ||
| 709 | +if(typeof wpOnload=='function')wpOnload(); | ||
| 710 | +<?php if ( $interim_login ) { ?> | ||
| 711 | +(function(){ | ||
| 712 | +try { | ||
| 713 | + var i, links = document.getElementsByTagName('a'); | ||
| 714 | + for ( i in links ) { | ||
| 715 | + if ( links[i].href ) | ||
| 716 | + links[i].target = '_blank'; | ||
| 717 | + } | ||
| 718 | +} catch(e){} | ||
| 719 | +}()); | ||
| 720 | +<?php } ?> | ||
| 721 | +</script> | ||
| 722 | + </div> | ||
| 723 | + </div> | ||
| 724 | +</div> | ||
| 725 | + | ||
| 726 | +<script> | ||
| 727 | +// checkbox | ||
| 728 | +$(function(){ | ||
| 729 | + $('.check-box').each(function(){ | ||
| 730 | + $('.check-box').find('input').click(function(){ | ||
| 731 | + if($(this).is(':checked')){ | ||
| 732 | + $(this).attr('checked','true'); | ||
| 733 | + $(this).parents('.check-box').addClass('checked'); | ||
| 734 | + } | ||
| 735 | + else{ | ||
| 736 | + $(this).parents('.check-box').removeClass('checked'); | ||
| 737 | + } | ||
| 738 | + }) | ||
| 739 | + }); | ||
| 740 | + $('.check-box').each(function(){ | ||
| 741 | + if($(this).find('input').is(':checked')){ | ||
| 742 | + $(this).find('input').attr('checked','true'); | ||
| 743 | + !$(this).addClass('checked'); | ||
| 744 | + } | ||
| 745 | + else{ | ||
| 746 | + !$(this).removeClass('checked'); | ||
| 747 | + } | ||
| 748 | + }); | ||
| 749 | +}) | ||
| 750 | +</script> | ||
| 751 | + | ||
| 752 | + | ||
| 753 | + | ||
| 754 | +</body> | ||
| 755 | +</html><?php | ||
| 756 | +break; | ||
| 757 | +} // end action switch |
admin/admin.css
0 → 100755
| 1 | +@charset "utf-8"; | ||
| 2 | +body,html,h1,h2,h3,h4,h5,h6,p,ul,ol,li,dl,dt,dd,th,td,form,object,iframe,blockquote,pre,a,abbr,address,code,img,fieldset,form,label,figure{margin:0;padding:0;} | ||
| 3 | +body,html,input,button,textarea{color:#666;font:12px/1.8 Arial,Tahoma,Verdana,Helvetica,sans-serif;} | ||
| 4 | +article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block;} | ||
| 5 | +body{background:#eff0f4;} | ||
| 6 | +h1{font-size:18px;} | ||
| 7 | +h2{font-size:16px;} | ||
| 8 | +h3,h4,h5{font-size:14px;} | ||
| 9 | +img{border:none;vertical-align:middle;} | ||
| 10 | +li{list-style:none;} | ||
| 11 | +i,em{font-style:normal;} | ||
| 12 | +a{color:#666;text-decoration:none;} | ||
| 13 | +a:focus{outline:none;} | ||
| 14 | +a:hover{color:#333;} | ||
| 15 | +input[type="text"]:focus{outline:none;} | ||
| 16 | +input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;} | ||
| 17 | +input[type="reset"]::-moz-focus-inner,input[type="button"]::-moz-focus-inner,input[type="submit"]::-moz-focus-inner, | ||
| 18 | +input[type="file"] > input[type="button"]::-moz-focus-inner{border:none;padding:0;} | ||
| 19 | + | ||
| 20 | +/* 清除浮动 */ | ||
| 21 | +.clearfix:after,.nav-bar ul:after,.path-bar ul:after,.admin-main:after,.mbox .tbar:after,.info-items:after,.info-cont:after{content:"";display:block;clear:both;visibility:hidden;height:0;} | ||
| 22 | +* html .clearfix,* html .nav-bar ul,* html .path-bar ul,* html .admin-main,* html .mbox .tbar,* html .info-items,* html .info-cont{display:inline-block;} | ||
| 23 | +* +html .clearfix,* +html .nav-bar ul,* +html .path-bar ul,* +html .admin-main,* +html .mbox .tbar,* +html .info-items,* +html .info-cont{display:inline-block;} | ||
| 24 | + | ||
| 25 | +/* 小图 */ | ||
| 26 | +.nav-bar li i,.admin-nav li.menu-msg a,.admin-nav li.menu-guide a,.admin-nav li.menu-browse a,.admin-nav li.menu-promote a,.side-nav li li .ico-box i,.ico-pc,.ico-product,.ico-news,.ico-user,.ico-page,.ico-site-map,.ico-file,.ico-seo,.ico-google-tool,.ico-count,.path-bar li.home a,.mbox .ico-show-more,.mbox .ico-del,.mbox .ico-arrow,.side-nav li .ico-menu-arrow{background-image:url(img/admin_icons.png);background-repeat:no-repeat;background-color:transparent;} | ||
| 27 | + | ||
| 28 | +/* 交互 */ | ||
| 29 | +.side-nav .ico-box b,.side-nav .ico-box i,.side-nav li li a,.info-item .info-cont{-moz-transition:all 0.2s ease-in-out;-webkit-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;} | ||
| 30 | + | ||
| 31 | +/* 字体 */ | ||
| 32 | +.mbox .tbar h2,.info-item .info-cont .tit {font-family:"Microsoft YaHei","微软雅黑";} | ||
| 33 | + | ||
| 34 | +/* 页头 | ||
| 35 | +----------------------------- */ | ||
| 36 | +.admin-head{width:100%;height:50px;background:#25313f;position:relative;} | ||
| 37 | +.admin-head .admin-logo{width:220px;position:absolute;left:0;top:0;bottom:0;text-align:center;background:url(http://www.goodao.cn/adminimg/cms-logo.png) center center no-repeat;} | ||
| 38 | +.admin-head .admin-logo:hover{opacity:0.95;} | ||
| 39 | +.admin-head .admin-logo a{display:block;width:100%;height:50px;text-indent:-9999em;overflow:hidden;} | ||
| 40 | +.nav-bar{padding:0 0 0 220px;overflow:hidden;} | ||
| 41 | +.left-nav{border-left:1px solid #304152;display:inline;float:left;margin-left:-1px;} | ||
| 42 | +.left-nav li,.left-nav li a{color:#adbece;} | ||
| 43 | +.left-nav li {line-height:20px;padding:15px 12px;} | ||
| 44 | +.left-nav li a:hover{color:#fff;text-decoration:none;} | ||
| 45 | +.left-nav li i,.left-nav li b{vertical-align:middle;} | ||
| 46 | +.left-nav li i{display:inline-block;width:11px;height:15px;margin:0 3px 0 0;background-position:-87px 0;} | ||
| 47 | +.left-nav li i{*display:inline;} | ||
| 48 | +.left-nav li a:hover i{background-position:-99px 0;} | ||
| 49 | +.admin-nav {display:inline;float:right;} | ||
| 50 | +.admin-nav li {float:left;padding:5px 15px 5px 0;} | ||
| 51 | +.admin-nav li,.admin-nav li a{color:#e4e9f2;} | ||
| 52 | +.admin-nav li a{float:left;padding:10px 0;line-height:20px;} | ||
| 53 | +.admin-nav li a:hover{color:#fff;} | ||
| 54 | +.admin-nav li span.num{color:#fa6b5b;} | ||
| 55 | +.admin-nav li.menu-msg a,.admin-nav li.menu-guide a,.admin-nav li.menu-browse a,.admin-nav li.menu-promote a{padding-left:27px;} | ||
| 56 | +.admin-nav li.menu-msg a{background-position:-89px -258px;} | ||
| 57 | +.admin-nav li.menu-guide a{background-position:-89px -290px;} | ||
| 58 | +.admin-nav li.menu-browse a{background-position:-89px -320px;} | ||
| 59 | +.admin-nav li.menu-promote a{background-position:-89px -350px;} | ||
| 60 | + | ||
| 61 | +/* 左侧栏 | ||
| 62 | +----------------------------- */ | ||
| 63 | +.admin-side{width:220px;background:#42586f;position:absolute;left:0;top:50px;bottom:0;overflow:hidden;z-index:333;} | ||
| 64 | +.admin-side,.admin-side a,.admin-side a:hover{color:#fff;} | ||
| 65 | +.admin-side .side-nav {width:100%;position:absolute;left:0;top:0;bottom:52px;overflow:hidden;overflow-y:auto;} | ||
| 66 | +.admin-side .copyright {width:100%;line-height:21px;padding:5px 0;text-align:center;background:#2d3e50;position:absolute;left:0;bottom:0;} | ||
| 67 | +.admin-side .copyright em{color:#00baff;} | ||
| 68 | +.ico-pc,.ico-product,.ico-news,.ico-user,.ico-page,.ico-site-map,.ico-file,.ico-seo,.ico-google-tool,.ico-count,.side-nav li li .ico-box i{display:block;width:44px;height:44px;position:absolute;left:0;top:0;z-index:3;} | ||
| 69 | +.ico-pc{background-position:12px 12px;} | ||
| 70 | +.ico-product{background-position:12px -30px;} | ||
| 71 | +.ico-news{background-position:12px -75px;} | ||
| 72 | +.ico-page{background-position:12px -118px;} | ||
| 73 | +.ico-site-map{background-position:12px -162px;} | ||
| 74 | +.ico-file{background-position:12px -205px;} | ||
| 75 | +.ico-seo{background-position:12px -251px;} | ||
| 76 | +.ico-google-tool{background-position:12px -293px;} | ||
| 77 | +.ico-count{background-position:12px -337px;} | ||
| 78 | +.ico-user{background-position:12px -381px;} | ||
| 79 | +.side-nav li{width:100%;position:relative;} | ||
| 80 | +.side-nav li a{display:block;padding:12px 10px 11px 58px;min-height:20px;_height:20px;line-height:20px;border-bottom:1px solid #50667b;border-bottom:1px solid rgba(255,255,255,0.05);position:relative;} | ||
| 81 | +.side-nav li a *{_cursor:pointer;} | ||
| 82 | +.side-nav li a:hover,.side-nav li a.current{background:#3d5368;} | ||
| 83 | +.side-nav li a:hover .ico-box b,.side-nav li a.active .ico-box b{left:0;} | ||
| 84 | +.side-nav li a:hover .ico-box i,.side-nav li li.active a .ico-box i{opacity:0.9;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=90)";filter:alpha(opacity=90);} | ||
| 85 | +.side-nav li span.ico-box {display:block;width:44px;height:100%;position:absolute;left:0;top:0;overflow:hidden;border-right:1px solid #50667b;border-right: 1px solid rgba(255,255,255,0.05);padding-bottom:1px;_height:44px;vertical-align:middle;} | ||
| 86 | +.side-nav li span.ico-box b{display:block;width:100%;height:100%;position:absolute;top:0;bottom:0;left:-43px;} | ||
| 87 | +.side-nav li span.ico-box i{opacity:0.5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";filter:alpha(opacity=50);} | ||
| 88 | +.side-nav li ul{display:none;background:#364b5e;} | ||
| 89 | +.side-nav li b.ico-bg-red{background:#fa6b5b;} | ||
| 90 | +.side-nav li b.ico-bg-yellow{background:#e6d15a;} | ||
| 91 | +.side-nav li b.ico-bg-orange{background:#ffc333;} | ||
| 92 | +.side-nav li b.ico-bg-green{background:#8ec165;} | ||
| 93 | +.side-nav li b.ico-bg-green-2{background:#5dc372;} | ||
| 94 | +.side-nav li b.ico-bg-cyan{background:#65cea6;} | ||
| 95 | +.side-nav li b.ico-bg-blue{background:#4cc0c1;} | ||
| 96 | +.side-nav li li .ico-box i{background-position:-85px -165px;opacity:0.6;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";filter:alpha(opacity=60);} | ||
| 97 | +.side-nav li li a:hover .ico-box i{opacity:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:alpha(opacity=100);} | ||
| 98 | +.side-nav li li a:hover,.side-nav li li.active a {background:#2d3e50;} | ||
| 99 | +.side-nav li.current ul{display:block;} | ||
| 100 | +.side-nav li .ico-menu-arrow{display:block;width:8px;height:8px;background-position:-102px -243px;position:absolute;right:12px;top:15px;} | ||
| 101 | +.side-nav li .active .ico-menu-arrow{background-position:-102px -213px;} | ||
| 102 | + | ||
| 103 | + | ||
| 104 | +/* 首页右侧 | ||
| 105 | +----------------------------- */ | ||
| 106 | +.admin-wrap{padding:0 0 0 220px;background:#f1f5f9;position:absolute;left:0;top:86px;bottom:0;right:0;} | ||
| 107 | +.admin-wrap .frame-wrap{width:100%;height:100%;overflow:hidden;} | ||
| 108 | +.path-bar{background:#fff;line-height:20px;padding:8px 12px 8px 232px;border-bottom:1px solid #eee;} | ||
| 109 | +.path-bar ul{height:27px;border-bottom:1px solid #eee;} | ||
| 110 | +.path-bar li{float:left;} | ||
| 111 | +.path-bar li i{padding:0 8px;} | ||
| 112 | +.path-bar li.home i{content:"";display:none;} | ||
| 113 | +.path-bar li.home a{display:inline-block;padding-left:20px;background-position:-95px -32px;} | ||
| 114 | +.path-bar li.home a{*display:inline;} | ||
| 115 | +.info-items{} | ||
| 116 | +.info-item{width:48.5%;margin-bottom:20px;} | ||
| 117 | +.item-left{float:left;} | ||
| 118 | +.item-right{float:right;} | ||
| 119 | +.info-item .info-cont {display:block;padding:13px 0 13px 15px;border-radius:5px;overflow:hidden;} | ||
| 120 | +.info-item .info-cont,.info-item .info-cont a{color:#fff;} | ||
| 121 | +.info-item .info-cont a:hover{text-decoration:underline;} | ||
| 122 | +.info-item .info-cont i{display:block;width:55px;height:50px;float:left;margin:0 10px 0 0;background-image:url(img/info_icons.png);background-repeat:no-repeat;background-color:transparent;} | ||
| 123 | +.info-item .info-cont .tit {display:block;font-size:18px;font-weight:bold;line-height:1.4;margin:0 0 3px;} | ||
| 124 | +.info-item .info-cont .text{display:block;} | ||
| 125 | +.view-info,.product-info {float:left;} | ||
| 126 | +.inquiry-info,.news-info{float:right;} | ||
| 127 | + | ||
| 128 | + | ||
| 129 | +.top10,.dayok {float:left;} | ||
| 130 | +.top30,.dayno{float:right;} | ||
| 131 | + | ||
| 132 | + | ||
| 133 | +.top10,.dayok,.top30,.dayno i{height:100px;} | ||
| 134 | + | ||
| 135 | + | ||
| 136 | + | ||
| 137 | +.top10 .info-cont{background:#fb8577;border:1px solid #dd7c6e;} | ||
| 138 | +.top10 .info-cont i{background-position:-225px 0;} | ||
| 139 | +.top10 .info-cont:hover{background:#fb7575;} | ||
| 140 | + | ||
| 141 | +.top30 .info-cont {background:#5ab6df;border:1px solid #5ea8c9;} | ||
| 142 | +.top30 .info-cont i{background-position:-284px 0;} | ||
| 143 | +.top30 .info-cont:hover{background:#37aadd;} | ||
| 144 | + | ||
| 145 | +.dayok .info-cont {background:#65cea6;border:1px solid #5cc29b;} | ||
| 146 | +.dayok .info-cont i{background-position:-345px 0;} | ||
| 147 | +.dayok .info-cont:hover{background:#3fc592;} | ||
| 148 | + | ||
| 149 | +.dayno .info-cont {background:#eac85d;border:1px solid #dab952;} | ||
| 150 | +.dayno .info-cont i{background-position:-406px 0;} | ||
| 151 | +.dayno .info-cont:hover{background:#e3bd47;} | ||
| 152 | + | ||
| 153 | + | ||
| 154 | +.view-info .info-cont{background:#fb8577;border:1px solid #dd7c6e;} | ||
| 155 | +.view-info .info-cont i{background-position:0 0;} | ||
| 156 | +.view-info .info-cont:hover{background:#fb7575;} | ||
| 157 | + | ||
| 158 | +.inquiry-info .info-cont {background:#5ab6df;border:1px solid #5ea8c9;} | ||
| 159 | +.inquiry-info .info-cont i{background-position:-53px 0;} | ||
| 160 | +.inquiry-info .info-cont:hover{background:#37aadd;} | ||
| 161 | + | ||
| 162 | +.product-info .info-cont {background:#65cea6;border:1px solid #5cc29b;} | ||
| 163 | +.product-info .info-cont i{background-position:-109px 0;} | ||
| 164 | +.product-info .info-cont:hover{background:#3fc592;} | ||
| 165 | + | ||
| 166 | +.news-info .info-cont {background:#eac85d;border:1px solid #dab952;} | ||
| 167 | +.news-info .info-cont i{background-position:-167px 0;} | ||
| 168 | +.news-info .info-cont:hover{background:#e3bd47;} | ||
| 169 | + | ||
| 170 | + | ||
| 171 | + | ||
| 172 | + | ||
| 173 | + | ||
| 174 | + | ||
| 175 | + | ||
| 176 | + | ||
| 177 | + | ||
| 178 | + | ||
| 179 | + | ||
| 180 | + | ||
| 181 | +.admin-main{padding:1.5%;} | ||
| 182 | +.main-left {width:49%;float:left;} | ||
| 183 | +.main-right{width:49%;float:right;} | ||
| 184 | +.mbox{border-bottom:1px solid #ddd;border-radius:6px;background:#fff;margin-bottom:10px;} | ||
| 185 | +.mbox .tbar {height:34px;line-height:34px;padding:6px 10px 6px 15px;} | ||
| 186 | +.mbox .tbar h2{display:inline;float:left;color:#333;font-size:14px;} | ||
| 187 | +.mbox .cont {padding:10px 15px 20px;display:none;} | ||
| 188 | +.mbox .cont,.mbox .cont a{color:#757575;} | ||
| 189 | +.mbox .cont img{max-width:100%;height:auto;} | ||
| 190 | +.mbox .acts{display:inline;float:right;} | ||
| 191 | +.mbox .ico-show-more,.mbox .ico-del,.mbox .ico-arrow{display:inline-block;width:34px;height:34px;} | ||
| 192 | +.mbox .ico-show-more{background-position:-76px -89px;*display:inline;} | ||
| 193 | +.mbox .ico-arrow{background-position:-43px -125px;} | ||
| 194 | +.mbox .ico-del{background-position:-79px -125px;margin:0 0 0 2px;} | ||
| 195 | +.show-cont .tbar{border-bottom:1px dotted #aaa;} | ||
| 196 | +.show-cont .ico-show-more{background-position:-42px -89px;} | ||
| 197 | +.show-cont .ico-arrow{background-position:-43px -159px;} | ||
| 198 | +.box-active .cont{display:block;} | ||
| 199 | +.mbox-mar-15{margin-bottom:20px;} | ||
| 200 | +.main-foot{border-top:1px solid #ddd;padding:10px 0;text-align:right;margin:0 1.5%;} | ||
| 201 | + | ||
| 202 | + | ||
| 203 | +@media screen and (min-width:1600px){ | ||
| 204 | +.info-item .info-cont{padding-left:20px;} | ||
| 205 | +.info-item .info-cont i{margin-right:20px;} | ||
| 206 | +} | ||
| 207 | +@media screen and (max-width:1000px){ | ||
| 208 | +.admin-side{width:160px;} | ||
| 209 | +.admin-wrap{padding-left:160px;} | ||
| 210 | +} | ||
| 211 | + | ||
| 212 | + | ||
| 213 | + | ||
| 214 | +.side-nav li.current ul{display: none;display: block\9;} | ||
| 215 | +.side-nav li.current ul > ul{display: none\9;} | ||
| 216 | +.side-nav li.current > ul{display: block;} | ||
| 217 | +.side-nav ul .active{background: #2d3e50;} | ||
| 218 | +.side-nav li ul ul li .ico-box {display: none;} | ||
| 219 | +.side-nav li ul ul li .ico-box i{display: inline-block;width: 3px;height: 3px;background: #fff;position: absolute;left: 50%;margin-left: -1px;top: 50%;margin-top: -1px;} | ||
| 220 | + |
admin/custom_service/title_pic.png
0 → 100755
18.0 KB
admin/extend/composer.lock
0 → 100755
| 1 | +{ | ||
| 2 | + "_readme": [ | ||
| 3 | + "This file locks the dependencies of your project to a known state", | ||
| 4 | + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", | ||
| 5 | + "This file is @generated automatically" | ||
| 6 | + ], | ||
| 7 | + "content-hash": "960ef56a1c399a52a327a8a7ba0be847", | ||
| 8 | + "packages": [ | ||
| 9 | + { | ||
| 10 | + "name": "qiniu/php-sdk", | ||
| 11 | + "version": "v7.2.10", | ||
| 12 | + "source": { | ||
| 13 | + "type": "git", | ||
| 14 | + "url": "https://github.com/qiniu/php-sdk.git", | ||
| 15 | + "reference": "d89987163f560ebf9dfa5bb25de9bd9b1a3b2bd8" | ||
| 16 | + }, | ||
| 17 | + "dist": { | ||
| 18 | + "type": "zip", | ||
| 19 | + "url": "https://api.github.com/repos/qiniu/php-sdk/zipball/d89987163f560ebf9dfa5bb25de9bd9b1a3b2bd8", | ||
| 20 | + "reference": "d89987163f560ebf9dfa5bb25de9bd9b1a3b2bd8", | ||
| 21 | + "shasum": "", | ||
| 22 | + "mirrors": [ | ||
| 23 | + { | ||
| 24 | + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", | ||
| 25 | + "preferred": true | ||
| 26 | + } | ||
| 27 | + ] | ||
| 28 | + }, | ||
| 29 | + "require": { | ||
| 30 | + "php": ">=5.3.3" | ||
| 31 | + }, | ||
| 32 | + "require-dev": { | ||
| 33 | + "phpunit/phpunit": "~4.0", | ||
| 34 | + "squizlabs/php_codesniffer": "~2.3" | ||
| 35 | + }, | ||
| 36 | + "type": "library", | ||
| 37 | + "autoload": { | ||
| 38 | + "psr-4": { | ||
| 39 | + "Qiniu\\": "src/Qiniu" | ||
| 40 | + }, | ||
| 41 | + "files": [ | ||
| 42 | + "src/Qiniu/functions.php" | ||
| 43 | + ] | ||
| 44 | + }, | ||
| 45 | + "notification-url": "https://packagist.org/downloads/", | ||
| 46 | + "license": [ | ||
| 47 | + "MIT" | ||
| 48 | + ], | ||
| 49 | + "authors": [ | ||
| 50 | + { | ||
| 51 | + "name": "Qiniu", | ||
| 52 | + "email": "sdk@qiniu.com", | ||
| 53 | + "homepage": "http://www.qiniu.com" | ||
| 54 | + } | ||
| 55 | + ], | ||
| 56 | + "description": "Qiniu Resource (Cloud) Storage SDK for PHP", | ||
| 57 | + "homepage": "http://developer.qiniu.com/", | ||
| 58 | + "keywords": [ | ||
| 59 | + "cloud", | ||
| 60 | + "qiniu", | ||
| 61 | + "sdk", | ||
| 62 | + "storage" | ||
| 63 | + ], | ||
| 64 | + "time": "2019-10-28T10:23:23+00:00" | ||
| 65 | + } | ||
| 66 | + ], | ||
| 67 | + "packages-dev": [], | ||
| 68 | + "aliases": [], | ||
| 69 | + "minimum-stability": "stable", | ||
| 70 | + "stability-flags": [], | ||
| 71 | + "prefer-stable": false, | ||
| 72 | + "prefer-lowest": false, | ||
| 73 | + "platform": [], | ||
| 74 | + "platform-dev": [], | ||
| 75 | + "plugin-api-version": "1.1.0" | ||
| 76 | +} |
admin/extend/vendor/autoload.php
0 → 100755
admin/extend/vendor/composer/ClassLoader.php
0 → 100755
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +/* | ||
| 4 | + * This file is part of Composer. | ||
| 5 | + * | ||
| 6 | + * (c) Nils Adermann <naderman@naderman.de> | ||
| 7 | + * Jordi Boggiano <j.boggiano@seld.be> | ||
| 8 | + * | ||
| 9 | + * For the full copyright and license information, please view the LICENSE | ||
| 10 | + * file that was distributed with this source code. | ||
| 11 | + */ | ||
| 12 | + | ||
| 13 | +namespace Composer\Autoload; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. | ||
| 17 | + * | ||
| 18 | + * $loader = new \Composer\Autoload\ClassLoader(); | ||
| 19 | + * | ||
| 20 | + * // register classes with namespaces | ||
| 21 | + * $loader->add('Symfony\Component', __DIR__.'/component'); | ||
| 22 | + * $loader->add('Symfony', __DIR__.'/framework'); | ||
| 23 | + * | ||
| 24 | + * // activate the autoloader | ||
| 25 | + * $loader->register(); | ||
| 26 | + * | ||
| 27 | + * // to enable searching the include path (eg. for PEAR packages) | ||
| 28 | + * $loader->setUseIncludePath(true); | ||
| 29 | + * | ||
| 30 | + * In this example, if you try to use a class in the Symfony\Component | ||
| 31 | + * namespace or one of its children (Symfony\Component\Console for instance), | ||
| 32 | + * the autoloader will first look for the class under the component/ | ||
| 33 | + * directory, and it will then fallback to the framework/ directory if not | ||
| 34 | + * found before giving up. | ||
| 35 | + * | ||
| 36 | + * This class is loosely based on the Symfony UniversalClassLoader. | ||
| 37 | + * | ||
| 38 | + * @author Fabien Potencier <fabien@symfony.com> | ||
| 39 | + * @author Jordi Boggiano <j.boggiano@seld.be> | ||
| 40 | + * @see http://www.php-fig.org/psr/psr-0/ | ||
| 41 | + * @see http://www.php-fig.org/psr/psr-4/ | ||
| 42 | + */ | ||
| 43 | +class ClassLoader | ||
| 44 | +{ | ||
| 45 | + // PSR-4 | ||
| 46 | + private $prefixLengthsPsr4 = array(); | ||
| 47 | + private $prefixDirsPsr4 = array(); | ||
| 48 | + private $fallbackDirsPsr4 = array(); | ||
| 49 | + | ||
| 50 | + // PSR-0 | ||
| 51 | + private $prefixesPsr0 = array(); | ||
| 52 | + private $fallbackDirsPsr0 = array(); | ||
| 53 | + | ||
| 54 | + private $useIncludePath = false; | ||
| 55 | + private $classMap = array(); | ||
| 56 | + private $classMapAuthoritative = false; | ||
| 57 | + private $missingClasses = array(); | ||
| 58 | + private $apcuPrefix; | ||
| 59 | + | ||
| 60 | + public function getPrefixes() | ||
| 61 | + { | ||
| 62 | + if (!empty($this->prefixesPsr0)) { | ||
| 63 | + return call_user_func_array('array_merge', $this->prefixesPsr0); | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + return array(); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + public function getPrefixesPsr4() | ||
| 70 | + { | ||
| 71 | + return $this->prefixDirsPsr4; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + public function getFallbackDirs() | ||
| 75 | + { | ||
| 76 | + return $this->fallbackDirsPsr0; | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + public function getFallbackDirsPsr4() | ||
| 80 | + { | ||
| 81 | + return $this->fallbackDirsPsr4; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + public function getClassMap() | ||
| 85 | + { | ||
| 86 | + return $this->classMap; | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + /** | ||
| 90 | + * @param array $classMap Class to filename map | ||
| 91 | + */ | ||
| 92 | + public function addClassMap(array $classMap) | ||
| 93 | + { | ||
| 94 | + if ($this->classMap) { | ||
| 95 | + $this->classMap = array_merge($this->classMap, $classMap); | ||
| 96 | + } else { | ||
| 97 | + $this->classMap = $classMap; | ||
| 98 | + } | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + /** | ||
| 102 | + * Registers a set of PSR-0 directories for a given prefix, either | ||
| 103 | + * appending or prepending to the ones previously set for this prefix. | ||
| 104 | + * | ||
| 105 | + * @param string $prefix The prefix | ||
| 106 | + * @param array|string $paths The PSR-0 root directories | ||
| 107 | + * @param bool $prepend Whether to prepend the directories | ||
| 108 | + */ | ||
| 109 | + public function add($prefix, $paths, $prepend = false) | ||
| 110 | + { | ||
| 111 | + if (!$prefix) { | ||
| 112 | + if ($prepend) { | ||
| 113 | + $this->fallbackDirsPsr0 = array_merge( | ||
| 114 | + (array) $paths, | ||
| 115 | + $this->fallbackDirsPsr0 | ||
| 116 | + ); | ||
| 117 | + } else { | ||
| 118 | + $this->fallbackDirsPsr0 = array_merge( | ||
| 119 | + $this->fallbackDirsPsr0, | ||
| 120 | + (array) $paths | ||
| 121 | + ); | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + return; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + $first = $prefix[0]; | ||
| 128 | + if (!isset($this->prefixesPsr0[$first][$prefix])) { | ||
| 129 | + $this->prefixesPsr0[$first][$prefix] = (array) $paths; | ||
| 130 | + | ||
| 131 | + return; | ||
| 132 | + } | ||
| 133 | + if ($prepend) { | ||
| 134 | + $this->prefixesPsr0[$first][$prefix] = array_merge( | ||
| 135 | + (array) $paths, | ||
| 136 | + $this->prefixesPsr0[$first][$prefix] | ||
| 137 | + ); | ||
| 138 | + } else { | ||
| 139 | + $this->prefixesPsr0[$first][$prefix] = array_merge( | ||
| 140 | + $this->prefixesPsr0[$first][$prefix], | ||
| 141 | + (array) $paths | ||
| 142 | + ); | ||
| 143 | + } | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + /** | ||
| 147 | + * Registers a set of PSR-4 directories for a given namespace, either | ||
| 148 | + * appending or prepending to the ones previously set for this namespace. | ||
| 149 | + * | ||
| 150 | + * @param string $prefix The prefix/namespace, with trailing '\\' | ||
| 151 | + * @param array|string $paths The PSR-4 base directories | ||
| 152 | + * @param bool $prepend Whether to prepend the directories | ||
| 153 | + * | ||
| 154 | + * @throws \InvalidArgumentException | ||
| 155 | + */ | ||
| 156 | + public function addPsr4($prefix, $paths, $prepend = false) | ||
| 157 | + { | ||
| 158 | + if (!$prefix) { | ||
| 159 | + // Register directories for the root namespace. | ||
| 160 | + if ($prepend) { | ||
| 161 | + $this->fallbackDirsPsr4 = array_merge( | ||
| 162 | + (array) $paths, | ||
| 163 | + $this->fallbackDirsPsr4 | ||
| 164 | + ); | ||
| 165 | + } else { | ||
| 166 | + $this->fallbackDirsPsr4 = array_merge( | ||
| 167 | + $this->fallbackDirsPsr4, | ||
| 168 | + (array) $paths | ||
| 169 | + ); | ||
| 170 | + } | ||
| 171 | + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { | ||
| 172 | + // Register directories for a new namespace. | ||
| 173 | + $length = strlen($prefix); | ||
| 174 | + if ('\\' !== $prefix[$length - 1]) { | ||
| 175 | + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); | ||
| 176 | + } | ||
| 177 | + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; | ||
| 178 | + $this->prefixDirsPsr4[$prefix] = (array) $paths; | ||
| 179 | + } elseif ($prepend) { | ||
| 180 | + // Prepend directories for an already registered namespace. | ||
| 181 | + $this->prefixDirsPsr4[$prefix] = array_merge( | ||
| 182 | + (array) $paths, | ||
| 183 | + $this->prefixDirsPsr4[$prefix] | ||
| 184 | + ); | ||
| 185 | + } else { | ||
| 186 | + // Append directories for an already registered namespace. | ||
| 187 | + $this->prefixDirsPsr4[$prefix] = array_merge( | ||
| 188 | + $this->prefixDirsPsr4[$prefix], | ||
| 189 | + (array) $paths | ||
| 190 | + ); | ||
| 191 | + } | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + /** | ||
| 195 | + * Registers a set of PSR-0 directories for a given prefix, | ||
| 196 | + * replacing any others previously set for this prefix. | ||
| 197 | + * | ||
| 198 | + * @param string $prefix The prefix | ||
| 199 | + * @param array|string $paths The PSR-0 base directories | ||
| 200 | + */ | ||
| 201 | + public function set($prefix, $paths) | ||
| 202 | + { | ||
| 203 | + if (!$prefix) { | ||
| 204 | + $this->fallbackDirsPsr0 = (array) $paths; | ||
| 205 | + } else { | ||
| 206 | + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; | ||
| 207 | + } | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + /** | ||
| 211 | + * Registers a set of PSR-4 directories for a given namespace, | ||
| 212 | + * replacing any others previously set for this namespace. | ||
| 213 | + * | ||
| 214 | + * @param string $prefix The prefix/namespace, with trailing '\\' | ||
| 215 | + * @param array|string $paths The PSR-4 base directories | ||
| 216 | + * | ||
| 217 | + * @throws \InvalidArgumentException | ||
| 218 | + */ | ||
| 219 | + public function setPsr4($prefix, $paths) | ||
| 220 | + { | ||
| 221 | + if (!$prefix) { | ||
| 222 | + $this->fallbackDirsPsr4 = (array) $paths; | ||
| 223 | + } else { | ||
| 224 | + $length = strlen($prefix); | ||
| 225 | + if ('\\' !== $prefix[$length - 1]) { | ||
| 226 | + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); | ||
| 227 | + } | ||
| 228 | + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; | ||
| 229 | + $this->prefixDirsPsr4[$prefix] = (array) $paths; | ||
| 230 | + } | ||
| 231 | + } | ||
| 232 | + | ||
| 233 | + /** | ||
| 234 | + * Turns on searching the include path for class files. | ||
| 235 | + * | ||
| 236 | + * @param bool $useIncludePath | ||
| 237 | + */ | ||
| 238 | + public function setUseIncludePath($useIncludePath) | ||
| 239 | + { | ||
| 240 | + $this->useIncludePath = $useIncludePath; | ||
| 241 | + } | ||
| 242 | + | ||
| 243 | + /** | ||
| 244 | + * Can be used to check if the autoloader uses the include path to check | ||
| 245 | + * for classes. | ||
| 246 | + * | ||
| 247 | + * @return bool | ||
| 248 | + */ | ||
| 249 | + public function getUseIncludePath() | ||
| 250 | + { | ||
| 251 | + return $this->useIncludePath; | ||
| 252 | + } | ||
| 253 | + | ||
| 254 | + /** | ||
| 255 | + * Turns off searching the prefix and fallback directories for classes | ||
| 256 | + * that have not been registered with the class map. | ||
| 257 | + * | ||
| 258 | + * @param bool $classMapAuthoritative | ||
| 259 | + */ | ||
| 260 | + public function setClassMapAuthoritative($classMapAuthoritative) | ||
| 261 | + { | ||
| 262 | + $this->classMapAuthoritative = $classMapAuthoritative; | ||
| 263 | + } | ||
| 264 | + | ||
| 265 | + /** | ||
| 266 | + * Should class lookup fail if not found in the current class map? | ||
| 267 | + * | ||
| 268 | + * @return bool | ||
| 269 | + */ | ||
| 270 | + public function isClassMapAuthoritative() | ||
| 271 | + { | ||
| 272 | + return $this->classMapAuthoritative; | ||
| 273 | + } | ||
| 274 | + | ||
| 275 | + /** | ||
| 276 | + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. | ||
| 277 | + * | ||
| 278 | + * @param string|null $apcuPrefix | ||
| 279 | + */ | ||
| 280 | + public function setApcuPrefix($apcuPrefix) | ||
| 281 | + { | ||
| 282 | + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; | ||
| 283 | + } | ||
| 284 | + | ||
| 285 | + /** | ||
| 286 | + * The APCu prefix in use, or null if APCu caching is not enabled. | ||
| 287 | + * | ||
| 288 | + * @return string|null | ||
| 289 | + */ | ||
| 290 | + public function getApcuPrefix() | ||
| 291 | + { | ||
| 292 | + return $this->apcuPrefix; | ||
| 293 | + } | ||
| 294 | + | ||
| 295 | + /** | ||
| 296 | + * Registers this instance as an autoloader. | ||
| 297 | + * | ||
| 298 | + * @param bool $prepend Whether to prepend the autoloader or not | ||
| 299 | + */ | ||
| 300 | + public function register($prepend = false) | ||
| 301 | + { | ||
| 302 | + spl_autoload_register(array($this, 'loadClass'), true, $prepend); | ||
| 303 | + } | ||
| 304 | + | ||
| 305 | + /** | ||
| 306 | + * Unregisters this instance as an autoloader. | ||
| 307 | + */ | ||
| 308 | + public function unregister() | ||
| 309 | + { | ||
| 310 | + spl_autoload_unregister(array($this, 'loadClass')); | ||
| 311 | + } | ||
| 312 | + | ||
| 313 | + /** | ||
| 314 | + * Loads the given class or interface. | ||
| 315 | + * | ||
| 316 | + * @param string $class The name of the class | ||
| 317 | + * @return bool|null True if loaded, null otherwise | ||
| 318 | + */ | ||
| 319 | + public function loadClass($class) | ||
| 320 | + { | ||
| 321 | + if ($file = $this->findFile($class)) { | ||
| 322 | + includeFile($file); | ||
| 323 | + | ||
| 324 | + return true; | ||
| 325 | + } | ||
| 326 | + } | ||
| 327 | + | ||
| 328 | + /** | ||
| 329 | + * Finds the path to the file where the class is defined. | ||
| 330 | + * | ||
| 331 | + * @param string $class The name of the class | ||
| 332 | + * | ||
| 333 | + * @return string|false The path if found, false otherwise | ||
| 334 | + */ | ||
| 335 | + public function findFile($class) | ||
| 336 | + { | ||
| 337 | + // class map lookup | ||
| 338 | + if (isset($this->classMap[$class])) { | ||
| 339 | + return $this->classMap[$class]; | ||
| 340 | + } | ||
| 341 | + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { | ||
| 342 | + return false; | ||
| 343 | + } | ||
| 344 | + if (null !== $this->apcuPrefix) { | ||
| 345 | + $file = apcu_fetch($this->apcuPrefix.$class, $hit); | ||
| 346 | + if ($hit) { | ||
| 347 | + return $file; | ||
| 348 | + } | ||
| 349 | + } | ||
| 350 | + | ||
| 351 | + $file = $this->findFileWithExtension($class, '.php'); | ||
| 352 | + | ||
| 353 | + // Search for Hack files if we are running on HHVM | ||
| 354 | + if (false === $file && defined('HHVM_VERSION')) { | ||
| 355 | + $file = $this->findFileWithExtension($class, '.hh'); | ||
| 356 | + } | ||
| 357 | + | ||
| 358 | + if (null !== $this->apcuPrefix) { | ||
| 359 | + apcu_add($this->apcuPrefix.$class, $file); | ||
| 360 | + } | ||
| 361 | + | ||
| 362 | + if (false === $file) { | ||
| 363 | + // Remember that this class does not exist. | ||
| 364 | + $this->missingClasses[$class] = true; | ||
| 365 | + } | ||
| 366 | + | ||
| 367 | + return $file; | ||
| 368 | + } | ||
| 369 | + | ||
| 370 | + private function findFileWithExtension($class, $ext) | ||
| 371 | + { | ||
| 372 | + // PSR-4 lookup | ||
| 373 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; | ||
| 374 | + | ||
| 375 | + $first = $class[0]; | ||
| 376 | + if (isset($this->prefixLengthsPsr4[$first])) { | ||
| 377 | + $subPath = $class; | ||
| 378 | + while (false !== $lastPos = strrpos($subPath, '\\')) { | ||
| 379 | + $subPath = substr($subPath, 0, $lastPos); | ||
| 380 | + $search = $subPath . '\\'; | ||
| 381 | + if (isset($this->prefixDirsPsr4[$search])) { | ||
| 382 | + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); | ||
| 383 | + foreach ($this->prefixDirsPsr4[$search] as $dir) { | ||
| 384 | + if (file_exists($file = $dir . $pathEnd)) { | ||
| 385 | + return $file; | ||
| 386 | + } | ||
| 387 | + } | ||
| 388 | + } | ||
| 389 | + } | ||
| 390 | + } | ||
| 391 | + | ||
| 392 | + // PSR-4 fallback dirs | ||
| 393 | + foreach ($this->fallbackDirsPsr4 as $dir) { | ||
| 394 | + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { | ||
| 395 | + return $file; | ||
| 396 | + } | ||
| 397 | + } | ||
| 398 | + | ||
| 399 | + // PSR-0 lookup | ||
| 400 | + if (false !== $pos = strrpos($class, '\\')) { | ||
| 401 | + // namespaced class name | ||
| 402 | + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) | ||
| 403 | + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); | ||
| 404 | + } else { | ||
| 405 | + // PEAR-like class name | ||
| 406 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; | ||
| 407 | + } | ||
| 408 | + | ||
| 409 | + if (isset($this->prefixesPsr0[$first])) { | ||
| 410 | + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { | ||
| 411 | + if (0 === strpos($class, $prefix)) { | ||
| 412 | + foreach ($dirs as $dir) { | ||
| 413 | + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { | ||
| 414 | + return $file; | ||
| 415 | + } | ||
| 416 | + } | ||
| 417 | + } | ||
| 418 | + } | ||
| 419 | + } | ||
| 420 | + | ||
| 421 | + // PSR-0 fallback dirs | ||
| 422 | + foreach ($this->fallbackDirsPsr0 as $dir) { | ||
| 423 | + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { | ||
| 424 | + return $file; | ||
| 425 | + } | ||
| 426 | + } | ||
| 427 | + | ||
| 428 | + // PSR-0 include paths. | ||
| 429 | + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { | ||
| 430 | + return $file; | ||
| 431 | + } | ||
| 432 | + | ||
| 433 | + return false; | ||
| 434 | + } | ||
| 435 | +} | ||
| 436 | + | ||
| 437 | +/** | ||
| 438 | + * Scope isolated include. | ||
| 439 | + * | ||
| 440 | + * Prevents access to $this/self from included files. | ||
| 441 | + */ | ||
| 442 | +function includeFile($file) | ||
| 443 | +{ | ||
| 444 | + include $file; | ||
| 445 | +} |
admin/extend/vendor/composer/LICENSE
0 → 100755
| 1 | + | ||
| 2 | +Copyright (c) Nils Adermann, Jordi Boggiano | ||
| 3 | + | ||
| 4 | +Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 5 | +of this software and associated documentation files (the "Software"), to deal | ||
| 6 | +in the Software without restriction, including without limitation the rights | ||
| 7 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 8 | +copies of the Software, and to permit persons to whom the Software is furnished | ||
| 9 | +to do so, subject to the following conditions: | ||
| 10 | + | ||
| 11 | +The above copyright notice and this permission notice shall be included in all | ||
| 12 | +copies or substantial portions of the Software. | ||
| 13 | + | ||
| 14 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 15 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 16 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 17 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 18 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 19 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| 20 | +THE SOFTWARE. | ||
| 21 | + |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +// autoload_real.php @generated by Composer | ||
| 4 | + | ||
| 5 | +class ComposerAutoloaderInit8a18182e993b8fc59e4294f066645c30 | ||
| 6 | +{ | ||
| 7 | + private static $loader; | ||
| 8 | + | ||
| 9 | + public static function loadClassLoader($class) | ||
| 10 | + { | ||
| 11 | + if ('Composer\Autoload\ClassLoader' === $class) { | ||
| 12 | + require __DIR__ . '/ClassLoader.php'; | ||
| 13 | + } | ||
| 14 | + } | ||
| 15 | + | ||
| 16 | + /** | ||
| 17 | + * @return \Composer\Autoload\ClassLoader | ||
| 18 | + */ | ||
| 19 | + public static function getLoader() | ||
| 20 | + { | ||
| 21 | + if (null !== self::$loader) { | ||
| 22 | + return self::$loader; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + spl_autoload_register(array('ComposerAutoloaderInit8a18182e993b8fc59e4294f066645c30', 'loadClassLoader'), true, true); | ||
| 26 | + self::$loader = $loader = new \Composer\Autoload\ClassLoader(); | ||
| 27 | + spl_autoload_unregister(array('ComposerAutoloaderInit8a18182e993b8fc59e4294f066645c30', 'loadClassLoader')); | ||
| 28 | + | ||
| 29 | + $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); | ||
| 30 | + if ($useStaticLoader) { | ||
| 31 | + require_once __DIR__ . '/autoload_static.php'; | ||
| 32 | + | ||
| 33 | + call_user_func(\Composer\Autoload\ComposerStaticInit8a18182e993b8fc59e4294f066645c30::getInitializer($loader)); | ||
| 34 | + } else { | ||
| 35 | + $map = require __DIR__ . '/autoload_namespaces.php'; | ||
| 36 | + foreach ($map as $namespace => $path) { | ||
| 37 | + $loader->set($namespace, $path); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + $map = require __DIR__ . '/autoload_psr4.php'; | ||
| 41 | + foreach ($map as $namespace => $path) { | ||
| 42 | + $loader->setPsr4($namespace, $path); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + $classMap = require __DIR__ . '/autoload_classmap.php'; | ||
| 46 | + if ($classMap) { | ||
| 47 | + $loader->addClassMap($classMap); | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + $loader->register(true); | ||
| 52 | + | ||
| 53 | + if ($useStaticLoader) { | ||
| 54 | + $includeFiles = Composer\Autoload\ComposerStaticInit8a18182e993b8fc59e4294f066645c30::$files; | ||
| 55 | + } else { | ||
| 56 | + $includeFiles = require __DIR__ . '/autoload_files.php'; | ||
| 57 | + } | ||
| 58 | + foreach ($includeFiles as $fileIdentifier => $file) { | ||
| 59 | + composerRequire8a18182e993b8fc59e4294f066645c30($fileIdentifier, $file); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + return $loader; | ||
| 63 | + } | ||
| 64 | +} | ||
| 65 | + | ||
| 66 | +function composerRequire8a18182e993b8fc59e4294f066645c30($fileIdentifier, $file) | ||
| 67 | +{ | ||
| 68 | + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { | ||
| 69 | + require $file; | ||
| 70 | + | ||
| 71 | + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; | ||
| 72 | + } | ||
| 73 | +} |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +// autoload_static.php @generated by Composer | ||
| 4 | + | ||
| 5 | +namespace Composer\Autoload; | ||
| 6 | + | ||
| 7 | +class ComposerStaticInit8a18182e993b8fc59e4294f066645c30 | ||
| 8 | +{ | ||
| 9 | + public static $files = array ( | ||
| 10 | + '841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php', | ||
| 11 | + ); | ||
| 12 | + | ||
| 13 | + public static $prefixLengthsPsr4 = array ( | ||
| 14 | + 'Q' => | ||
| 15 | + array ( | ||
| 16 | + 'Qiniu\\' => 6, | ||
| 17 | + ), | ||
| 18 | + ); | ||
| 19 | + | ||
| 20 | + public static $prefixDirsPsr4 = array ( | ||
| 21 | + 'Qiniu\\' => | ||
| 22 | + array ( | ||
| 23 | + 0 => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu', | ||
| 24 | + ), | ||
| 25 | + ); | ||
| 26 | + | ||
| 27 | + public static function getInitializer(ClassLoader $loader) | ||
| 28 | + { | ||
| 29 | + return \Closure::bind(function () use ($loader) { | ||
| 30 | + $loader->prefixLengthsPsr4 = ComposerStaticInit8a18182e993b8fc59e4294f066645c30::$prefixLengthsPsr4; | ||
| 31 | + $loader->prefixDirsPsr4 = ComposerStaticInit8a18182e993b8fc59e4294f066645c30::$prefixDirsPsr4; | ||
| 32 | + | ||
| 33 | + }, null, ClassLoader::class); | ||
| 34 | + } | ||
| 35 | +} |
admin/extend/vendor/composer/installed.json
0 → 100755
| 1 | +[ | ||
| 2 | + { | ||
| 3 | + "name": "qiniu/php-sdk", | ||
| 4 | + "version": "v7.2.10", | ||
| 5 | + "version_normalized": "7.2.10.0", | ||
| 6 | + "source": { | ||
| 7 | + "type": "git", | ||
| 8 | + "url": "https://github.com/qiniu/php-sdk.git", | ||
| 9 | + "reference": "d89987163f560ebf9dfa5bb25de9bd9b1a3b2bd8" | ||
| 10 | + }, | ||
| 11 | + "dist": { | ||
| 12 | + "type": "zip", | ||
| 13 | + "url": "https://api.github.com/repos/qiniu/php-sdk/zipball/d89987163f560ebf9dfa5bb25de9bd9b1a3b2bd8", | ||
| 14 | + "reference": "d89987163f560ebf9dfa5bb25de9bd9b1a3b2bd8", | ||
| 15 | + "shasum": "", | ||
| 16 | + "mirrors": [ | ||
| 17 | + { | ||
| 18 | + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", | ||
| 19 | + "preferred": true | ||
| 20 | + } | ||
| 21 | + ] | ||
| 22 | + }, | ||
| 23 | + "require": { | ||
| 24 | + "php": ">=5.3.3" | ||
| 25 | + }, | ||
| 26 | + "require-dev": { | ||
| 27 | + "phpunit/phpunit": "~4.0", | ||
| 28 | + "squizlabs/php_codesniffer": "~2.3" | ||
| 29 | + }, | ||
| 30 | + "time": "2019-10-28T10:23:23+00:00", | ||
| 31 | + "type": "library", | ||
| 32 | + "installation-source": "dist", | ||
| 33 | + "autoload": { | ||
| 34 | + "psr-4": { | ||
| 35 | + "Qiniu\\": "src/Qiniu" | ||
| 36 | + }, | ||
| 37 | + "files": [ | ||
| 38 | + "src/Qiniu/functions.php" | ||
| 39 | + ] | ||
| 40 | + }, | ||
| 41 | + "notification-url": "https://packagist.org/downloads/", | ||
| 42 | + "license": [ | ||
| 43 | + "MIT" | ||
| 44 | + ], | ||
| 45 | + "authors": [ | ||
| 46 | + { | ||
| 47 | + "name": "Qiniu", | ||
| 48 | + "email": "sdk@qiniu.com", | ||
| 49 | + "homepage": "http://www.qiniu.com" | ||
| 50 | + } | ||
| 51 | + ], | ||
| 52 | + "description": "Qiniu Resource (Cloud) Storage SDK for PHP", | ||
| 53 | + "homepage": "http://developer.qiniu.com/", | ||
| 54 | + "keywords": [ | ||
| 55 | + "cloud", | ||
| 56 | + "qiniu", | ||
| 57 | + "sdk", | ||
| 58 | + "storage" | ||
| 59 | + ] | ||
| 60 | + } | ||
| 61 | +] |
| 1 | +# Changelog | ||
| 2 | + | ||
| 3 | +## 7.2.7 (2018-11-06) | ||
| 4 | +* 添加 QVM 内网上传到 KODO 的 zone 设置 | ||
| 5 | + | ||
| 6 | +## 7.2.6 (2018-05-18) | ||
| 7 | +* 修复rs,rsf在不同机房默认的https域名 | ||
| 8 | + | ||
| 9 | +## 7.2.5 (2018-05-10) | ||
| 10 | +* 修复表单上传中多余的参数checkCrc导致的fname错位问题 | ||
| 11 | + | ||
| 12 | +## 7.2.4 (2018-05-09) | ||
| 13 | +### 增加 | ||
| 14 | +* 连麦功能 | ||
| 15 | + | ||
| 16 | +## 7.2.3 (2018-01-20) | ||
| 17 | +### 增加 | ||
| 18 | +* 新加坡机房 | ||
| 19 | +### 修正 | ||
| 20 | +* 获取域名的入口域名 | ||
| 21 | +* http回复头部兼容大小写 | ||
| 22 | + | ||
| 23 | +## 7.2.2 (2017-11-06) | ||
| 24 | +### 增加 | ||
| 25 | +* Qiniu算法的鉴权方法 | ||
| 26 | + | ||
| 27 | +## 7.1.4 (2017-06-21) | ||
| 28 | +### 增加 | ||
| 29 | +* cdn 文件/目录 刷新 | ||
| 30 | +* cdn 获取 流量/带宽 | ||
| 31 | +* cdn 获取域名的访问日志列表 | ||
| 32 | +* cdn 对资源链接进行时间戳防盗链签名 | ||
| 33 | + | ||
| 34 | +## 7.1.3 (2016-11-18) | ||
| 35 | +### 增加 | ||
| 36 | +* move, copy操作增加force参数 | ||
| 37 | + | ||
| 38 | +## 7.1.2 (2016-11-12) | ||
| 39 | +### 修正 | ||
| 40 | +* 明确抛出获取各区域域名失败时的报错 | ||
| 41 | + | ||
| 42 | +## 7.1.1 (2016-11-02) | ||
| 43 | +### 修正 | ||
| 44 | +* 多区域配置文件存储目录从home修改到tmp目录 | ||
| 45 | + | ||
| 46 | + | ||
| 47 | +## 7.1.0 (2016-10-22) | ||
| 48 | +### 增加 | ||
| 49 | +* 多存储区域的支持 | ||
| 50 | + | ||
| 51 | +## 7.0.8 (2016-07-19) | ||
| 52 | +### 增加 | ||
| 53 | +* demo | ||
| 54 | +* https url 支持 | ||
| 55 | +* deleteAfterDays 策略 | ||
| 56 | +* 添加图片处理链接统一拼接方法 by @SherlockRen | ||
| 57 | + | ||
| 58 | +## 7.0.7 (2016-01-12) | ||
| 59 | +### 修正 | ||
| 60 | +* PersistentFop参数pipeline和notify_url失效 | ||
| 61 | +* resume 模式 close file inputstream | ||
| 62 | + | ||
| 63 | +## 7.0.6 (2015-12-05) | ||
| 64 | +### 修正 | ||
| 65 | +* php7.0 Json 对空字符串解析单元测试报错 | ||
| 66 | +* 开启安全模式或者设置可操作目录树时,设置CURLOPT_FOLLOWLOCATION报错, by @twocabbages | ||
| 67 | +* fetch 支持不指定key, by @sinkcup | ||
| 68 | + | ||
| 69 | +## 7.0.5 (2015-10-29) | ||
| 70 | +### 增加 | ||
| 71 | +* 增加上传策略最小文件大小限制 fsizeMin | ||
| 72 | +* 增加常见examples | ||
| 73 | + | ||
| 74 | +## 7.0.4 (2015-07-23) | ||
| 75 | +### 修正 | ||
| 76 | +* 一些地方的严格比较检查 | ||
| 77 | +* resumeupload 备用地址失效 | ||
| 78 | + | ||
| 79 | +## 7.0.3 (2015-07-10) | ||
| 80 | +### 修改 | ||
| 81 | +* 多zone 支持 | ||
| 82 | + | ||
| 83 | +## 7.0.2 (2015-04-18) | ||
| 84 | +### 修改 | ||
| 85 | +* fetch 接口返回内容调整 | ||
| 86 | +* pfop 接口调整 | ||
| 87 | + | ||
| 88 | +###修正 | ||
| 89 | +* exception 类调用 | ||
| 90 | + | ||
| 91 | +## 7.0.1 (2015-03-27) | ||
| 92 | +### 增加 | ||
| 93 | +* 增加代码注释 | ||
| 94 | + | ||
| 95 | +## 7.0.0 (2015-02-03) | ||
| 96 | + | ||
| 97 | +### 增加 | ||
| 98 | +* 简化上传接口 | ||
| 99 | +* 自动选择断点续上传还是直传 | ||
| 100 | +* 重构代码,接口和内部结构更清晰 | ||
| 101 | +* 改变mime | ||
| 102 | +* 代码覆盖度报告 | ||
| 103 | +* policy改为array, 便于灵活增加,并加入过期字段检查 | ||
| 104 | +* 文件列表支持目录形式 | ||
| 105 | +* 利用元编程方式支持 fop 和 pfop |
| 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 | +``` |
admin/extend/vendor/qiniu/php-sdk/LICENSE
0 → 100755
| 1 | +The MIT License (MIT) | ||
| 2 | + | ||
| 3 | +Copyright (c) 2014 Qiniu, Ltd.<sdk@qiniu.com> | ||
| 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 | + |
admin/extend/vendor/qiniu/php-sdk/README.md
0 → 100755
| 1 | +# Qiniu Cloud 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 |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +function classLoader($class) | ||
| 4 | +{ | ||
| 5 | + $path = str_replace('\\', DIRECTORY_SEPARATOR, $class); | ||
| 6 | + $file = __DIR__ . '/src/' . $path . '.php'; | ||
| 7 | + | ||
| 8 | + if (file_exists($file)) { | ||
| 9 | + require_once $file; | ||
| 10 | + } | ||
| 11 | +} | ||
| 12 | +spl_autoload_register('classLoader'); | ||
| 13 | + | ||
| 14 | +require_once __DIR__ . '/src/Qiniu/functions.php'; |
| 1 | +{ | ||
| 2 | + "name": "qiniu/php-sdk", | ||
| 3 | + "type": "library", | ||
| 4 | + "description": "Qiniu Resource (Cloud) Storage SDK for PHP", | ||
| 5 | + "keywords": ["qiniu", "storage", "sdk", "cloud"], | ||
| 6 | + "homepage": "http://developer.qiniu.com/", | ||
| 7 | + "license": "MIT", | ||
| 8 | + "authors": [ | ||
| 9 | + { | ||
| 10 | + "name": "Qiniu", | ||
| 11 | + "email": "sdk@qiniu.com", | ||
| 12 | + "homepage": "http://www.qiniu.com" | ||
| 13 | + } | ||
| 14 | + ], | ||
| 15 | + "require": { | ||
| 16 | + "php": ">=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 | +} |
| 1 | +# Rtc Streaming Cloud Server-Side Library For PHP | ||
| 2 | + | ||
| 3 | +## Features | ||
| 4 | + | ||
| 5 | +- Appclient | ||
| 6 | + - [x] 创建房间: client->createApp() | ||
| 7 | + - [x] 查看房间: client->getApp() | ||
| 8 | + - [x] 删除房间: client->deleteApp() | ||
| 9 | + - [x] 生成房间token: client->appToken() | ||
| 10 | + | ||
| 11 | + | ||
| 12 | + | ||
| 13 | +## Contents | ||
| 14 | + | ||
| 15 | +- [Installation](#installation) | ||
| 16 | +- [Usage](#usage) | ||
| 17 | + - [Configuration](#configuration) | ||
| 18 | + - [App](#app) | ||
| 19 | + - [Create a app](#create-a-app) | ||
| 20 | + - [Get a app](#get-a-app) | ||
| 21 | + - [Delete a app](#delete-a-app) | ||
| 22 | + - [Generate a app token](#generate-a-app-token) | ||
| 23 | + | ||
| 24 | + | ||
| 25 | +## Usage | ||
| 26 | + | ||
| 27 | +### App | ||
| 28 | + | ||
| 29 | +#### Create a app | ||
| 30 | + | ||
| 31 | +```php | ||
| 32 | +$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; | ||
| 33 | +$sk = "xxxx"; | ||
| 34 | +$auth = new Auth($ak, $sk); | ||
| 35 | +$client = new Qiniu\Rtc\AppClient($auth); | ||
| 36 | +$resp=$client->createApp("901","testApp"); | ||
| 37 | +print_r($resp); | ||
| 38 | +``` | ||
| 39 | + | ||
| 40 | +#### Get an app | ||
| 41 | + | ||
| 42 | +```php | ||
| 43 | +$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; | ||
| 44 | +$sk = "xxxx"; | ||
| 45 | +$auth = new Auth($ak, $sk); | ||
| 46 | +$client = new Qiniu\Rtc\AppClient($auth); | ||
| 47 | +$resp=$client->getApp("deq02uhb6"); | ||
| 48 | +print_r($resp); | ||
| 49 | +``` | ||
| 50 | + | ||
| 51 | +#### Delete an app | ||
| 52 | + | ||
| 53 | +```php | ||
| 54 | +$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; | ||
| 55 | +$sk = "xxxx"; | ||
| 56 | +$auth = new Auth($ak, $sk); | ||
| 57 | +$client = new Qiniu\Rtc\AppClient($auth); | ||
| 58 | +$resp=$client->deleteApp("deq02uhb6"); | ||
| 59 | +print_r($resp); | ||
| 60 | +``` | ||
| 61 | + | ||
| 62 | +#### Generate an app token | ||
| 63 | + | ||
| 64 | +```php | ||
| 65 | +$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; | ||
| 66 | +$sk = "xxxx"; | ||
| 67 | +$auth = new Auth($ak, $sk); | ||
| 68 | +$client = new Qiniu\Rtc\AppClient($auth); | ||
| 69 | +$resp=$client->appToken("deq02uhb6", "lfx", '1111', (time()+3600), 'user'); | ||
| 70 | +print_r($resp); | ||
| 71 | +``` |
| 1 | +<?php | ||
| 2 | +require_once("../../autoload.php"); | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$ak = 'gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5'; | ||
| 7 | +$sk = 'xxxx'; | ||
| 8 | + | ||
| 9 | +$auth = new Auth($ak, $sk); | ||
| 10 | +$client = new Qiniu\Rtc\AppClient($auth); | ||
| 11 | +$hub = 'lfxlive'; | ||
| 12 | +$title = 'lfxl'; | ||
| 13 | +try { | ||
| 14 | + //创建app | ||
| 15 | + $resp = $client->createApp($hub, $title, $maxUsers); | ||
| 16 | + print_r($resp); | ||
| 17 | + // 获取app状态 | ||
| 18 | + $resp = $client->getApp('dgdl5ge8y'); | ||
| 19 | + print_r($resp); | ||
| 20 | + //修改app状态 | ||
| 21 | + $mergePublishRtmp = null; | ||
| 22 | + $mergePublishRtmp['enable'] = true; | ||
| 23 | + $resp = $client->updateApp('dgdl5ge8y', $hub, $title, $maxUsers, $mergePublishRtmp); | ||
| 24 | + print_r($resp); | ||
| 25 | + //删除app | ||
| 26 | + $resp = $client->deleteApp('dgdl5ge8y'); | ||
| 27 | + print_r($resp); | ||
| 28 | + //获取房间连麦的成员 | ||
| 29 | + $resp=$client->listUser("dgbfvvzid", 'lfxl'); | ||
| 30 | + print_r($resp); | ||
| 31 | + //剔除房间的连麦成员 | ||
| 32 | + $resp=$client->kickUser("dgbfvvzid", 'lfx', "qiniu-f6e07b78-4dc8-45fb-a701-a9e158abb8e6"); | ||
| 33 | + print_r($resp); | ||
| 34 | + // 列举房间 | ||
| 35 | + $resp=$client->listActiveRooms("dgbfvvzid", 'lfx', null, null); | ||
| 36 | + print_r($resp); | ||
| 37 | + //鉴权的有效时间: 1个小时. | ||
| 38 | + $resp = $client->appToken("dgd4vecde", "lfxl", '1111', (time()+3600), 'user'); | ||
| 39 | + print_r($resp); | ||
| 40 | +} catch (\Exception $e) { | ||
| 41 | + echo "Error:", $e, "\n"; | ||
| 42 | +} |
| 1 | +<?php | ||
| 2 | +require_once("../../autoload.php"); | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$ak="xxxx"; | ||
| 7 | +$sk="xxxx"; | ||
| 8 | + | ||
| 9 | +$auth = new Auth($ak, $sk); | ||
| 10 | +$client = new Qiniu\Sms\Sms($auth); | ||
| 11 | + | ||
| 12 | +//发送信息模块 | ||
| 13 | +$template_id="1131792074274775040"; | ||
| 14 | +$mobiles=array("18011111111","18011111111"); | ||
| 15 | +$code = array('code' => 'code' ); | ||
| 16 | +try { | ||
| 17 | + //发送短信 | ||
| 18 | + $resp = $client->sendMessage($template_id, $mobiles, $code); | ||
| 19 | + print_r($resp); | ||
| 20 | +} catch (\Exception $e) { | ||
| 21 | + echo "Error:", $e, "\n"; | ||
| 22 | +}exit; | ||
| 23 | +//模板模块 | ||
| 24 | +$name="tstest001"; | ||
| 25 | +$template="tesy001 ${code}"; | ||
| 26 | +$type="notification"; | ||
| 27 | +$description="tstest001"; | ||
| 28 | +$signature_id="1131464448834277376"; | ||
| 29 | +$id="1131810682442883072"; | ||
| 30 | + | ||
| 31 | +try { | ||
| 32 | + //创建模板 | ||
| 33 | + $resp = $client->createTemplate($name, $template, $type, $description, $signature_id); | ||
| 34 | + print_r($resp); | ||
| 35 | + //查询模板 | ||
| 36 | + $resp = $client->queryTemplate(); | ||
| 37 | + print_r($resp); | ||
| 38 | + //修改模板 | ||
| 39 | + $resp = $client->updateTemplate($id, $name, $template, $description, $signature_id); | ||
| 40 | + print_r($resp); | ||
| 41 | + //删除模板 | ||
| 42 | + $resp = $client->deleteTemplate($id); | ||
| 43 | + print_r($resp); | ||
| 44 | +} catch (\Exception $e) { | ||
| 45 | + echo "Error:", $e, "\n"; | ||
| 46 | +} | ||
| 47 | +//签名模块 | ||
| 48 | +$signature = 'lfxlive2'; | ||
| 49 | +$source = 'enterprises_and_institutions'; | ||
| 50 | +$pic="/Users/Desktop/sss.jpg"; | ||
| 51 | +$audit_status="passed"; | ||
| 52 | +$page=1; | ||
| 53 | +$page_size=1; | ||
| 54 | +$id="1131464448834277376"; | ||
| 55 | + | ||
| 56 | +try { | ||
| 57 | + //创建签名 | ||
| 58 | + $resp = $client->createSignature($signature, $source, $pic); | ||
| 59 | + print_r($resp); | ||
| 60 | + //查询签名 | ||
| 61 | + $resp = $client->checkSignature($audit_status); | ||
| 62 | + //修改签名 | ||
| 63 | + $resp = $client->updateSignature($id, $signature, $source, $pic); | ||
| 64 | + print_r($resp); | ||
| 65 | + //删除ID | ||
| 66 | + $resp = $client->deleteSignature($id); | ||
| 67 | + print_r($resp); | ||
| 68 | +} catch (\Exception $e) { | ||
| 69 | + echo "Error:", $e, "\n"; | ||
| 70 | +} |
| 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 | + |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | +$name = 'demo'; | ||
| 15 | +$prefix = 'test'; | ||
| 16 | +$delete_after_days = 80; | ||
| 17 | +$to_line_after_days =70; | ||
| 18 | + | ||
| 19 | +list($Info, $err) = $bucketManager->bucketLifecycleRule( | ||
| 20 | + $bucket, | ||
| 21 | + $name, | ||
| 22 | + $prefix, | ||
| 23 | + $delete_after_days, | ||
| 24 | + $to_line_after_days | ||
| 25 | +); | ||
| 26 | +if ($err) { | ||
| 27 | + print_r($err); | ||
| 28 | +} else { | ||
| 29 | + print_r($Info); | ||
| 30 | +} |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +require_once __DIR__ . '/../autoload.php'; | ||
| 4 | + | ||
| 5 | +use \Qiniu\Cdn\CdnManager; | ||
| 6 | + | ||
| 7 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 8 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 9 | + | ||
| 10 | +$auth = new Qiniu\Auth($accessKey, $secretKey); | ||
| 11 | +$cdnManager = new CdnManager($auth); | ||
| 12 | + | ||
| 13 | +//获取流量和带宽数据 | ||
| 14 | +//参考文档:http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html | ||
| 15 | + | ||
| 16 | +$domains = array( | ||
| 17 | + "javasdk.qiniudn.com", | ||
| 18 | + "phpsdk.qiniudn.com" | ||
| 19 | +); | ||
| 20 | + | ||
| 21 | +$startDate = "2017-08-20"; | ||
| 22 | +$endDate = "2017-08-21"; | ||
| 23 | + | ||
| 24 | +//5min or hour or day | ||
| 25 | +$granularity = "day"; | ||
| 26 | + | ||
| 27 | +//获取带宽数据 | ||
| 28 | +list($bandwidthData, $getBandwidthErr) = $cdnManager->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 | +} |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +require_once __DIR__ . '/../autoload.php'; | ||
| 4 | + | ||
| 5 | +use \Qiniu\Cdn\CdnManager; | ||
| 6 | + | ||
| 7 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 8 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 9 | + | ||
| 10 | +$auth = new Qiniu\Auth($accessKey, $secretKey); | ||
| 11 | +$cdnManager = new CdnManager($auth); | ||
| 12 | + | ||
| 13 | +//获取流量和带宽数据 | ||
| 14 | +//参考文档:http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html | ||
| 15 | + | ||
| 16 | +$domains = array( | ||
| 17 | + "javasdk.qiniudn.com", | ||
| 18 | + "phpsdk.qiniudn.com" | ||
| 19 | +); | ||
| 20 | + | ||
| 21 | +$startDate = "2017-08-20"; | ||
| 22 | +$endDate = "2017-08-21"; | ||
| 23 | + | ||
| 24 | +//5min or hour or day | ||
| 25 | +$granularity = "day"; | ||
| 26 | + | ||
| 27 | +//获取流量数据 | ||
| 28 | +list($fluxData, $getFluxErr) = $cdnManager->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 | +} |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +require_once __DIR__ . '/../autoload.php'; | ||
| 4 | + | ||
| 5 | +use \Qiniu\Cdn\CdnManager; | ||
| 6 | + | ||
| 7 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 8 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 9 | + | ||
| 10 | +$auth = new Qiniu\Auth($accessKey, $secretKey); | ||
| 11 | +$cdnManager = new CdnManager($auth); | ||
| 12 | + | ||
| 13 | +$domains = array( | ||
| 14 | + "javasdk.qiniudn.com", | ||
| 15 | + "phpsdk.qiniudn.com" | ||
| 16 | +); | ||
| 17 | + | ||
| 18 | +$logDate = '2017-08-20'; | ||
| 19 | + | ||
| 20 | +//获取日志下载链接 | ||
| 21 | +//参考文档:http://developer.qiniu.com/article/fusion/api/log.html | ||
| 22 | + | ||
| 23 | +list($logListData, $getLogErr) = $cdnManager->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 | +} |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +require_once __DIR__ . '/../autoload.php'; | ||
| 4 | + | ||
| 5 | +use \Qiniu\Cdn\CdnManager; | ||
| 6 | + | ||
| 7 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 8 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 9 | + | ||
| 10 | +$auth = new Qiniu\Auth($accessKey, $secretKey); | ||
| 11 | + | ||
| 12 | +//待刷新的文件列表和目录,文件列表最多一次100个,目录最多一次10个 | ||
| 13 | +//参考文档:http://developer.qiniu.com/article/fusion/api/refresh.html | ||
| 14 | +$urls = array( | ||
| 15 | + "http://phpsdk.qiniudn.com/qiniu.jpg", | ||
| 16 | + "http://phpsdk.qiniudn.com/qiniu2.jpg", | ||
| 17 | +); | ||
| 18 | + | ||
| 19 | +//刷新目录需要联系七牛技术支持开通账户权限 | ||
| 20 | +$dirs = array( | ||
| 21 | + "http://phpsdk.qiniudn.com/test/" | ||
| 22 | +); | ||
| 23 | + | ||
| 24 | +$cdnManager = new CdnManager($auth); | ||
| 25 | + | ||
| 26 | +// 目前客户默认没有目录刷新权限,刷新会有400038报错,参考:https://developer.qiniu.com/fusion/api/1229/cache-refresh | ||
| 27 | +// 需要刷新目录请工单联系技术支持 https://support.qiniu.com/tickets/category | ||
| 28 | +list($refreshResult, $refreshErr) = $cdnManager->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 | +} |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +require_once __DIR__ . '/../autoload.php'; | ||
| 4 | + | ||
| 5 | +use \Qiniu\Cdn\CdnManager; | ||
| 6 | + | ||
| 7 | +//创建时间戳防盗链 | ||
| 8 | +//时间戳防盗链密钥,后台获取 | ||
| 9 | +$encryptKey = 'your_domain_timestamp_antileech_encryptkey'; | ||
| 10 | + | ||
| 11 | +//带访问协议的域名 | ||
| 12 | +$url1 = 'http://phpsdk.qiniuts.com/24.jpg?avinfo'; | ||
| 13 | +$url2 = 'http://phpsdk.qiniuts.com/24.jpg'; | ||
| 14 | + | ||
| 15 | +//有效期时间(单位秒) | ||
| 16 | +$durationInSeconds = 3600; | ||
| 17 | + | ||
| 18 | +$signedUrl = CdnManager::createTimestampAntiLeechUrl($url1, $encryptKey, $durationInSeconds); | ||
| 19 | +print($signedUrl); |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$name = 'xxxx'; | ||
| 14 | + | ||
| 15 | +list($Info, $err) = $bucketManager->deleteBucket($name); | ||
| 16 | +if ($err) { | ||
| 17 | + print_r($err); | ||
| 18 | +} else { | ||
| 19 | + print_r($Info); | ||
| 20 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | +$name = 'demo'; | ||
| 15 | + | ||
| 16 | +list($Info, $err) = $bucketManager->deleteBucketEvent($bucket, $name); | ||
| 17 | +if ($err) { | ||
| 18 | + print_r($err); | ||
| 19 | +} else { | ||
| 20 | + print_r($Info); | ||
| 21 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | +$name = 'demo'; | ||
| 15 | + | ||
| 16 | +list($Info, $err) = $bucketManager->deleteBucketLifecycleRule($bucket, $name); | ||
| 17 | +if ($err) { | ||
| 18 | + print_r($err); | ||
| 19 | +} else { | ||
| 20 | + print_r($Info); | ||
| 21 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | + | ||
| 15 | +list($Info, $err) = $bucketManager->getBucketEvents($bucket); | ||
| 16 | +if ($err) { | ||
| 17 | + print_r($err); | ||
| 18 | +} else { | ||
| 19 | + print_r($Info); | ||
| 20 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | + | ||
| 15 | +list($Info, $err) = $bucketManager->getBucketLifecycleRules($bucket); | ||
| 16 | +if ($err) { | ||
| 17 | + print_r($err); | ||
| 18 | +} else { | ||
| 19 | + print_r($Info); | ||
| 20 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$region = 'z1'; | ||
| 14 | + | ||
| 15 | +list($Info, $err) = $bucketManager->listbuckets($region); | ||
| 16 | +if ($err) { | ||
| 17 | + print_r($err); | ||
| 18 | +} else { | ||
| 19 | + print_r($Info); | ||
| 20 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | + | ||
| 15 | +list($Info, $err) = $bucketManager->getBucketQuota($bucket); | ||
| 16 | +if ($err) { | ||
| 17 | + print_r($err); | ||
| 18 | +} else { | ||
| 19 | + print_r($Info); | ||
| 20 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | + | ||
| 15 | +list($Info, $err) = $bucketManager->bucketInfo($bucket); | ||
| 16 | +if ($err) { | ||
| 17 | + print_r($err); | ||
| 18 | +} else { | ||
| 19 | + print_r($Info); | ||
| 20 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$region = 'z1'; | ||
| 14 | + | ||
| 15 | +list($Info, $err) = $bucketManager->bucketInfos($region); | ||
| 16 | +if ($err) { | ||
| 17 | + print_r($err); | ||
| 18 | +} else { | ||
| 19 | + print_r($Info); | ||
| 20 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | + | ||
| 15 | +list($Info, $err) = $bucketManager->getCorsRules($bucket); | ||
| 16 | +if ($err) { | ||
| 17 | + print_r($err); | ||
| 18 | +} else { | ||
| 19 | + print_r($Info); | ||
| 20 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +// 引入图片处理类 | ||
| 5 | +use Qiniu\Processing\ImageUrlBuilder; | ||
| 6 | + | ||
| 7 | +$imageUrlBuilder = new ImageUrlBuilder(); | ||
| 8 | + | ||
| 9 | +// 要处理图片 | ||
| 10 | +$url = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg'; | ||
| 11 | +$url2 = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg?watermark/1/gravity/SouthEast/dx/0/dy/0/image/' | ||
| 12 | + . 'aHR0cDovL2Fkcy1jZG4uY2h1Y2h1amllLmNvbS9Ga1R6bnpIY2RLdmRBUFc5cHZZZ3pTc21UY0tB'; | ||
| 13 | +$waterImage = 'http://developer.qiniu.com/resource/logo-2.jpg'; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 缩略图链接拼接 | ||
| 17 | + * | ||
| 18 | + * @param string $url 图片链接 | ||
| 19 | + * @param int $mode 缩略模式 | ||
| 20 | + * @param int $width 宽度 | ||
| 21 | + * @param int $height 长度 | ||
| 22 | + * @param string $format 输出类型 [可选] | ||
| 23 | + * @param int $quality 图片质量 [可选] | ||
| 24 | + * @param int $interlace 是否支持渐进显示 [可选] | ||
| 25 | + * @param int $ignoreError 忽略结果 [可选] | ||
| 26 | + * @return string | ||
| 27 | + * @link http://developer.qiniu.com/code/v6/api/kodo-api/image/imageview2.html | ||
| 28 | + * @author Sherlock Ren <sherlock_ren@icloud.com> | ||
| 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 <sherlock_ren@icloud.com> | ||
| 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 <sherlock_ren@icloud.com> | ||
| 70 | + */ | ||
| 71 | +$textLink = $imageUrlBuilder->waterText($url, '你瞅啥', '微软雅黑', 300); | ||
| 72 | +// 函数调用方法 | ||
| 73 | +// $textLink = \Qiniu\waterText($url, '你瞅啥', '微软雅黑', 300); | ||
| 74 | +var_dump($textLink); |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +require_once __DIR__ . '/../autoload.php'; | ||
| 4 | + | ||
| 5 | +use Qiniu\Auth; | ||
| 6 | +use Qiniu\Processing\PersistentFop; | ||
| 7 | + | ||
| 8 | +$accessKey = 'Access_Key'; | ||
| 9 | +$secretKey = 'Secret_Key'; | ||
| 10 | +$auth = new Auth($accessKey, $secretKey); | ||
| 11 | + | ||
| 12 | +// 要转码的文件所在的空间。 | ||
| 13 | +$bucket = 'Bucket_Name'; | ||
| 14 | + | ||
| 15 | +// 转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline | ||
| 16 | +$pipeline = 'pipeline_name'; | ||
| 17 | + | ||
| 18 | +// 初始化 | ||
| 19 | +$pfop = new PersistentFop($auth, $bucket, $pipeline); |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Processing\PersistentFop; | ||
| 5 | + | ||
| 6 | +$pfop = new Qiniu\Processing\PersistentFop(null, null); | ||
| 7 | + | ||
| 8 | +// 触发持久化处理后返回的 Id | ||
| 9 | +$persistentId = 'z1.5b8a48e5856db843bc24cfc3'; | ||
| 10 | + | ||
| 11 | +// 通过persistentId查询该 触发持久化处理的状态 | ||
| 12 | +list($ret, $err) = $pfop->status($persistentId); | ||
| 13 | + | ||
| 14 | +if ($err) { | ||
| 15 | + print_r($err); | ||
| 16 | +} else { | ||
| 17 | + print_r($ret); | ||
| 18 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Processing\PersistentFop; | ||
| 6 | + | ||
| 7 | +// 去我们的portal 后台来获取AK, SK | ||
| 8 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 9 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 10 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 11 | +$key = 'qiniu.png'; | ||
| 12 | + | ||
| 13 | +$auth = new Auth($accessKey, $secretKey); | ||
| 14 | +// 异步任务的队列, 去后台新建: https://portal.qiniu.com/mps/pipeline | ||
| 15 | +$pipeline = 'sdktest'; | ||
| 16 | + | ||
| 17 | +$pfop = new PersistentFop($auth, null); | ||
| 18 | + | ||
| 19 | +// 进行zip压缩的url | ||
| 20 | +$url1 = 'http://phpsdk.qiniudn.com/php-logo.png'; | ||
| 21 | +$url2 = 'http://phpsdk.qiniudn.com/1.png'; | ||
| 22 | + | ||
| 23 | +//压缩后的key | ||
| 24 | +$zipKey = 'test.zip'; | ||
| 25 | + | ||
| 26 | +$fops = 'mkzip/2/url/' . \Qiniu\base64_urlSafeEncode($url1); | ||
| 27 | +$fops .= '/url/' . \Qiniu\base64_urlSafeEncode($url2); | ||
| 28 | +$fops .= '|saveas/' . \Qiniu\base64_urlSafeEncode("$bucket:$zipKey"); | ||
| 29 | + | ||
| 30 | +$notify_url = null; | ||
| 31 | +$force = false; | ||
| 32 | + | ||
| 33 | +list($id, $err) = $pfop->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 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Processing\PersistentFop; | ||
| 6 | + | ||
| 7 | +//对已经上传到七牛的视频发起异步转码操作 | ||
| 8 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 9 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 10 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | + | ||
| 13 | +//要转码的文件所在的空间和文件名。 | ||
| 14 | +$key = 'qiniu.mp4'; | ||
| 15 | + | ||
| 16 | +//转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline | ||
| 17 | +$pipeline = 'sdktest'; | ||
| 18 | + | ||
| 19 | +//转码完成后通知到你的业务服务器。 | ||
| 20 | +$notifyUrl = 'http://375dec79.ngrok.com/notify.php'; | ||
| 21 | +$force = false; | ||
| 22 | + | ||
| 23 | +$config = new \Qiniu\Config(); | ||
| 24 | +$config->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 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Processing\PersistentFop; | ||
| 6 | + | ||
| 7 | +//对已经上传到七牛的视频发起异步转码操作 | ||
| 8 | + | ||
| 9 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 10 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 11 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 12 | + | ||
| 13 | +$auth = new Auth($accessKey, $secretKey); | ||
| 14 | + | ||
| 15 | +//要转码的文件所在的空间和文件名。 | ||
| 16 | +$key = 'qiniu.mp4'; | ||
| 17 | + | ||
| 18 | +//转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline | ||
| 19 | +$pipeline = 'sdktest'; | ||
| 20 | +$force = false; | ||
| 21 | + | ||
| 22 | +//转码完成后通知到你的业务服务器。 | ||
| 23 | +$notifyUrl = 'http://375dec79.ngrok.com/notify.php'; | ||
| 24 | +$config = new \Qiniu\Config(); | ||
| 25 | +//$config->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 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Processing\PersistentFop; | ||
| 6 | + | ||
| 7 | +//对已经上传到七牛的视频发起异步转码操作 | ||
| 8 | + | ||
| 9 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 10 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 11 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 12 | + | ||
| 13 | +$auth = new Auth($accessKey, $secretKey); | ||
| 14 | + | ||
| 15 | +//要转码的文件所在的空间和文件名。 | ||
| 16 | +$key = 'qiniu.mp4'; | ||
| 17 | + | ||
| 18 | +//转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline | ||
| 19 | +$pipeline = 'sdktest'; | ||
| 20 | + | ||
| 21 | +//转码完成后通知到你的业务服务器。 | ||
| 22 | +$notifyUrl = 'http://375dec79.ngrok.com/notify.php'; | ||
| 23 | +$force = false; | ||
| 24 | + | ||
| 25 | +$config = new \Qiniu\Config(); | ||
| 26 | +//$config->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 | +} |
63.5 KB
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Processing\PersistentFop; | ||
| 6 | + | ||
| 7 | +$accessKey = 'Access_Key'; | ||
| 8 | +$secretKey = 'Secret_Key'; | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | + | ||
| 11 | +//要持久化处理的文件所在的空间和文件名。 | ||
| 12 | +$bucket = 'Bucket_Name'; | ||
| 13 | + | ||
| 14 | +//持久化处理使用的队列名称。 https://portal.qiniu.com/mps/pipeline | ||
| 15 | +$pipeline = 'pipeline_name'; | ||
| 16 | + | ||
| 17 | +//持久化处理完成后通知到你的业务服务器。 | ||
| 18 | +$notifyUrl = 'http://375dec79.ngrok.com/notify.php'; | ||
| 19 | +$pfop = new PersistentFop($auth, $bucket, $pipeline, $notifyUrl); | ||
| 20 | + | ||
| 21 | +$id = "z2.5955c739e3d0041bf80c9baa"; | ||
| 22 | +//查询持久化处理的进度和状态 | ||
| 23 | +list($ret, $err) = $pfop->status($id); | ||
| 24 | +echo "\n====> pfop avthumb status: \n"; | ||
| 25 | +if ($err != null) { | ||
| 26 | + var_dump($err); | ||
| 27 | +} else { | ||
| 28 | + var_dump($ret); | ||
| 29 | +} |
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +require_once __DIR__ . '/../autoload.php'; | ||
| 4 | + | ||
| 5 | +use Qiniu\Auth; | ||
| 6 | +use Qiniu\Http\Client; | ||
| 7 | + | ||
| 8 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 9 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 10 | +$auth = new Auth($accessKey, $secretKey); | ||
| 11 | +$config = new \Qiniu\Config(); | ||
| 12 | +$argusManager = new \Qiniu\Storage\ArgusManager($auth, $config); | ||
| 13 | + | ||
| 14 | +$reqBody = array(); | ||
| 15 | +$reqBody['uri'] = "xxxx"; | ||
| 16 | + | ||
| 17 | +$ops = array(); | ||
| 18 | +$ops = array( | ||
| 19 | + array( | ||
| 20 | + 'op' => 'pulp', | ||
| 21 | + 'params' => array( | ||
| 22 | + 'labels' => array( | ||
| 23 | + array( | ||
| 24 | + 'label' => "1", | ||
| 25 | + 'select' => 1, | ||
| 26 | + 'score' => 2, | ||
| 27 | + ), | ||
| 28 | + ) | ||
| 29 | + ) | ||
| 30 | + ), | ||
| 31 | +); | ||
| 32 | + | ||
| 33 | +$params = array(); | ||
| 34 | +$params = array( | ||
| 35 | + 'async' => false, | ||
| 36 | + 'vframe' => array( | ||
| 37 | + 'mode' => 1, | ||
| 38 | + 'interval' => 8, | ||
| 39 | + ) | ||
| 40 | +); | ||
| 41 | + | ||
| 42 | +$req = array(); | ||
| 43 | +$req['data'] = $reqBody; | ||
| 44 | +$req['ops'] = $ops; | ||
| 45 | +$req['params'] = $params; | ||
| 46 | +$body = json_encode($req); | ||
| 47 | + | ||
| 48 | +$vid = "xxxx"; | ||
| 49 | +list($ret, $err) = $argusManager->pulpVideo($body, $vid); | ||
| 50 | + | ||
| 51 | +if ($err !== null) { | ||
| 52 | + var_dump($err); | ||
| 53 | +} else { | ||
| 54 | + var_dump($ret); | ||
| 55 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | +$private = 1; | ||
| 15 | + | ||
| 16 | +list($Info, $err) = $bucketManager->putBucketAccessMode($bucket, $private); | ||
| 17 | +if ($err) { | ||
| 18 | + print_r($err); | ||
| 19 | +} else { | ||
| 20 | + print_r($Info); | ||
| 21 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | +$mode = 1; | ||
| 15 | + | ||
| 16 | +list($Info, $err) = $bucketManager->putBucketAccessStyleMode($bucket, $mode); | ||
| 17 | +if ($err) { | ||
| 18 | + print_r($err); | ||
| 19 | +} else { | ||
| 20 | + print_r($Info); | ||
| 21 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | +$name = 'testdemo'; | ||
| 15 | +$prefix = 'test1'; | ||
| 16 | +$suffix = 'mp3'; | ||
| 17 | +$event = array("move","copy"); | ||
| 18 | +$callbackURL = 'http://www.qiniu.com'; | ||
| 19 | + | ||
| 20 | +list($Info, $err) = $bucketManager->putBucketEvent($bucket, $name, $prefix, $suffix, $event, $callbackURL); | ||
| 21 | +if ($err) { | ||
| 22 | + print_r($err); | ||
| 23 | +} else { | ||
| 24 | + print_r($Info); | ||
| 25 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | +$maxAge = 15768000; | ||
| 15 | + | ||
| 16 | +list($Info, $err) = $bucketManager->putBucketMaxAge($bucket, $maxAge); | ||
| 17 | +if ($err) { | ||
| 18 | + print_r($err); | ||
| 19 | +} else { | ||
| 20 | + print_r($Info); | ||
| 21 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | +$size = 99999; | ||
| 15 | +$count = 99; | ||
| 16 | + | ||
| 17 | +list($Info, $err) = $bucketManager->putBucketQuota($bucket, $size, $count); | ||
| 18 | +if ($err) { | ||
| 19 | + print_r($err); | ||
| 20 | +} else { | ||
| 21 | + print_r($Info); | ||
| 22 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | +$mode = 1; | ||
| 15 | +$norefer = "1"; | ||
| 16 | +$pattern = "*.qiniu.com"; | ||
| 17 | + | ||
| 18 | +list($Info, $err) = $bucketManager->putReferAntiLeech($bucket, $mode, $norefer, $pattern); | ||
| 19 | +if ($err) { | ||
| 20 | + print_r($err); | ||
| 21 | +} else { | ||
| 22 | + print_r($Info); | ||
| 23 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | + | ||
| 15 | +//每次最多不能超过1000个 | ||
| 16 | +$keyMimePairs = array( | ||
| 17 | + 'qiniu.mp4' => '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 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | + | ||
| 15 | +//每次最多不能超过1000个 | ||
| 16 | +$keys = array( | ||
| 17 | + 'qiniu.mp4', | ||
| 18 | + 'qiniu.png', | ||
| 19 | + 'qiniu.jpg' | ||
| 20 | +); | ||
| 21 | + | ||
| 22 | +$keyTypePairs = array(); | ||
| 23 | +//type=0表示普通存储,type=1表示低频存储 | ||
| 24 | +foreach ($keys as $key) { | ||
| 25 | + $keyTypePairs[$key] = 1; | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +$ops = $bucketManager->buildBatchChangeType($bucket, $keyTypePairs); | ||
| 29 | +list($ret, $err) = $bucketManager->batch($ops); | ||
| 30 | +if ($err) { | ||
| 31 | + print_r($err); | ||
| 32 | +} else { | ||
| 33 | + print_r($ret); | ||
| 34 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | + | ||
| 15 | +//每次最多不能超过1000个 | ||
| 16 | +$keys = array( | ||
| 17 | + 'qiniu.mp4', | ||
| 18 | + 'qiniu.png', | ||
| 19 | + 'qiniu.jpg' | ||
| 20 | +); | ||
| 21 | + | ||
| 22 | +$keyPairs = array(); | ||
| 23 | +foreach ($keys as $key) { | ||
| 24 | + $keyPairs[$key] = $key . "_copy"; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +$srcBucket = $bucket; | ||
| 28 | +$destBucket = $bucket; | ||
| 29 | + | ||
| 30 | +$ops = $bucketManager->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 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | + | ||
| 15 | +//每次最多不能超过1000个 | ||
| 16 | +$keys = array( | ||
| 17 | + 'qiniu.mp4', | ||
| 18 | + 'qiniu.png', | ||
| 19 | + 'qiniu.jpg' | ||
| 20 | +); | ||
| 21 | + | ||
| 22 | +$ops = $bucketManager->buildBatchDelete($bucket, $keys); | ||
| 23 | +list($ret, $err) = $bucketManager->batch($ops); | ||
| 24 | +if ($err) { | ||
| 25 | + print_r($err); | ||
| 26 | +} else { | ||
| 27 | + print_r($ret); | ||
| 28 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | + | ||
| 15 | +//每次最多不能超过1000个 | ||
| 16 | +$keys = array( | ||
| 17 | + 'qiniu.mp4', | ||
| 18 | + 'qiniu.png', | ||
| 19 | + 'qiniu.jpg' | ||
| 20 | +); | ||
| 21 | + | ||
| 22 | +$keyDayPairs = array(); | ||
| 23 | +//day=0表示永久存储 | ||
| 24 | +foreach ($keys as $key) { | ||
| 25 | + $keyDayPairs[$key] = 0; | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +$ops = $bucketManager->buildBatchDeleteAfterDays($bucket, $keyDayPairs); | ||
| 29 | +list($ret, $err) = $bucketManager->batch($ops); | ||
| 30 | +if ($err) { | ||
| 31 | + print_r($err); | ||
| 32 | +} else { | ||
| 33 | + print_r($ret); | ||
| 34 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | + | ||
| 15 | +//每次最多不能超过1000个 | ||
| 16 | +$keys = array( | ||
| 17 | + 'qiniu.mp4', | ||
| 18 | + 'qiniu.png', | ||
| 19 | + 'qiniu.jpg' | ||
| 20 | +); | ||
| 21 | + | ||
| 22 | +$keyPairs = array(); | ||
| 23 | +foreach ($keys as $key) { | ||
| 24 | + $keyPairs[$key . "_copy"] = $key . "_move"; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +$srcBucket = $bucket; | ||
| 28 | +$destBucket = $bucket; | ||
| 29 | + | ||
| 30 | +$ops = $bucketManager->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 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | + | ||
| 15 | +//每次最多不能超过1000个 | ||
| 16 | +$keys = array( | ||
| 17 | + 'qiniu.mp4', | ||
| 18 | + 'qiniu.png', | ||
| 19 | + 'qiniu.jpg' | ||
| 20 | +); | ||
| 21 | + | ||
| 22 | +$ops = $bucketManager->buildBatchStat($bucket, $keys); | ||
| 23 | +list($ret, $err) = $bucketManager->batch($ops); | ||
| 24 | +if ($err) { | ||
| 25 | + print_r($err); | ||
| 26 | +} else { | ||
| 27 | + print_r($ret); | ||
| 28 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | +list($domains, $err) = $bucketManager->domains($bucket); | ||
| 15 | +if ($err) { | ||
| 16 | + print_r($err); | ||
| 17 | +} else { | ||
| 18 | + print_r($domains); | ||
| 19 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | +list($buckets, $err) = $bucketManager->buckets(true); | ||
| 15 | +if ($err) { | ||
| 16 | + print_r($err); | ||
| 17 | +} else { | ||
| 18 | + print_r($buckets); | ||
| 19 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | +$key = 'qiniu.mp4'; | ||
| 11 | +$newMime = 'video/x-mp4'; | ||
| 12 | + | ||
| 13 | +$auth = new Auth($accessKey, $secretKey); | ||
| 14 | +$config = new \Qiniu\Config(); | ||
| 15 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 16 | + | ||
| 17 | +$err = $bucketManager->changeMime($bucket, $key, $newMime); | ||
| 18 | +if ($err) { | ||
| 19 | + print_r($err); | ||
| 20 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | +$key = "qiniu.jpg"; | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | + | ||
| 15 | +$status = 1;//0表示启用;1表示禁用 | ||
| 16 | + | ||
| 17 | +$err = $bucketManager->changeStatus($bucket, $key, $status); | ||
| 18 | +if ($err) { | ||
| 19 | + print_r($err); | ||
| 20 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | +$key = "qiniu.mp4"; | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | + | ||
| 15 | +$fileType = 1;//0 表示普通存储,1表示低频存储 | ||
| 16 | + | ||
| 17 | +$err = $bucketManager->changeType($bucket, $key, $fileType); | ||
| 18 | +if ($err) { | ||
| 19 | + print_r($err); | ||
| 20 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | +$key = "qiniu.mp4"; | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | + | ||
| 15 | +$srcBucket = $bucket; | ||
| 16 | +$destBucket = $bucket; | ||
| 17 | +$srcKey = $key; | ||
| 18 | +$destKey = $key . "_copy"; | ||
| 19 | +$err = $bucketManager->copy($srcBucket, $srcKey, $destBucket, $destKey, true); | ||
| 20 | +if ($err) { | ||
| 21 | + print_r($err); | ||
| 22 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | +$key = "qiniu.mp4_copy"; | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | +$err = $bucketManager->delete($bucket, $key); | ||
| 15 | +if ($err) { | ||
| 16 | + print_r($err); | ||
| 17 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | +$key = 'qiniu.mp4'; | ||
| 11 | +$days = 10; | ||
| 12 | + | ||
| 13 | +$auth = new Auth($accessKey, $secretKey); | ||
| 14 | +$config = new \Qiniu\Config(); | ||
| 15 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 16 | + | ||
| 17 | +$err = $bucketManager->deleteAfterDays($bucket, $key, $days); | ||
| 18 | +if ($err) { | ||
| 19 | + print_r($err); | ||
| 20 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +// 构建Auth对象 | ||
| 10 | +$auth = new Auth($accessKey, $secretKey); | ||
| 11 | + | ||
| 12 | +// 私有空间中的外链 http://<domain>/<file_key> | ||
| 13 | +$baseUrl = 'http://if-pri.qiniudn.com/qiniu.png?imageView2/1/h/500'; | ||
| 14 | +// 对链接进行签名 | ||
| 15 | +$signedUrl = $auth->privateDownloadUrl($baseUrl); | ||
| 16 | + | ||
| 17 | +echo $signedUrl; |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Storage\BucketManager; | ||
| 6 | + | ||
| 7 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 8 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 9 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 10 | + | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$bucketManager = new BucketManager($auth); | ||
| 13 | + | ||
| 14 | +$url = 'http://devtools.qiniu.com/qiniu.png'; | ||
| 15 | +$key = time() . '.png'; | ||
| 16 | + | ||
| 17 | +// 指定抓取的文件保存名称 | ||
| 18 | +list($ret, $err) = $bucketManager->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 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | +$key = "qiniu.mp4"; | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | + | ||
| 15 | +$srcBucket = $bucket; | ||
| 16 | +$destBucket = $bucket; | ||
| 17 | +$srcKey = $key . "_copy"; | ||
| 18 | +$destKey = $key . "_move"; | ||
| 19 | +$err = $bucketManager->move($srcBucket, $srcKey, $destBucket, $destKey, true); | ||
| 20 | +if ($err) { | ||
| 21 | + print_r($err); | ||
| 22 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | +$key = "qiniu.mp4"; | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | +$err = $bucketManager->prefetch($bucket, $key); | ||
| 15 | +if ($err) { | ||
| 16 | + print_r($err); | ||
| 17 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = 'gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5'; | ||
| 7 | +$secretKey = '9G4isTkVuj5ITPqH1ajhljJMTc2k4m-hZh5r5ZsK'; | ||
| 8 | +$bucket = 'file'; | ||
| 9 | + | ||
| 10 | +$domain = 'lfxfile.qiniuts.com'; | ||
| 11 | + | ||
| 12 | +$auth = new Auth($accessKey, $secretKey); | ||
| 13 | +$config = new \Qiniu\Config(); | ||
| 14 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 15 | + | ||
| 16 | +$err = $bucketManager->publishDomain($bucket, $domain); | ||
| 17 | +if ($err) { | ||
| 18 | + print_r($err); | ||
| 19 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | +$key = "qiniu.mp4"; | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | +$config = new \Qiniu\Config(); | ||
| 13 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 14 | +list($fileInfo, $err) = $bucketManager->stat($bucket, $key); | ||
| 15 | +if ($err) { | ||
| 16 | + print_r($err); | ||
| 17 | +} else { | ||
| 18 | + print_r($fileInfo); | ||
| 19 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Storage\BucketManager; | ||
| 6 | + | ||
| 7 | +// http://developer.qiniu.com/docs/v6/api/reference/rs/list.html#list-description | ||
| 8 | + | ||
| 9 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 10 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 11 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 12 | +$auth = new Auth($accessKey, $secretKey); | ||
| 13 | +$bucketManager = new BucketManager($auth); | ||
| 14 | + | ||
| 15 | + | ||
| 16 | +// 要列取文件的公共前缀 | ||
| 17 | +$prefix = ''; | ||
| 18 | + | ||
| 19 | +// 上次列举返回的位置标记,作为本次列举的起点信息。 | ||
| 20 | +$marker = ''; | ||
| 21 | + | ||
| 22 | +// 本次列举的条目数 | ||
| 23 | +$limit = 200; | ||
| 24 | + | ||
| 25 | +$delimiter = '/'; | ||
| 26 | + | ||
| 27 | +// 列举文件 | ||
| 28 | +do { | ||
| 29 | + list($ret, $err) = $bucketManager->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)); |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Storage\BucketManager; | ||
| 6 | + | ||
| 7 | +// http://developer.qiniu.com/docs/v6/api/reference/rs/list.html#list-description | ||
| 8 | + | ||
| 9 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 10 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 11 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 12 | +$auth = new Auth($accessKey, $secretKey); | ||
| 13 | +$bucketManager = new BucketManager($auth); | ||
| 14 | + | ||
| 15 | + | ||
| 16 | +// 要列取文件的公共前缀 | ||
| 17 | +$prefix = ''; | ||
| 18 | + | ||
| 19 | +// 上次列举返回的位置标记,作为本次列举的起点信息。 | ||
| 20 | +$marker = ''; | ||
| 21 | + | ||
| 22 | +// 本次列举的条目数 | ||
| 23 | +$limit = 100; | ||
| 24 | + | ||
| 25 | +$delimiter = '/'; | ||
| 26 | + | ||
| 27 | +// 列举文件 | ||
| 28 | +list($ret, $err) = $bucketManager->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 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Storage\BucketManager; | ||
| 6 | + | ||
| 7 | +// http://developer.qiniu.com/docs/v6/api/reference/rs/list.html#list-description | ||
| 8 | + | ||
| 9 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 10 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 11 | +$bucket = 'xxxx'; | ||
| 12 | +$auth = new Auth($accessKey, $secretKey); | ||
| 13 | +$bucketManager = new BucketManager($auth); | ||
| 14 | + | ||
| 15 | + | ||
| 16 | +// 要列取文件的公共前缀 | ||
| 17 | +$prefix = ''; | ||
| 18 | + | ||
| 19 | +// 上次列举返回的位置标记,作为本次列举的起点信息。 | ||
| 20 | +$marker = ''; | ||
| 21 | + | ||
| 22 | +// 本次列举的条目数 | ||
| 23 | +$limit = 1000; | ||
| 24 | + | ||
| 25 | +$delimiter = ''; | ||
| 26 | + | ||
| 27 | +list($ret, $err) = $bucketManager->listFilesv2($bucket, $prefix, $marker, $limit, $delimiter, true); | ||
| 28 | + | ||
| 29 | +if ($err) { | ||
| 30 | + print_r($err); | ||
| 31 | +} else { | ||
| 32 | + print_r($ret); | ||
| 33 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Processing\PersistentFop; | ||
| 6 | + | ||
| 7 | +// 后台来获取AK, SK | ||
| 8 | +$accessKey = 'Access_Key'; | ||
| 9 | +$secretKey = 'Secret_Key'; | ||
| 10 | + | ||
| 11 | +//生成EncodedEntryURI的值 | ||
| 12 | +$entry = '<bucket>:<Key>';//<Key>为生成缩略图的文件名 | ||
| 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; |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | +$name = 'demo'; | ||
| 15 | +$prefix = 'test'; | ||
| 16 | +$suffix = 'mp4'; | ||
| 17 | +$event = 'mkfile'; | ||
| 18 | +$callbackURL = 'https://www.qiniu.com'; | ||
| 19 | + | ||
| 20 | +list($Info, $err) = $bucketManager->updateBucketEvent($bucket, $name, $prefix, $suffix, $event, $callbackURL); | ||
| 21 | +if ($err) { | ||
| 22 | + print_r($err); | ||
| 23 | +} else { | ||
| 24 | + print_r($Info); | ||
| 25 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | + | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | +$config = new \Qiniu\Config(); | ||
| 11 | +$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config); | ||
| 12 | + | ||
| 13 | +$bucket = 'xxxx'; | ||
| 14 | +$name = 'demo'; | ||
| 15 | +$prefix = 'test'; | ||
| 16 | +$delete_after_days = 90; | ||
| 17 | +$to_line_after_days =80; | ||
| 18 | + | ||
| 19 | +list($Info, $err) = $bucketManager->updateBucketLifecycleRule( | ||
| 20 | + $bucket, | ||
| 21 | + $name, | ||
| 22 | + $prefix, | ||
| 23 | + $delete_after_days, | ||
| 24 | + $to_line_after_days | ||
| 25 | +); | ||
| 26 | +if ($err) { | ||
| 27 | + print_r($err); | ||
| 28 | +} else { | ||
| 29 | + print_r($Info); | ||
| 30 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | +use Qiniu\Auth; | ||
| 4 | +use Qiniu\Storage\UploadManager; | ||
| 5 | + | ||
| 6 | +// use Qiniu\Config; | ||
| 7 | +// use Qiniu\Zone; | ||
| 8 | + | ||
| 9 | +// 指定zone上传 | ||
| 10 | +// $zone = Zone::qvmZonez0(); //华东QVM内网上传指定host | ||
| 11 | +// $config = new Config($zone); | ||
| 12 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 13 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 14 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 15 | +$auth = new Auth($accessKey, $secretKey); | ||
| 16 | +// 上传文件到七牛后, 七牛将文件名和文件大小回调给业务服务器. | ||
| 17 | +// 可参考文档: http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html | ||
| 18 | +$policy = array( | ||
| 19 | + 'callbackUrl' => 'http://your.domain.com/upload_verify_callback.php', | ||
| 20 | + 'callbackBody' => 'filename=$(fname)&filesize=$(fsize)' | ||
| 21 | +); | ||
| 22 | +$uptoken = $auth->uploadToken($bucket, null, 3600, $policy); | ||
| 23 | +//上传文件的本地路径 | ||
| 24 | +$filePath = './php-logo.png'; | ||
| 25 | +//指定 config | ||
| 26 | +// $uploadMgr = new UploadManager($config); | ||
| 27 | +$uploadMgr = new UploadManager(); | ||
| 28 | +list($ret, $err) = $uploadMgr->putFile($uptoken, null, $filePath); | ||
| 29 | +echo "\n====> putFile result: \n"; | ||
| 30 | +if ($err !== null) { | ||
| 31 | + var_dump($err); | ||
| 32 | +} else { | ||
| 33 | + var_dump($ret); | ||
| 34 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Storage\UploadManager; | ||
| 6 | + | ||
| 7 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 8 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 9 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 10 | +$auth = new Auth($accessKey, $secretKey); | ||
| 11 | + | ||
| 12 | + | ||
| 13 | +// 在七牛保存的文件名 | ||
| 14 | +$key = 'php-logo.png'; | ||
| 15 | +$uploadMgr = new UploadManager(); | ||
| 16 | + | ||
| 17 | +$pfop = "imageMogr2/rotate/90|saveas/" . \Qiniu\base64_urlSafeEncode($bucket . ":php-logo-rotate.png"); | ||
| 18 | + | ||
| 19 | +//转码完成后通知到你的业务服务器。(公网可以访问,并相应200 OK) | ||
| 20 | +$notifyUrl = 'http://notify.fake.com'; | ||
| 21 | + | ||
| 22 | +//独立的转码队列:https://portal.qiniu.com/mps/pipeline | ||
| 23 | +$pipeline = 'sdktest'; | ||
| 24 | + | ||
| 25 | +$policy = array( | ||
| 26 | + 'persistentOps' => $pfop, | ||
| 27 | + 'persistentNotifyUrl' => $notifyUrl, | ||
| 28 | + 'persistentPipeline' => $pipeline | ||
| 29 | +); | ||
| 30 | +$token = $auth->uploadToken($bucket, null, 3600, $policy); | ||
| 31 | + | ||
| 32 | +list($ret, $err) = $uploadMgr->putFile($token, null, $key); | ||
| 33 | +echo "\n====> putFile result: \n"; | ||
| 34 | +if ($err !== null) { | ||
| 35 | + var_dump($err); | ||
| 36 | +} else { | ||
| 37 | + var_dump($ret); | ||
| 38 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Storage\UploadManager; | ||
| 6 | + | ||
| 7 | +$accessKey = 'Access_Key'; | ||
| 8 | +$secretKey = 'Secret_Key'; | ||
| 9 | +$auth = new Auth($accessKey, $secretKey); | ||
| 10 | + | ||
| 11 | +// 空间名 http://developer.qiniu.com/docs/v6/api/overview/concepts.html#bucket | ||
| 12 | +$bucket = 'Bucket_Name'; | ||
| 13 | + | ||
| 14 | +// 生成上传Token | ||
| 15 | +$token = $auth->uploadToken($bucket); | ||
| 16 | + | ||
| 17 | +// 构建 UploadManager 对象 | ||
| 18 | +$uploadMgr = new UploadManager(); |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | +use Qiniu\Storage\UploadManager; | ||
| 6 | + | ||
| 7 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 8 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 9 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 10 | +$pipeline = 'sdktest'; | ||
| 11 | + | ||
| 12 | +$auth = new Auth($accessKey, $secretKey); | ||
| 13 | +$token = $auth->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 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +// 引入鉴权类 | ||
| 5 | +use Qiniu\Auth; | ||
| 6 | + | ||
| 7 | +// 引入上传类 | ||
| 8 | +use Qiniu\Storage\UploadManager; | ||
| 9 | + | ||
| 10 | +// 需要填写你的 Access Key 和 Secret Key | ||
| 11 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 12 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 13 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 14 | + | ||
| 15 | +// 构建鉴权对象 | ||
| 16 | +$auth = new Auth($accessKey, $secretKey); | ||
| 17 | + | ||
| 18 | +// 生成上传 Token | ||
| 19 | +$token = $auth->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 | +} |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use \Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | +// 初始化Auth状态 | ||
| 11 | +$auth = new Auth($accessKey, $secretKey); | ||
| 12 | + | ||
| 13 | +// 简单上传凭证 | ||
| 14 | +$expires = 3600; | ||
| 15 | + | ||
| 16 | +$policy = null; | ||
| 17 | +$upToken = $auth->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"); |
| 1 | +<?php | ||
| 2 | +require_once __DIR__ . '/../autoload.php'; | ||
| 3 | + | ||
| 4 | +use Qiniu\Auth; | ||
| 5 | + | ||
| 6 | +$accessKey = getenv('QINIU_ACCESS_KEY'); | ||
| 7 | +$secretKey = getenv('QINIU_SECRET_KEY'); | ||
| 8 | +$bucket = getenv('QINIU_TEST_BUCKET'); | ||
| 9 | + | ||
| 10 | +$auth = new Auth($accessKey, $secretKey); | ||
| 11 | + | ||
| 12 | +//获取回调的body信息 | ||
| 13 | +$callbackBody = file_get_contents('php://input'); | ||
| 14 | + | ||
| 15 | +//回调的contentType | ||
| 16 | +$contentType = 'application/x-www-form-urlencoded'; | ||
| 17 | + | ||
| 18 | +//回调的签名信息,可以验证该回调是否来自七牛 | ||
| 19 | +$authorization = $_SERVER['HTTP_AUTHORIZATION']; | ||
| 20 | + | ||
| 21 | +//七牛回调的url,具体可以参考:http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html | ||
| 22 | +$url = 'http://172.30.251.210/upload_verify_callback.php'; | ||
| 23 | + | ||
| 24 | +$isQiniuCallback = $auth->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); |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<phpunit backupGlobals="false" | ||
| 3 | + backupStaticAttributes="false" | ||
| 4 | + bootstrap="./tests/bootstrap.php" | ||
| 5 | + colors="true" | ||
| 6 | + convertErrorsToExceptions="true" | ||
| 7 | + convertNoticesToExceptions="true" | ||
| 8 | + convertWarningsToExceptions="true" | ||
| 9 | + processIsolation="false" | ||
| 10 | + stopOnFailure="false" | ||
| 11 | +> | ||
| 12 | + <testsuites> | ||
| 13 | + <testsuite name="Qiniu SDK Tests"> | ||
| 14 | + <directory>tests</directory> | ||
| 15 | + </testsuite> | ||
| 16 | + </testsuites> | ||
| 17 | + | ||
| 18 | +</phpunit> |
-
请 注册 或 登录 后发表评论