作者 ZhengBing He

initok

正在显示 96 个修改的文件 包含 4600 行增加0 行删除

要显示太多修改。

为保证性能只显示 96 of 96+ 个文件。

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>404</title>
<style>
body{
background-color:#444;
font-size:14px;
}
h3{
font-size:60px;
color:#eee;
text-align:center;
padding-top:30px;
font-weight:normal;
}
</style>
</head>
<body>
<h3>404,您请求的文件不存在!</h3>
</body>
</html>
... ...
<?xml version="1.0"?>
<users>
<user>743F1F9393F3421FE9BA38C01A792ED9</user>
</users>
\ No newline at end of file
... ...
<?php
require_once( dirname(__FILE__) . '/../wp-load.php' );
if( is_user_logged_in() ) : ?>
<!DOCTYPE html>
<html class="system-market">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<meta name="screen-orientation" content="portrait">
<meta name="x5-orientation" content="portrait">
<meta name="full-screen" content="yes">
<meta name="x5-fullscreen" content="true">
<meta name="browsermode" content="application">
<meta name="x5-page-mode" content="app">
<title>全球搜V5.0 - 外贸智慧营销一站式解决方案</title>
<link rel="stylesheet" type="text/css" href="https://admin.globalso.com/styles/css/admin.css">
</head>
<body class="system-market">
<!-- wrapper start -->
<div class="wrapper">
<!-- 页眉开始 -->
<div id="admin-head" class="admin-head">
<div class="head-layout">
<div class="mobile-btn-aside"><span class="nav-btn-ico"><i></i><i></i><i></i></span></div>
<div class="sm-btn-aside"></div>
<i class="plane"></i>
<div class="head-logo">
<span class="logo-ico"><img src="https://admin.globalso.com/styles/img/admin/logo-ico.png" alt=""></span>
<span class="logo-img" style="color:red;font-weight:bold;">技术专用后台 {后端}</span>
</div>
<div class="top-notice">
<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>
<div class="notice-list">
<ul>
<li><a href="#">全球搜 总部技术专用后台界面 - 直接通过后台即可登录后台</a></li>
</ul>
</div>
</div>
<div class="head-right">
<span class="head-right-bg"></span>
<div class="top-quick-item sys-tips mobile-hide" data-tips="网站首页">
<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>
</div>
<div class="top-quick-item sys-tips sys-tips-b-r" data-tips="系统更行">
<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>
</div>
</div>
</div>
</div>
<!--// 页眉结束 -->
<!-- 左侧栏开始 -->
<div id="admin-aside" class="admin-aside">
<!-- 市场大师左侧导航 -->
<div class="aside-body aside-market">
<div class="aside-nav">
<div class="aside-nav-inner">
<ul class="aside-nav-list">
<li class="side-btn-item side-nav-item wave-animate">
<div class="item-inner">
<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>
<span class="menu-txt">速达</span>
<i class="wave-animate-bg"></i>
</div>
</li>
<li class="side-btn-item side-nav-item wave-animate add_mob_hide">
<div class="item-inner">
<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>
<span class="menu-txt">网站</span>
<i class="wave-animate-bg"></i>
</div>
</li>
<li class="side-btn-item side-nav-item wave-animate add_mob_hide">
<div class="item-inner">
<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>
<span class="menu-txt">产品</span>
<i class="wave-animate-bg"></i>
</div>
</li>
<li class="side-btn-item side-nav-item wave-animate">
<div class="item-inner">
<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>
<span class="menu-txt">社交</span>
<i class="wave-animate-bg"></i>
</div>
</li>
<li class="side-btn-item side-nav-item wave-animate">
<div class="item-inner">
<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>
<span class="menu-txt">★AI</span>
<i class="wave-animate-bg"></i>
</div>
</li>
<li class="side-btn-item side-nav-item wave-animate">
<div class="item-inner">
<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>
<span class="menu-txt">数据</span>
<i class="wave-animate-bg"></i>
</div>
</li>
<li class="side-btn-item side-nav-item wave-animate add_mob_hide">
<div class="item-inner">
<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>
<span class="menu-txt">设置</span>
<i class="wave-animate-bg"></i>
</div>
</li>
</ul>
<i class="active-ico"></i>
</div>
</div>
<!-- 二级菜单 -->
<div class="aside-menu">
<div class="side-menu-group">
<div class="menu-group-hd">
<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>
<span class="side-menu-txt">速达</span>
</div>
<div class="menu-group-bd">
<ul class="menu-group-list">
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/post.php?post=50&action=edit">网站形象</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php?post_type=page">页面管理</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php">产品列表</a></li>
</ul>
<ul class="menu-group-list">
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=cf7-data&fid=19">精准询盘</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-xptj.php">询盘统计</a></li>
</ul>
<!-- <ul class="menu-group-list">
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/plugins.php">插件管理</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=easyiit_cdn">CDN管理</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=stats_settings">数据清除</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=t9_eshopimport">数据导入</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php?post_type=acf">自定义字段</a></li>
</ul>
<ul class="menu-group-list">
<li><a target="_blank" href="<?php echo home_url(); ?>/wp-admin/plugins.php?page=prisna-translate-automate-settings">多语言翻译</a></li>
<li><a target="_blank" href="<?php echo home_url(); ?>/wp-admin/plugins.php?page=prisna-translate-settings">翻译设置</a></li>
</ul> -->
</div>
</div>
<div class="side-menu-group">
<div class="menu-group-hd">
<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>
<span class="side-menu-txt">网站</span>
</div>
<div class="menu-group-bd">
<ul class="menu-group-list">
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/post.php?post=50&action=edit">网站形象</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/nav-menus.php?menu=31">菜单管理</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php?post_type=page">页面管理</a></li>
</ul>
<ul class="menu-group-list">
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php?post_type=news">新闻管理</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit-tags.php?taxonomy=news_catalog&post_type=news">新闻分类</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php?post_type=guide">行业文章</a></li>
</ul>
</div>
</div>
<div class="side-menu-group">
<div class="menu-group-hd">
<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>
<span class="side-menu-txt">产品</span>
</div>
<div class="menu-group-bd">
<ul class="menu-group-list">
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/post-new.php">产品发布</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit.php">产品列表</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit-tags.php?taxonomy=category">产品分类</a></li>
</ul>
<ul class="menu-group-list">
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/edit-tags.php?taxonomy=post_tag">产品关键词</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/post.php?post=656&action=edit">产品通用属性</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/post.php?post=444&action=edit">产品通用描述</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/options-reading.php">产品列表数量</a></li>
</ul>
</div>
</div>
<div class="side-menu-group">
<div class="menu-group-hd">
<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>
<span class="side-menu-txt">社交&工具</span>
</div>
<div class="menu-group-bd">
<ul class="menu-group-list">
<li><a class="iframe-link" href="//www.globalso.vip/">社交数据检索</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=blog2social-network">社交账号管理</a></li>
</ul>
<ul class="menu-group-list">
<li><a class="iframe-link" href="//go.quanqiusou.cn/">谷歌排名查询</a></li>
<li><a class="iframe-link" href="//www.quanqiusou.cn/tools/waimao-tools.html">外贸工具集合 </a></li>
</ul>
<ul class="menu-group-list">
<li class="add_mob_hide"><a class="iframe-link" href="//www.quanqiusou.cn/zhongxin/">中信保数据</a></li>
</ul>
</div>
</div>
<div class="side-menu-group">
<div class="menu-group-hd">
<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>
<span class="side-menu-txt">AI分析</span>
</div>
<div class="menu-group-bd">
<ul class="menu-group-list">
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=easyiit_product_publish">AI产品发布</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/admin.php?page=easyiit_news_publish">AI新闻发布</a></li>
<li class="add_mob_hide"><a class="iframe-link" href="//title.globalso.com/">AI标题挖掘</a></li>
<li class="add_mob_hide"><a class="iframe-link" href="//keywords.globalso.com/">AI关键词挖掘</a></li>
</ul>
</div>
</div>
<div class="side-menu-group">
<div class="menu-group-hd">
<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>
<span class="side-menu-txt">数据</span>
</div>
<div class="menu-group-bd">
<ul class="menu-group-list">
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-uvmx.php">访问明细</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-uvhz.php">流量趋势</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-uvly.php">访问来源</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-uvgj.php">地域分布</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-uvym.php">受访页面</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-uvzd.php">访问终端</a></li>
<li><a class="iframe-link" href="<?php echo home_url(); ?>/wp-admin/index-report.php">月度报告</a></li>
</ul>
</div>
</div>
<div class="side-menu-group">
<div class="menu-group-hd">
<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>
<span class="side-menu-txt">设置</span>
</div>
<div class="menu-group-bd">
<ul class="menu-group-list">
<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>
<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>
<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>
</ul>
</div>
</div>
</div>
</div>
<div class="aside-foot">
<div class="aside-foot-inner">
<p style="color:red;font-weight:bold;">全球搜操作界面</p>
<p></p>
</div>
</div>
<div class="aside-bg"></div>
</div>
<!--// 左侧栏结束 -->
<!-- 右侧设置开始 -->
<div id="admin-seting" class="seting-aside crumb-act-root" data-crumb-rootlabel="设置">
<div class="seting-hd">
<h4>更新</h4>
<span class="seting-close"></span>
</div>
<div class="seting-bd">
<ul class="seting-menu">
<li class="wave-animate"><a href="javascript:" onClick="popShow(tipVal01,tipVal02,'1','全站页面')">全站页面更新<i class="wave-animate-bg"></i></a></li>
<li class="wave-animate"><a href="javascript:" onClick="popShow(tipVal01,tipVal02,'2','CDN文件')">CDN文件更新<i class="wave-animate-bg"></i></a></li>
<li class="wave-animate"><a href="javascript:" onClick="popShow(tipVal01,tipVal02,'3','CDN图片')">CDN图片更新<i class="wave-animate-bg"></i></a></li>
<!--
<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>
<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>
<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>
-->
</ul>
</div>
</div>
<!--// 右侧设置结束 -->
<!-- iframe -->
<div class="iframe-wrap">
<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>
</div>
</div>
<!--// wrapper end -->
<script src="https://admin.globalso.com/styles/js/jquery.min.js"></script>
<script src="https://admin.globalso.com/styles/js/admin.js"></script>
<script src="https://admin.globalso.com/js/layer.js"></script>
<script>
var tipVal01='正在提交更新任务,请稍后......'
var tipVal02='<i style="color:red">为何要更新缓存?</i>全球搜所有客户网站均启用了全球CDN加速,不同国家节点都会有缓存,<br/>更新内容后如果需要及时生效,必须要更新CDN缓存,如果不急,需要等2-4小时缓存自动更新!';
var tipReVal02='请在3-5分钟后,F5刷新浏览器 或 清除浏览器缓存查看网站更新!';
function popShow(tip01,tip02,f_type,dis_word){
if($(".keyword_ranking_pop").length<1){
var htmlPop='<div class="keyword_ranking_pop">'
+'<div class="keyword_ranking_wrap">'
+'<div class="pop_wrap">'
+'<div class="progress_bar_wrap">'
+'<div class="progress_bar"><div class="bar"></div></div>'
+'</div>'
+'<div class="tip">'+tip01+'</div>'
+'<div class="sup_notes">'+tip02+'</div>'
+'<div class="close"><button onclick="popHide()">关闭</button></div>'
+'</div>'
+'</div>'
+'</div>'
$("body").append(htmlPop)
$(".keyword_ranking_pop .tip").html(tipVal01)
$(".keyword_ranking_pop .sup_notes").html(tipVal02)
$(".keyword_ranking_pop").fadeIn()
var percentage = 0;
var interval = setInterval(function () {
if (percentage < 900) {
percentage++;
var widthTemp = (percentage / 10).toFixed(1) + '%';
$('.progress_bar .bar').css('width', widthTemp);
} else {
clearInterval(interval);
setTimeout(function () {
//$(".keyword_ranking_pop .tip").html(tipReVal01)
// $(".keyword_ranking_pop .sup_notes").html(tipReVal02)
//$(".keyword_ranking_pop .pop_wrap .close").show()
}, 500);
}
}, 2);
}
var id="{{$data->id}}";
$.ajax({
type:"get",
url:'https://admin.globalso.com/api/update_image',
data:{'id':id,'ftype':f_type},
success:function(data){
if(data == 200){
//alert('更新成功');
percentage = 1000;
$('.progress_bar .bar').css('width', "100%");
$(".keyword_ranking_pop .tip").html('<i style="color:red">已成功提交'+dis_word+'更新!</i>')
$(".keyword_ranking_pop .sup_notes").html(tipReVal02)
$(".keyword_ranking_pop .pop_wrap .close").show()
}else if(data == 1){
//alert('项目未上线,不能更新图片');
$(".keyword_ranking_pop .tip").html('<i style="color:red">项目未上线,不能更新'+dis_word+'!</i>')
$(".keyword_ranking_pop .sup_notes").html("")
$(".keyword_ranking_pop .pop_wrap .close").show()
}else{
//alert('更新失败');
$(".progress_bar_wrap").hide();
$(".keyword_ranking_pop .tip").html('<i style="color:red">更新失败</i>')
$(".keyword_ranking_pop .sup_notes").html("")
$(".keyword_ranking_pop .pop_wrap .close").show()
}
},
error:function(data){
$(".progress_bar_wrap").hide();
$(".keyword_ranking_pop .tip").html('<i style="color:red">更新失败</i>')
$(".keyword_ranking_pop .sup_notes").html("")
$(".keyword_ranking_pop .pop_wrap .close").show()
}
});
}
function popHide(){
$(".keyword_ranking_pop").remove()
}
</script>
</body>
</html><?php else: ?><meta http-equiv="refresh" content="0;url=<?php echo home_url(); ?>/admin.php"><?php endif; ?>
\ No newline at end of file
... ...
<?php
/**
* WordPress User Page
*
* Handles authentication, registering, resetting passwords, forgot password,
* and other user handling.
*
* @package WordPress
*/
/** Make sure that the WordPress bootstrap has run before continuing. */
require( dirname(__FILE__) . '/wp-load.php' );
// Redirect to https login if forced to use SSL
if ( force_ssl_admin() && ! is_ssl() ) {
if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
exit();
} else {
wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
exit();
}
}
/**
* Outputs the header for the login page.
*
* @uses do_action() Calls the 'login_head' for outputting HTML in the 登录
* header.
* @uses apply_filters() Calls 'login_headerurl' for the top login link.
* @uses apply_filters() Calls 'login_headertitle' for the top login title.
* @uses apply_filters() Calls 'login_message' on the message to display in the
* header.
* @uses $error The error global, which is checked for displaying errors.
*
* @param string $title Optional. WordPress 登录 Page title to display in
* <title/> element.
* @param string $message Optional. Message to display in header.
* @param WP_Error $wp_error Optional. WordPress Error Object
*/
function login_header($title = '登录', $message = '', $wp_error = '') {
global $error, $interim_login, $current_site, $action;
// Don't index any of these forms
add_action( 'login_head', 'wp_no_robots' );
if ( empty($wp_error) )
$wp_error = new WP_Error();
// Shake it!
$shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password' );
$shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes );
if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) )
add_action( 'login_head', 'wp_shake_js', 12 );
?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php bloginfo('name'); ?> &rsaquo; <?php echo $title; ?></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="//www.quanqiusou.cn/adminimg/logincss/admin-login.css">
<script src="//www.quanqiusou.cn/adminimg/logincss/js/jquery.min.1.9.2.js"></script>
<!--[if lt IE 10]>
<script src="//www.quanqiusou.cn/adminimg/logincss/js/placeholder.js"></script>
<![endif]-->
<?php
if ( 'loggedout' == $wp_error->get_error_code() ) {
?>
<script>if("sessionStorage" in window){try{for(var key in sessionStorage){if(key.indexOf("wp-autosave-")!=-1){sessionStorage.removeItem(key)}}}catch(e){}};</script>
<?php
}
$login_header_url = apply_filters( 'login_headerurl', $login_header_url );
$login_header_title = apply_filters( 'login_headertitle', $login_header_title );
$classes = array( 'login-action-' . $action, 'wp-core-ui' );
if ( wp_is_mobile() )
$classes[] = 'mobile';
if ( is_rtl() )
$classes[] = 'rtl';
if ( $interim_login ) {
$classes[] = 'interim-login';
?>
<style type="text/css">html{background-color: transparent;}</style>
<?php
if ( 'success' === $interim_login )
$classes[] = 'interim-login-success';
}
$classes = apply_filters( 'login_body_class', $classes, $action );
?>
</head>
<body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
<video class="login-bg" loop="loop" autoplay="autoplay">
<source src="//www.quanqiusou.cn/adminimg/login_bg.mp4" type="video/mp4" />
<source src="//www.quanqiusou.cn/adminimg/login_bg.ogv" type="video/ogg" />
<source src="//www.quanqiusou.cn/adminimg/login_bg.webm" type="video/webm" />
</video>
<div id="login" class="login-container">
<div class="login-wrap">
<div class="login-logo"><img src="//www.quanqiusou.cn/adminimg/login_logo.png"></div>
<div class="login-form">
<?php
unset( $login_header_url, $login_header_title );
$message = apply_filters('login_message', $message);
if ( !empty( $message ) )
echo $message . "\n";
// In case a plugin uses $error rather than the $wp_errors object
if ( !empty( $error ) ) {
$wp_error->add('error', $error);
unset($error);
}
if ( $wp_error->get_error_code() ) {
$errors = '';
$messages = '';
foreach ( $wp_error->get_error_codes() as $code ) {
$severity = $wp_error->get_error_data($code);
foreach ( $wp_error->get_error_messages($code) as $error ) {
if ( 'message' == $severity )
$messages .= ' ' . $error . "<br />\n";
else
$errors .= ' ' . $error . "<br />\n";
}
}
if ( !empty($errors) )
echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\n";
if ( !empty($messages) )
echo '<div id="login_error">' . apply_filters('login_messages', $messages) . "</div>\n";
}
} // End of login_header()
/**
* Outputs the footer for the login page.
*
* @param string $input_id Which input to auto-focus
*/
function login_footer($input_id = '') {
global $interim_login;
// Don't allow interim logins to navigate away from the page.
if ( ! $interim_login ): ?>
<?php endif; ?>
</div>
</div>
</div>
<?php if ( !empty($input_id) ) : ?>
<script type="text/javascript">
try{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){}
if(typeof wpOnload=='function')wpOnload();
</script>
<?php endif; ?>
<?php do_action('login_footer'); ?>
<div class="clear"></div>
</body>
</html>
<?php
}
function wp_shake_js() {
if ( wp_is_mobile() )
return;
?>
<script type="text/javascript">
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();}}};
function s(id,pos){g(id).left=pos+'px';}
function g(id){return document.getElementById(id).style;}
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){}}}
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);});
</script>
<?php
}
/**
* Handles sending password retrieval email to user.
*
* @uses $wpdb WordPress Database object
*
* @return bool|WP_Error True: when finish. WP_Error on error
*/
function retrieve_password() {
global $wpdb, $current_site;
$errors = new WP_Error();
if ( empty( $_POST['user_login'] ) ) {
$errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.'));
} else if ( strpos( $_POST['user_login'], '@' ) ) {
$user_data = get_user_by( 'email', trim( $_POST['user_login'] ) );
if ( empty( $user_data ) )
$errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));
} else {
$login = trim($_POST['user_login']);
$user_data = get_user_by('login', $login);
}
do_action('lostpassword_post');
if ( $errors->get_error_code() )
return $errors;
if ( !$user_data ) {
$errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.'));
return $errors;
}
// redefining user_login ensures we return the right case in the email
$user_login = $user_data->user_login;
$user_email = $user_data->user_email;
do_action('retreive_password', $user_login); // Misspelled and deprecated
do_action('retrieve_password', $user_login);
$allow = apply_filters('allow_password_reset', true, $user_data->ID);
if ( ! $allow )
return new WP_Error('no_password_reset', __('Password reset is not allowed for this user'));
else if ( is_wp_error($allow) )
return $allow;
$key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s", $user_login));
if ( empty($key) ) {
// Generate something random for a key...
$key = wp_generate_password(20, false);
do_action('retrieve_password_key', $user_login, $key);
// Now insert the new md5 key into the db
$wpdb->update($wpdb->users, array('user_activation_key' => $key), array('user_login' => $user_login));
}
$message = __('密码重设:') . "\r\n\r\n";
$message .= network_home_url( '/' ) . "\r\n\r\n";
$message .= sprintf(__('用户名: %s'), $user_login) . "\r\n\r\n";
$message .= __('若这不是您本人要求的,请忽略本邮件,密码不变。') . "\r\n\r\n";
$message .= __('要重置您的密码,请打开下面的链接:') . "\r\n\r\n";
$message .= '<' . network_site_url("admin.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n";
if ( is_multisite() )
$blogname = $GLOBALS['current_site']->site_name;
else
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$title = sprintf( __('密码重设邮件[GoodaoCMS]'), $blogname );
$title = apply_filters('retrieve_password_title', $title);
$message = apply_filters('retrieve_password_message', $message, $key);
if ( $message && !wp_mail($user_email, $title, $message) )
wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function.') );
return true;
}
/**
* Retrieves a user row based on password reset key and login
*
* @uses $wpdb WordPress Database object
*
* @param string $key Hash to validate sending user's password
* @param string $login The user login
* @return object|WP_Error User's database row on success, error object for invalid keys
*/
function check_password_reset_key($key, $login) {
global $wpdb;
$key = preg_replace('/[^a-z0-9]/i', '', $key);
if ( empty( $key ) || !is_string( $key ) )
return new WP_Error('invalid_key', __('Invalid key'));
if ( empty($login) || !is_string($login) )
return new WP_Error('invalid_key', __('Invalid key'));
$user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE user_activation_key = %s AND user_login = %s", $key, $login));
if ( empty( $user ) )
return new WP_Error('invalid_key', __('Invalid key'));
return $user;
}
/**
* Handles resetting the user's password.
*
* @param object $user The user
* @param string $new_pass New password for the user in plaintext
*/
function reset_password($user, $new_pass) {
do_action('password_reset', $user, $new_pass);
wp_set_password($new_pass, $user->ID);
wp_password_change_notification($user);
}
/**
* Handles registering a new user.
*
* @param string $user_login User's username for logging in
* @param string $user_email User's email address to send password and add
* @return int|WP_Error Either user's ID or error on failure.
*/
function register_new_user( $user_login, $user_email ) {
$errors = new WP_Error();
$sanitized_user_login = sanitize_user( $user_login );
$user_email = apply_filters( 'user_registration_email', $user_email );
// Check the username
if ( $sanitized_user_login == '' ) {
$errors->add( 'empty_username', __( '<strong>ERROR</strong>: Please enter a username.' ) );
} elseif ( ! validate_username( $user_login ) ) {
$errors->add( 'invalid_username', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
$sanitized_user_login = '';
} elseif ( username_exists( $sanitized_user_login ) ) {
$errors->add( 'username_exists', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ) );
}
// Check the e-mail address
if ( $user_email == '' ) {
$errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please type your e-mail address.' ) );
} elseif ( ! is_email( $user_email ) ) {
$errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ) );
$user_email = '';
} elseif ( email_exists( $user_email ) ) {
$errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ) );
}
do_action( 'register_post', $sanitized_user_login, $user_email, $errors );
$errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );
if ( $errors->get_error_code() )
return $errors;
$user_pass = wp_generate_password( 12, false);
$user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
if ( ! $user_id ) {
$errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn&#8217;t register you&hellip; please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
return $errors;
}
update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag.
wp_new_user_notification( $user_id, $user_pass );
return $user_id;
}
//
// Main
//
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';
$errors = new WP_Error();
if ( isset($_GET['key']) )
$action = 'resetpass';
// validate action so as to default to the login screen
if ( !in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login' ), true ) && false === has_filter( 'login_form_' . $action ) )
$action = 'login';
nocache_headers();
header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));
if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set
if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) )
$_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );
$url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) );
if ( $url != get_option( 'siteurl' ) )
update_option( 'siteurl', $url );
}
//Set a cookie now to see if they are supported by the browser.
setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN);
if ( SITECOOKIEPATH != COOKIEPATH )
setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
// allow plugins to override the default actions, and to add extra actions if they want
do_action( 'login_init' );
do_action( 'login_form_' . $action );
$http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
$interim_login = isset($_REQUEST['interim-login']);
switch ($action) {
case 'postpass' :
require_once ABSPATH . 'wp-includes/class-phpass.php';
$hasher = new PasswordHash( 8, true );
// 10 days
setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), time() + 10 * DAY_IN_SECONDS, COOKIEPATH );
wp_safe_redirect( wp_get_referer() );
exit();
break;
case 'logout' :
check_admin_referer('log-out');
wp_logout();
$redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'admin.php?loggedout=true';
wp_safe_redirect( $redirect_to );
exit();
break;
case 'lostpassword' :
case 'retrievepassword' :
if ( $http_post ) {
$errors = retrieve_password();
if ( !is_wp_error($errors) ) {
$redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'admin.php?checkemail=confirm';
wp_safe_redirect( $redirect_to );
exit();
}
}
if ( isset($_GET['error']) && 'invalidkey' == $_GET['error'] ) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.'));
$redirect_to = apply_filters( 'lostpassword_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );
do_action('lost_password');
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);
$user_login = isset($_POST['user_login']) ? wp_unslash($_POST['user_login']) : '';
?>
<?php
login_footer('user_login');
break;
case 'resetpass' :
case 'rp' :
$user = check_password_reset_key($_GET['key'], $_GET['login']);
if ( is_wp_error($user) ) {
wp_redirect( site_url('admin.php?action=lostpassword&error=invalidkey') );
exit;
}
$errors = new WP_Error();
if ( isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2'] )
$errors->add( 'password_reset_mismatch', __( 'The passwords do not match.' ) );
do_action( 'validate_password_reset', $errors, $user );
if ( ( ! $errors->get_error_code() ) && isset( $_POST['pass1'] ) && !empty( $_POST['pass1'] ) ) {
reset_password($user, $_POST['pass1']);
login_header( __( 'Password Reset' ), '<p class="message reset-pass">' . __( 'Your password has been reset.' ) . ' <a href="' . esc_url( wp_login_url() ) . '">' . __( '登录' ) . '</a></p>' );
login_footer();
exit;
}
wp_enqueue_script('utils');
wp_enqueue_script('user-profile');
login_header(__('Reset Password'), '<p class="message reset-pass">' . __('Enter your new password below.') . '</p>', $errors );
?>
<p id="nav">
<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( '登录' ); ?></a>
<?php if ( get_option( 'users_can_register' ) ) : ?>
| <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?>
<?php endif; ?>
</p>
<?php
login_footer('user_pass');
break;
case 'register' :
if ( is_multisite() ) {
// Multisite uses wp-signup.php
wp_redirect( apply_filters( 'wp_signup_location', network_site_url('wp-signup.php') ) );
exit;
}
if ( !get_option('users_can_register') ) {
wp_redirect( site_url('admin.php?registration=disabled') );
exit();
}
$user_login = '';
$user_email = '';
if ( $http_post ) {
$user_login = $_POST['user_login'];
$user_email = $_POST['user_email'];
$errors = register_new_user($user_login, $user_email);
if ( !is_wp_error($errors) ) {
$redirect_to = !empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'admin.php?checkemail=registered';
wp_safe_redirect( $redirect_to );
exit();
}
}
$redirect_to = apply_filters( 'registration_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );
login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors);
?>
<?php
login_footer('user_login');
break;
case 'login' :
default:
$secure_cookie = '';
$customize_login = isset( $_REQUEST['customize-login'] );
if ( $customize_login )
wp_enqueue_script( 'customize-base' );
// If the user wants ssl but the session is not ssl, force a secure cookie.
if ( !empty($_POST['log']) && !force_ssl_admin() ) {
$user_name = sanitize_user($_POST['log']);
if ( $user = get_user_by('login', $user_name) ) {
if ( get_user_option('use_ssl', $user->ID) ) {
$secure_cookie = true;
force_ssl_admin(true);
}
}
}
if ( isset( $_REQUEST['redirect_to'] ) ) {
$redirect_to = $_REQUEST['redirect_to'];
// Redirect to https if user wants ssl
if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') )
$redirect_to = preg_replace('|^http://|', 'https://', $redirect_to);
} else {
$redirect_to = admin_url();
}
$reauth = empty($_REQUEST['reauth']) ? false : true;
// 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
// 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
// the admin via http or https.
if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) )
$secure_cookie = false;
$user = wp_signon('', $secure_cookie);
$redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);
if ( !is_wp_error($user) && !$reauth ) {
if ( $interim_login ) {
$message = '<p class="message">' . __('You have logged in successfully.') . '</p>';
$interim_login = 'success';
login_header( '', $message ); ?>
</div>
<?php do_action( 'login_footer' ); ?>
<?php if ( $customize_login ) : ?>
<script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script>
<?php endif; ?>
</body></html>
<?php exit;
}
if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) {
// 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.
if ( is_multisite() && !get_active_blog_for_user($user->ID) && !is_super_admin( $user->ID ) )
$redirect_to = user_admin_url();
elseif ( is_multisite() && !$user->has_cap('read') )
$redirect_to = get_dashboard_url( $user->ID );
elseif ( !$user->has_cap('edit_posts') )
$redirect_to = admin_url('profile.php');
}
wp_safe_redirect($redirect_to);
exit();
}
$errors = $user;
// Clear errors if loggedout is set.
if ( !empty($_GET['loggedout']) || $reauth )
$errors = new WP_Error();
// If cookies are disabled we can't 登录 even with a valid user+pass
if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) )
$errors->add('test_cookie', __("刷新Cookie后再尝试登录"));
if ( $interim_login ) {
if ( ! $errors->get_error_code() )
$errors->add('expired', __('Session expired. Please 登录 again. You will not move away from this page.'), 'message');
} else {
// Some parts of this script use the main login form to display a message
if ( isset($_GET['loggedout']) && true == $_GET['loggedout'] )
$errors->add('loggedout', __('您已登出!'), 'message');
elseif ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] )
$errors->add('registerdisabled', __('User registration is currently not allowed.'));
elseif ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] )
$errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message');
elseif ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )
$errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
elseif ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )
$errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
elseif ( strpos( $redirect_to, 'about.php?updated' ) )
$errors->add('updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to experience the awesomeness.' ), 'message' );
}
$errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );
// Clear any stale cookies.
if ( $reauth )
wp_clear_auth_cookie();
login_header(__('登录'), '', $errors);
if ( isset($_POST['log']) )
$user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(wp_unslash($_POST['log'])) : '';
$rememberme = ! empty( $_POST['rememberme'] );
?>
<form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'admin.php', 'login_post' ) ); ?>" method="post">
<div class="login-ipt-item">
<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" />
</div>
<div class="login-ipt-item">
<input type="password" name="pwd" id="user_pass" class="input login-ipt-txt" value="" size="20" placeholder="密 码" required="required" />
<div class="forgetmenot">
<label for="rememberme">
<span class="check-box"><i></i><input name="rememberme" type="checkbox" id="rememberme" value="forever" <?php checked( $rememberme ); ?> /></span>
记住密码
</label>
</div>
</div>
<?php do_action('login_form'); ?>
<div class="login-ipt-item">
<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large login-button" value="<?php esc_attr_e('登 录'); ?>" />
<?php if ( $interim_login ) { ?>
<input type="hidden" name="interim-login" value="1" />
<?php } else { ?>
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />
<?php } ?>
<?php if ( $customize_login ) : ?>
<input type="hidden" name="customize-login" value="1" />
<?php endif; ?>
<input type="hidden" name="testcookie" value="1" />
</div>
</form>
<?php if ( ! $interim_login ) { ?>
<p id="nav">
<?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) : ?>
<?php if ( get_option( 'users_can_register' ) ) : ?>
<?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?> |
<?php endif; ?>
<?php endif; ?>
</p>
<?php } ?>
<script type="text/javascript">
function wp_attempt_focus(){
setTimeout( function(){ try{
<?php if ( $user_login || $interim_login ) { ?>
d = document.getElementById('user_pass');
d.value = '';
<?php } else { ?>
d = document.getElementById('user_login');
<?php if ( 'invalid_username' == $errors->get_error_code() ) { ?>
if( d.value != '' )
d.value = '';
<?php
}
}?>
d.focus();
d.select();
} catch(e){}
}, 200);
}
<?php if ( !$error ) { ?>
wp_attempt_focus();
<?php } ?>
if(typeof wpOnload=='function')wpOnload();
<?php if ( $interim_login ) { ?>
(function(){
try {
var i, links = document.getElementsByTagName('a');
for ( i in links ) {
if ( links[i].href )
links[i].target = '_blank';
}
} catch(e){}
}());
<?php } ?>
</script>
</div>
</div>
</div>
<script>
// checkbox
$(function(){
$('.check-box').each(function(){
$('.check-box').find('input').click(function(){
if($(this).is(':checked')){
$(this).attr('checked','true');
$(this).parents('.check-box').addClass('checked');
}
else{
$(this).parents('.check-box').removeClass('checked');
}
})
});
$('.check-box').each(function(){
if($(this).find('input').is(':checked')){
$(this).find('input').attr('checked','true');
!$(this).addClass('checked');
}
else{
!$(this).removeClass('checked');
}
});
})
</script>
</body>
</html><?php
break;
} // end action switch
\ No newline at end of file
... ...
@charset "utf-8";
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;}
body,html,input,button,textarea{color:#666;font:12px/1.8 Arial,Tahoma,Verdana,Helvetica,sans-serif;}
article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block;}
body{background:#eff0f4;}
h1{font-size:18px;}
h2{font-size:16px;}
h3,h4,h5{font-size:14px;}
img{border:none;vertical-align:middle;}
li{list-style:none;}
i,em{font-style:normal;}
a{color:#666;text-decoration:none;}
a:focus{outline:none;}
a:hover{color:#333;}
input[type="text"]:focus{outline:none;}
input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;}
input[type="reset"]::-moz-focus-inner,input[type="button"]::-moz-focus-inner,input[type="submit"]::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner{border:none;padding:0;}
/* 清除浮动 */
.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;}
* 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;}
* +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;}
/* 小图 */
.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;}
/* 交互 */
.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;}
/* 字体 */
.mbox .tbar h2,.info-item .info-cont .tit {font-family:"Microsoft YaHei","微软雅黑";}
/* 页头
----------------------------- */
.admin-head{width:100%;height:50px;background:#25313f;position:relative;}
.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;}
.admin-head .admin-logo:hover{opacity:0.95;}
.admin-head .admin-logo a{display:block;width:100%;height:50px;text-indent:-9999em;overflow:hidden;}
.nav-bar{padding:0 0 0 220px;overflow:hidden;}
.left-nav{border-left:1px solid #304152;display:inline;float:left;margin-left:-1px;}
.left-nav li,.left-nav li a{color:#adbece;}
.left-nav li {line-height:20px;padding:15px 12px;}
.left-nav li a:hover{color:#fff;text-decoration:none;}
.left-nav li i,.left-nav li b{vertical-align:middle;}
.left-nav li i{display:inline-block;width:11px;height:15px;margin:0 3px 0 0;background-position:-87px 0;}
.left-nav li i{*display:inline;}
.left-nav li a:hover i{background-position:-99px 0;}
.admin-nav {display:inline;float:right;}
.admin-nav li {float:left;padding:5px 15px 5px 0;}
.admin-nav li,.admin-nav li a{color:#e4e9f2;}
.admin-nav li a{float:left;padding:10px 0;line-height:20px;}
.admin-nav li a:hover{color:#fff;}
.admin-nav li span.num{color:#fa6b5b;}
.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;}
.admin-nav li.menu-msg a{background-position:-89px -258px;}
.admin-nav li.menu-guide a{background-position:-89px -290px;}
.admin-nav li.menu-browse a{background-position:-89px -320px;}
.admin-nav li.menu-promote a{background-position:-89px -350px;}
/* 左侧栏
----------------------------- */
.admin-side{width:220px;background:#42586f;position:absolute;left:0;top:50px;bottom:0;overflow:hidden;z-index:333;}
.admin-side,.admin-side a,.admin-side a:hover{color:#fff;}
.admin-side .side-nav {width:100%;position:absolute;left:0;top:0;bottom:52px;overflow:hidden;overflow-y:auto;}
.admin-side .copyright {width:100%;line-height:21px;padding:5px 0;text-align:center;background:#2d3e50;position:absolute;left:0;bottom:0;}
.admin-side .copyright em{color:#00baff;}
.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;}
.ico-pc{background-position:12px 12px;}
.ico-product{background-position:12px -30px;}
.ico-news{background-position:12px -75px;}
.ico-page{background-position:12px -118px;}
.ico-site-map{background-position:12px -162px;}
.ico-file{background-position:12px -205px;}
.ico-seo{background-position:12px -251px;}
.ico-google-tool{background-position:12px -293px;}
.ico-count{background-position:12px -337px;}
.ico-user{background-position:12px -381px;}
.side-nav li{width:100%;position:relative;}
.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;}
.side-nav li a *{_cursor:pointer;}
.side-nav li a:hover,.side-nav li a.current{background:#3d5368;}
.side-nav li a:hover .ico-box b,.side-nav li a.active .ico-box b{left:0;}
.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);}
.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;}
.side-nav li span.ico-box b{display:block;width:100%;height:100%;position:absolute;top:0;bottom:0;left:-43px;}
.side-nav li span.ico-box i{opacity:0.5;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";filter:alpha(opacity=50);}
.side-nav li ul{display:none;background:#364b5e;}
.side-nav li b.ico-bg-red{background:#fa6b5b;}
.side-nav li b.ico-bg-yellow{background:#e6d15a;}
.side-nav li b.ico-bg-orange{background:#ffc333;}
.side-nav li b.ico-bg-green{background:#8ec165;}
.side-nav li b.ico-bg-green-2{background:#5dc372;}
.side-nav li b.ico-bg-cyan{background:#65cea6;}
.side-nav li b.ico-bg-blue{background:#4cc0c1;}
.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);}
.side-nav li li a:hover .ico-box i{opacity:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:alpha(opacity=100);}
.side-nav li li a:hover,.side-nav li li.active a {background:#2d3e50;}
.side-nav li.current ul{display:block;}
.side-nav li .ico-menu-arrow{display:block;width:8px;height:8px;background-position:-102px -243px;position:absolute;right:12px;top:15px;}
.side-nav li .active .ico-menu-arrow{background-position:-102px -213px;}
/* 首页右侧
----------------------------- */
.admin-wrap{padding:0 0 0 220px;background:#f1f5f9;position:absolute;left:0;top:86px;bottom:0;right:0;}
.admin-wrap .frame-wrap{width:100%;height:100%;overflow:hidden;}
.path-bar{background:#fff;line-height:20px;padding:8px 12px 8px 232px;border-bottom:1px solid #eee;}
.path-bar ul{height:27px;border-bottom:1px solid #eee;}
.path-bar li{float:left;}
.path-bar li i{padding:0 8px;}
.path-bar li.home i{content:"";display:none;}
.path-bar li.home a{display:inline-block;padding-left:20px;background-position:-95px -32px;}
.path-bar li.home a{*display:inline;}
.info-items{}
.info-item{width:48.5%;margin-bottom:20px;}
.item-left{float:left;}
.item-right{float:right;}
.info-item .info-cont {display:block;padding:13px 0 13px 15px;border-radius:5px;overflow:hidden;}
.info-item .info-cont,.info-item .info-cont a{color:#fff;}
.info-item .info-cont a:hover{text-decoration:underline;}
.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;}
.info-item .info-cont .tit {display:block;font-size:18px;font-weight:bold;line-height:1.4;margin:0 0 3px;}
.info-item .info-cont .text{display:block;}
.view-info,.product-info {float:left;}
.inquiry-info,.news-info{float:right;}
.top10,.dayok {float:left;}
.top30,.dayno{float:right;}
.top10,.dayok,.top30,.dayno i{height:100px;}
.top10 .info-cont{background:#fb8577;border:1px solid #dd7c6e;}
.top10 .info-cont i{background-position:-225px 0;}
.top10 .info-cont:hover{background:#fb7575;}
.top30 .info-cont {background:#5ab6df;border:1px solid #5ea8c9;}
.top30 .info-cont i{background-position:-284px 0;}
.top30 .info-cont:hover{background:#37aadd;}
.dayok .info-cont {background:#65cea6;border:1px solid #5cc29b;}
.dayok .info-cont i{background-position:-345px 0;}
.dayok .info-cont:hover{background:#3fc592;}
.dayno .info-cont {background:#eac85d;border:1px solid #dab952;}
.dayno .info-cont i{background-position:-406px 0;}
.dayno .info-cont:hover{background:#e3bd47;}
.view-info .info-cont{background:#fb8577;border:1px solid #dd7c6e;}
.view-info .info-cont i{background-position:0 0;}
.view-info .info-cont:hover{background:#fb7575;}
.inquiry-info .info-cont {background:#5ab6df;border:1px solid #5ea8c9;}
.inquiry-info .info-cont i{background-position:-53px 0;}
.inquiry-info .info-cont:hover{background:#37aadd;}
.product-info .info-cont {background:#65cea6;border:1px solid #5cc29b;}
.product-info .info-cont i{background-position:-109px 0;}
.product-info .info-cont:hover{background:#3fc592;}
.news-info .info-cont {background:#eac85d;border:1px solid #dab952;}
.news-info .info-cont i{background-position:-167px 0;}
.news-info .info-cont:hover{background:#e3bd47;}
.admin-main{padding:1.5%;}
.main-left {width:49%;float:left;}
.main-right{width:49%;float:right;}
.mbox{border-bottom:1px solid #ddd;border-radius:6px;background:#fff;margin-bottom:10px;}
.mbox .tbar {height:34px;line-height:34px;padding:6px 10px 6px 15px;}
.mbox .tbar h2{display:inline;float:left;color:#333;font-size:14px;}
.mbox .cont {padding:10px 15px 20px;display:none;}
.mbox .cont,.mbox .cont a{color:#757575;}
.mbox .cont img{max-width:100%;height:auto;}
.mbox .acts{display:inline;float:right;}
.mbox .ico-show-more,.mbox .ico-del,.mbox .ico-arrow{display:inline-block;width:34px;height:34px;}
.mbox .ico-show-more{background-position:-76px -89px;*display:inline;}
.mbox .ico-arrow{background-position:-43px -125px;}
.mbox .ico-del{background-position:-79px -125px;margin:0 0 0 2px;}
.show-cont .tbar{border-bottom:1px dotted #aaa;}
.show-cont .ico-show-more{background-position:-42px -89px;}
.show-cont .ico-arrow{background-position:-43px -159px;}
.box-active .cont{display:block;}
.mbox-mar-15{margin-bottom:20px;}
.main-foot{border-top:1px solid #ddd;padding:10px 0;text-align:right;margin:0 1.5%;}
@media screen and (min-width:1600px){
.info-item .info-cont{padding-left:20px;}
.info-item .info-cont i{margin-right:20px;}
}
@media screen and (max-width:1000px){
.admin-side{width:160px;}
.admin-wrap{padding-left:160px;}
}
.side-nav li.current ul{display: none;display: block\9;}
.side-nav li.current ul > ul{display: none\9;}
.side-nav li.current > ul{display: block;}
.side-nav ul .active{background: #2d3e50;}
.side-nav li ul ul li .ico-box {display: none;}
.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;}
... ...
{
"require": {
"qiniu/php-sdk": "^7.2"
}
}
... ...
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "960ef56a1c399a52a327a8a7ba0be847",
"packages": [
{
"name": "qiniu/php-sdk",
"version": "v7.2.10",
"source": {
"type": "git",
"url": "https://github.com/qiniu/php-sdk.git",
"reference": "d89987163f560ebf9dfa5bb25de9bd9b1a3b2bd8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/qiniu/php-sdk/zipball/d89987163f560ebf9dfa5bb25de9bd9b1a3b2bd8",
"reference": "d89987163f560ebf9dfa5bb25de9bd9b1a3b2bd8",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.3"
},
"type": "library",
"autoload": {
"psr-4": {
"Qiniu\\": "src/Qiniu"
},
"files": [
"src/Qiniu/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Qiniu",
"email": "sdk@qiniu.com",
"homepage": "http://www.qiniu.com"
}
],
"description": "Qiniu Resource (Cloud) Storage SDK for PHP",
"homepage": "http://developer.qiniu.com/",
"keywords": [
"cloud",
"qiniu",
"sdk",
"storage"
],
"time": "2019-10-28T10:23:23+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "1.1.0"
}
... ...
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit8a18182e993b8fc59e4294f066645c30::getLoader();
... ...
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
// PSR-4
private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array();
private $fallbackDirsPsr4 = array();
// PSR-0
private $prefixesPsr0 = array();
private $fallbackDirsPsr0 = array();
private $useIncludePath = false;
private $classMap = array();
private $classMapAuthoritative = false;
private $missingClasses = array();
private $apcuPrefix;
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', $this->prefixesPsr0);
}
return array();
}
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*/
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 base directories
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
}
/**
* Unregisters this instance as an autoloader.
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return bool|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*/
function includeFile($file)
{
include $file;
}
... ...
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
... ...
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);
... ...
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'841780ea2e1d6545ea3a253239d59c05' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/functions.php',
);
... ...
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);
... ...
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Qiniu\\' => array($vendorDir . '/qiniu/php-sdk/src/Qiniu'),
);
... ...
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit8a18182e993b8fc59e4294f066645c30
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit8a18182e993b8fc59e4294f066645c30', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit8a18182e993b8fc59e4294f066645c30', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit8a18182e993b8fc59e4294f066645c30::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit8a18182e993b8fc59e4294f066645c30::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire8a18182e993b8fc59e4294f066645c30($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire8a18182e993b8fc59e4294f066645c30($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
}
}
... ...
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit8a18182e993b8fc59e4294f066645c30
{
public static $files = array (
'841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php',
);
public static $prefixLengthsPsr4 = array (
'Q' =>
array (
'Qiniu\\' => 6,
),
);
public static $prefixDirsPsr4 = array (
'Qiniu\\' =>
array (
0 => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu',
),
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit8a18182e993b8fc59e4294f066645c30::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit8a18182e993b8fc59e4294f066645c30::$prefixDirsPsr4;
}, null, ClassLoader::class);
}
}
... ...
[
{
"name": "qiniu/php-sdk",
"version": "v7.2.10",
"version_normalized": "7.2.10.0",
"source": {
"type": "git",
"url": "https://github.com/qiniu/php-sdk.git",
"reference": "d89987163f560ebf9dfa5bb25de9bd9b1a3b2bd8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/qiniu/php-sdk/zipball/d89987163f560ebf9dfa5bb25de9bd9b1a3b2bd8",
"reference": "d89987163f560ebf9dfa5bb25de9bd9b1a3b2bd8",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.3"
},
"time": "2019-10-28T10:23:23+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Qiniu\\": "src/Qiniu"
},
"files": [
"src/Qiniu/functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Qiniu",
"email": "sdk@qiniu.com",
"homepage": "http://www.qiniu.com"
}
],
"description": "Qiniu Resource (Cloud) Storage SDK for PHP",
"homepage": "http://developer.qiniu.com/",
"keywords": [
"cloud",
"qiniu",
"sdk",
"storage"
]
}
]
... ...
# Changelog
## 7.2.7 (2018-11-06)
* 添加 QVM 内网上传到 KODO 的 zone 设置
## 7.2.6 (2018-05-18)
* 修复rs,rsf在不同机房默认的https域名
## 7.2.5 (2018-05-10)
* 修复表单上传中多余的参数checkCrc导致的fname错位问题
## 7.2.4 (2018-05-09)
### 增加
* 连麦功能
## 7.2.3 (2018-01-20)
### 增加
* 新加坡机房
### 修正
* 获取域名的入口域名
* http回复头部兼容大小写
## 7.2.2 (2017-11-06)
### 增加
* Qiniu算法的鉴权方法
## 7.1.4 (2017-06-21)
### 增加
* cdn 文件/目录 刷新
* cdn 获取 流量/带宽
* cdn 获取域名的访问日志列表
* cdn 对资源链接进行时间戳防盗链签名
## 7.1.3 (2016-11-18)
### 增加
* move, copy操作增加force参数
## 7.1.2 (2016-11-12)
### 修正
* 明确抛出获取各区域域名失败时的报错
## 7.1.1 (2016-11-02)
### 修正
* 多区域配置文件存储目录从home修改到tmp目录
## 7.1.0 (2016-10-22)
### 增加
* 多存储区域的支持
## 7.0.8 (2016-07-19)
### 增加
* demo
* https url 支持
* deleteAfterDays 策略
* 添加图片处理链接统一拼接方法 by @SherlockRen
## 7.0.7 (2016-01-12)
### 修正
* PersistentFop参数pipeline和notify_url失效
* resume 模式 close file inputstream
## 7.0.6 (2015-12-05)
### 修正
* php7.0 Json 对空字符串解析单元测试报错
* 开启安全模式或者设置可操作目录树时,设置CURLOPT_FOLLOWLOCATION报错, by @twocabbages
* fetch 支持不指定key, by @sinkcup
## 7.0.5 (2015-10-29)
### 增加
* 增加上传策略最小文件大小限制 fsizeMin
* 增加常见examples
## 7.0.4 (2015-07-23)
### 修正
* 一些地方的严格比较检查
* resumeupload 备用地址失效
## 7.0.3 (2015-07-10)
### 修改
* 多zone 支持
## 7.0.2 (2015-04-18)
### 修改
* fetch 接口返回内容调整
* pfop 接口调整
###修正
* exception 类调用
## 7.0.1 (2015-03-27)
### 增加
* 增加代码注释
## 7.0.0 (2015-02-03)
### 增加
* 简化上传接口
* 自动选择断点续上传还是直传
* 重构代码,接口和内部结构更清晰
* 改变mime
* 代码覆盖度报告
* policy改为array, 便于灵活增加,并加入过期字段检查
* 文件列表支持目录形式
* 利用元编程方式支持 fop 和 pfop
... ...
# 贡献代码指南
我们非常欢迎大家来贡献代码,我们会向贡献者致以最诚挚的敬意。
一般可以通过在Github上提交[Pull Request](https://github.com/qiniu/php-sdk)来贡献代码。
## Pull Request要求
- **[PSR-2 编码风格标准](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** 。要通过项目中的code sniffer检查。
- **代码格式** 提交前 请按 ./vendor/bin/phpcbf --standard=PSR2 进行格式化。
- **必须添加测试!** - 如果没有测试(单元测试、集成测试都可以),那么提交的补丁是不会通过的。
- **记得更新文档** - 保证`README.md`以及其他相关文档及时更新,和代码的变更保持一致性。
- **考虑我们的发布周期** - 我们的版本号会服从[SemVer v2.0.0](http://semver.org/),我们绝对不会随意变更对外的API。
- **创建feature分支** - 最好不要从你的master分支提交 pull request。
- **一个feature提交一个pull请求** - 如果你的代码变更了多个操作,那就提交多个pull请求吧。
- **清晰的commit历史** - 保证你的pull请求的每次commit操作都是有意义的。如果你开发中需要执行多次的即时commit操作,那么请把它们放到一起再提交pull请求。
## 运行测试
``` bash
./vendor/bin/phpunit tests/Qiniu/Tests/
```
... ...
The MIT License (MIT)
Copyright (c) 2014 Qiniu, Ltd.<sdk@qiniu.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
... ...
# Qiniu Cloud SDK for PHP
[![doxygen.io](http://doxygen.io/github.com/qiniu/php-sdk/?status.svg)](http://doxygen.io/github.com/qiniu/php-sdk/)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
[![Build Status](https://travis-ci.org/qiniu/php-sdk.svg)](https://travis-ci.org/qiniu/php-sdk)
[![Latest Stable Version](https://img.shields.io/packagist/v/qiniu/php-sdk.svg)](https://packagist.org/packages/qiniu/php-sdk)
[![Total Downloads](https://img.shields.io/packagist/dt/qiniu/php-sdk.svg)](https://packagist.org/packages/qiniu/php-sdk)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/qiniu/php-sdk/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/qiniu/php-sdk/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/qiniu/php-sdk/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/qiniu/php-sdk/?branch=master)
[![Join Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/qiniu/php-sdk?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![@qiniu on weibo](http://img.shields.io/badge/weibo-%40qiniutek-blue.svg)](http://weibo.com/qiniutek)
## 安装
* 通过composer,这是推荐的方式,可以使用composer.json 声明依赖,或者运行下面的命令。SDK 包已经放到这里 [`qiniu/php-sdk`][install-packagist]
```bash
$ composer require qiniu/php-sdk
```
* 直接下载安装,SDK 没有依赖其他第三方库,但需要参照 composer的autoloader,增加一个自己的autoloader程序。
## 运行环境
| Qiniu SDK版本 | PHP 版本 |
|:--------------------:|:---------------------------:|
| 7.x | cURL extension, 5.3 - 5.6,7.0 |
| 6.x | cURL extension, 5.2 - 5.6 |
## 使用方法
### 上传
```php
use Qiniu\Storage\UploadManager;
use Qiniu\Auth;
...
$upManager = new UploadManager();
$auth = new Auth($accessKey, $secretKey);
$token = $auth->uploadToken($bucketName);
list($ret, $error) = $upManager->put($token, 'formput', 'hello world');
...
```
## 测试
``` bash
$ ./vendor/bin/phpunit tests/Qiniu/Tests/
```
## 常见问题
- $error保留了请求响应的信息,失败情况下ret 为none, 将$error可以打印出来,提交给我们。
- API 的使用 demo 可以参考 [单元测试](https://github.com/qiniu/php-sdk/blob/master/tests)
## 代码贡献
详情参考[代码提交指南](https://github.com/qiniu/php-sdk/blob/master/CONTRIBUTING.md)
## 贡献记录
- [所有贡献者](https://github.com/qiniu/php-sdk/contributors)
## 联系我们
- 如果需要帮助,请提交工单(在portal右侧点击咨询和建议提交工单,或者直接向 support@qiniu.com 发送邮件)
- 如果有什么问题,可以到问答社区提问,[问答社区](http://qiniu.segmentfault.com/)
- 更详细的文档,见[官方文档站](http://developer.qiniu.com/)
- 如果发现了bug, 欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues)
- 如果有功能需求,欢迎提交 [issue](https://github.com/qiniu/php-sdk/issues)
- 如果要提交代码,欢迎提交 pull request
- 欢迎关注我们的[微信](http://www.qiniu.com/#weixin) [微博](http://weibo.com/qiniutek),及时获取动态信息。
## 代码许可
The MIT License (MIT).详情见 [License文件](https://github.com/qiniu/php-sdk/blob/master/LICENSE).
[packagist]: http://packagist.org
[install-packagist]: https://packagist.org/packages/qiniu/php-sdk
... ...
<?php
function classLoader($class)
{
$path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
$file = __DIR__ . '/src/' . $path . '.php';
if (file_exists($file)) {
require_once $file;
}
}
spl_autoload_register('classLoader');
require_once __DIR__ . '/src/Qiniu/functions.php';
... ...
{
"name": "qiniu/php-sdk",
"type": "library",
"description": "Qiniu Resource (Cloud) Storage SDK for PHP",
"keywords": ["qiniu", "storage", "sdk", "cloud"],
"homepage": "http://developer.qiniu.com/",
"license": "MIT",
"authors": [
{
"name": "Qiniu",
"email": "sdk@qiniu.com",
"homepage": "http://www.qiniu.com"
}
],
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.3"
},
"autoload": {
"psr-4": {"Qiniu\\": "src/Qiniu"},
"files": ["src/Qiniu/functions.php"]
}
}
... ...
# Rtc Streaming Cloud Server-Side Library For PHP
## Features
- Appclient
- [x] 创建房间: client->createApp()
- [x] 查看房间: client->getApp()
- [x] 删除房间: client->deleteApp()
- [x] 生成房间token: client->appToken()
## Contents
- [Installation](#installation)
- [Usage](#usage)
- [Configuration](#configuration)
- [App](#app)
- [Create a app](#create-a-app)
- [Get a app](#get-a-app)
- [Delete a app](#delete-a-app)
- [Generate a app token](#generate-a-app-token)
## Usage
### App
#### Create a app
```php
$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
$sk = "xxxx";
$auth = new Auth($ak, $sk);
$client = new Qiniu\Rtc\AppClient($auth);
$resp=$client->createApp("901","testApp");
print_r($resp);
```
#### Get an app
```php
$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
$sk = "xxxx";
$auth = new Auth($ak, $sk);
$client = new Qiniu\Rtc\AppClient($auth);
$resp=$client->getApp("deq02uhb6");
print_r($resp);
```
#### Delete an app
```php
$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
$sk = "xxxx";
$auth = new Auth($ak, $sk);
$client = new Qiniu\Rtc\AppClient($auth);
$resp=$client->deleteApp("deq02uhb6");
print_r($resp);
```
#### Generate an app token
```php
$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5";
$sk = "xxxx";
$auth = new Auth($ak, $sk);
$client = new Qiniu\Rtc\AppClient($auth);
$resp=$client->appToken("deq02uhb6", "lfx", '1111', (time()+3600), 'user');
print_r($resp);
```
\ No newline at end of file
... ...
<?php
require_once("../../autoload.php");
use \Qiniu\Auth;
$ak = 'gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5';
$sk = 'xxxx';
$auth = new Auth($ak, $sk);
$client = new Qiniu\Rtc\AppClient($auth);
$hub = 'lfxlive';
$title = 'lfxl';
try {
//创建app
$resp = $client->createApp($hub, $title, $maxUsers);
print_r($resp);
// 获取app状态
$resp = $client->getApp('dgdl5ge8y');
print_r($resp);
//修改app状态
$mergePublishRtmp = null;
$mergePublishRtmp['enable'] = true;
$resp = $client->updateApp('dgdl5ge8y', $hub, $title, $maxUsers, $mergePublishRtmp);
print_r($resp);
//删除app
$resp = $client->deleteApp('dgdl5ge8y');
print_r($resp);
//获取房间连麦的成员
$resp=$client->listUser("dgbfvvzid", 'lfxl');
print_r($resp);
//剔除房间的连麦成员
$resp=$client->kickUser("dgbfvvzid", 'lfx', "qiniu-f6e07b78-4dc8-45fb-a701-a9e158abb8e6");
print_r($resp);
// 列举房间
$resp=$client->listActiveRooms("dgbfvvzid", 'lfx', null, null);
print_r($resp);
//鉴权的有效时间: 1个小时.
$resp = $client->appToken("dgd4vecde", "lfxl", '1111', (time()+3600), 'user');
print_r($resp);
} catch (\Exception $e) {
echo "Error:", $e, "\n";
}
... ...
<?php
require_once("../../autoload.php");
use \Qiniu\Auth;
$ak="xxxx";
$sk="xxxx";
$auth = new Auth($ak, $sk);
$client = new Qiniu\Sms\Sms($auth);
//发送信息模块
$template_id="1131792074274775040";
$mobiles=array("18011111111","18011111111");
$code = array('code' => 'code' );
try {
//发送短信
$resp = $client->sendMessage($template_id, $mobiles, $code);
print_r($resp);
} catch (\Exception $e) {
echo "Error:", $e, "\n";
}exit;
//模板模块
$name="tstest001";
$template="tesy001 ${code}";
$type="notification";
$description="tstest001";
$signature_id="1131464448834277376";
$id="1131810682442883072";
try {
//创建模板
$resp = $client->createTemplate($name, $template, $type, $description, $signature_id);
print_r($resp);
//查询模板
$resp = $client->queryTemplate();
print_r($resp);
//修改模板
$resp = $client->updateTemplate($id, $name, $template, $description, $signature_id);
print_r($resp);
//删除模板
$resp = $client->deleteTemplate($id);
print_r($resp);
} catch (\Exception $e) {
echo "Error:", $e, "\n";
}
//签名模块
$signature = 'lfxlive2';
$source = 'enterprises_and_institutions';
$pic="/Users/Desktop/sss.jpg";
$audit_status="passed";
$page=1;
$page_size=1;
$id="1131464448834277376";
try {
//创建签名
$resp = $client->createSignature($signature, $source, $pic);
print_r($resp);
//查询签名
$resp = $client->checkSignature($audit_status);
//修改签名
$resp = $client->updateSignature($id, $signature, $source, $pic);
print_r($resp);
//删除ID
$resp = $client->deleteSignature($id);
print_r($resp);
} catch (\Exception $e) {
echo "Error:", $e, "\n";
}
... ...
# examples
这些 examples 旨在帮助你快速了解使用七牛的sdk。这些demo都是可以直接运行的, 但是在运行之前需要填上您自己的参数。
比如:
* `$bucket` 需要填上您想操作的 [bucket名字](http://developer.qiniu.com/docs/v6/api/overview/concepts.html#bucket)
* `$accessKey` 和 `$secretKey` 可以在我们的[管理后台](https://portal.qiniu.com/setting/key)找到。
* 在进行`视频转码`, `压缩文件`等异步操作时 需要使用到的队列名称也可以在我们[管理后台](https://portal.qiniu.com/mps/pipeline)新建。
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$name = 'demo';
$prefix = 'test';
$delete_after_days = 80;
$to_line_after_days =70;
list($Info, $err) = $bucketManager->bucketLifecycleRule(
$bucket,
$name,
$prefix,
$delete_after_days,
$to_line_after_days
);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Cdn\CdnManager;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Qiniu\Auth($accessKey, $secretKey);
$cdnManager = new CdnManager($auth);
//获取流量和带宽数据
//参考文档:http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html
$domains = array(
"javasdk.qiniudn.com",
"phpsdk.qiniudn.com"
);
$startDate = "2017-08-20";
$endDate = "2017-08-21";
//5min or hour or day
$granularity = "day";
//获取带宽数据
list($bandwidthData, $getBandwidthErr) = $cdnManager->getBandwidthData(
$domains,
$startDate,
$endDate,
$granularity
);
if ($getBandwidthErr != null) {
var_dump($getBandwidthErr);
} else {
echo "get bandwidth data success\n";
print_r($bandwidthData);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Cdn\CdnManager;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Qiniu\Auth($accessKey, $secretKey);
$cdnManager = new CdnManager($auth);
//获取流量和带宽数据
//参考文档:http://developer.qiniu.com/article/fusion/api/traffic-bandwidth.html
$domains = array(
"javasdk.qiniudn.com",
"phpsdk.qiniudn.com"
);
$startDate = "2017-08-20";
$endDate = "2017-08-21";
//5min or hour or day
$granularity = "day";
//获取流量数据
list($fluxData, $getFluxErr) = $cdnManager->getFluxData($domains, $startDate, $endDate, $granularity);
if ($getFluxErr != null) {
var_dump($getFluxErr);
} else {
echo "get flux data success\n";
print_r($fluxData);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Cdn\CdnManager;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Qiniu\Auth($accessKey, $secretKey);
$cdnManager = new CdnManager($auth);
$domains = array(
"javasdk.qiniudn.com",
"phpsdk.qiniudn.com"
);
$logDate = '2017-08-20';
//获取日志下载链接
//参考文档:http://developer.qiniu.com/article/fusion/api/log.html
list($logListData, $getLogErr) = $cdnManager->getCdnLogList($domains, $logDate);
if ($getLogErr != null) {
var_dump($getLogErr);
} else {
echo "get cdn log list success\n";
print_r($logListData);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Cdn\CdnManager;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Qiniu\Auth($accessKey, $secretKey);
//待刷新的文件列表和目录,文件列表最多一次100个,目录最多一次10个
//参考文档:http://developer.qiniu.com/article/fusion/api/refresh.html
$urls = array(
"http://phpsdk.qiniudn.com/qiniu.jpg",
"http://phpsdk.qiniudn.com/qiniu2.jpg",
);
//刷新目录需要联系七牛技术支持开通账户权限
$dirs = array(
"http://phpsdk.qiniudn.com/test/"
);
$cdnManager = new CdnManager($auth);
// 目前客户默认没有目录刷新权限,刷新会有400038报错,参考:https://developer.qiniu.com/fusion/api/1229/cache-refresh
// 需要刷新目录请工单联系技术支持 https://support.qiniu.com/tickets/category
list($refreshResult, $refreshErr) = $cdnManager->refreshUrlsAndDirs($urls, $dirs);
if ($refreshErr != null) {
var_dump($refreshErr);
} else {
echo "refresh request sent\n";
print_r($refreshResult);
}
//如果只有刷新链接或者目录的需求,可以分布使用
list($refreshResult, $refreshErr) = $cdnManager->refreshUrls($urls);
if ($refreshErr != null) {
var_dump($refreshErr);
} else {
echo "refresh request sent\n";
print_r($refreshResult);
}
list($refreshResult, $refreshErr) = $cdnManager->refreshDirs($dirs);
if ($refreshErr != null) {
var_dump($refreshErr);
} else {
echo "refresh request sent\n";
print_r($refreshResult);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Cdn\CdnManager;
//创建时间戳防盗链
//时间戳防盗链密钥,后台获取
$encryptKey = 'your_domain_timestamp_antileech_encryptkey';
//带访问协议的域名
$url1 = 'http://phpsdk.qiniuts.com/24.jpg?avinfo';
$url2 = 'http://phpsdk.qiniuts.com/24.jpg';
//有效期时间(单位秒)
$durationInSeconds = 3600;
$signedUrl = CdnManager::createTimestampAntiLeechUrl($url1, $encryptKey, $durationInSeconds);
print($signedUrl);
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$name = 'xxxx';
list($Info, $err) = $bucketManager->deleteBucket($name);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$name = 'demo';
list($Info, $err) = $bucketManager->deleteBucketEvent($bucket, $name);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$name = 'demo';
list($Info, $err) = $bucketManager->deleteBucketLifecycleRule($bucket, $name);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
list($Info, $err) = $bucketManager->getBucketEvents($bucket);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
list($Info, $err) = $bucketManager->getBucketLifecycleRules($bucket);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$region = 'z1';
list($Info, $err) = $bucketManager->listbuckets($region);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
list($Info, $err) = $bucketManager->getBucketQuota($bucket);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
list($Info, $err) = $bucketManager->bucketInfo($bucket);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$region = 'z1';
list($Info, $err) = $bucketManager->bucketInfos($region);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
list($Info, $err) = $bucketManager->getCorsRules($bucket);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
// 引入图片处理类
use Qiniu\Processing\ImageUrlBuilder;
$imageUrlBuilder = new ImageUrlBuilder();
// 要处理图片
$url = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg';
$url2 = 'http://78re52.com1.z0.glb.clouddn.com/resource/gogopher.jpg?watermark/1/gravity/SouthEast/dx/0/dy/0/image/'
. 'aHR0cDovL2Fkcy1jZG4uY2h1Y2h1amllLmNvbS9Ga1R6bnpIY2RLdmRBUFc5cHZZZ3pTc21UY0tB';
$waterImage = 'http://developer.qiniu.com/resource/logo-2.jpg';
/**
* 缩略图链接拼接
*
* @param string $url 图片链接
* @param int $mode 缩略模式
* @param int $width 宽度
* @param int $height 长度
* @param string $format 输出类型 [可选]
* @param int $quality 图片质量 [可选]
* @param int $interlace 是否支持渐进显示 [可选]
* @param int $ignoreError 忽略结果 [可选]
* @return string
* @link http://developer.qiniu.com/code/v6/api/kodo-api/image/imageview2.html
* @author Sherlock Ren <sherlock_ren@icloud.com>
*/
$thumbLink = $imageUrlBuilder->thumbnail($url, 1, 100, 100);
// 函数方式调用 也可拼接多个操作参数 图片+水印
$thumbLink2 = \Qiniu\thumbnail($url2, 1, 100, 100);
var_dump($thumbLink, $thumbLink2);
/**
* 图片水印
*
* @param string $url 图片链接
* @param string $image 水印图片链接
* @param numeric $dissolve 透明度 [可选]
* @param string $gravity 水印位置 [可选]
* @param numeric $dx 横轴边距 [可选]
* @param numeric $dy 纵轴边距 [可选]
* @param numeric $watermarkScale 自适应原图的短边比例 [可选]
* @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html
* @return string
* @author Sherlock Ren <sherlock_ren@icloud.com>
*/
$waterLink = $imageUrlBuilder->waterImg($url, $waterImage);
// 函数调用方法
//$waterLink = \Qiniu\waterImg($url, $waterImage);
var_dump($waterLink);
/**
* 文字水印
*
* @param string $url 图片链接
* @param string $text 文字
* @param string $font 文字字体
* @param string $fontSize 文字字号
* @param string $fontColor 文字颜色 [可选]
* @param numeric $dissolve 透明度 [可选]
* @param string $gravity 水印位置 [可选]
* @param numeric $dx 横轴边距 [可选]
* @param numeric $dy 纵轴边距 [可选]
* @link http://developer.qiniu.com/code/v6/api/kodo-api/image/watermark.html#text-watermark
* @return string
* @author Sherlock Ren <sherlock_ren@icloud.com>
*/
$textLink = $imageUrlBuilder->waterText($url, '你瞅啥', '微软雅黑', 300);
// 函数调用方法
// $textLink = \Qiniu\waterText($url, '你瞅啥', '微软雅黑', 300);
var_dump($textLink);
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
$accessKey = 'Access_Key';
$secretKey = 'Secret_Key';
$auth = new Auth($accessKey, $secretKey);
// 要转码的文件所在的空间。
$bucket = 'Bucket_Name';
// 转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline
$pipeline = 'pipeline_name';
// 初始化
$pfop = new PersistentFop($auth, $bucket, $pipeline);
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Processing\PersistentFop;
$pfop = new Qiniu\Processing\PersistentFop(null, null);
// 触发持久化处理后返回的 Id
$persistentId = 'z1.5b8a48e5856db843bc24cfc3';
// 通过persistentId查询该 触发持久化处理的状态
list($ret, $err) = $pfop->status($persistentId);
if ($err) {
print_r($err);
} else {
print_r($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
// 去我们的portal 后台来获取AK, SK
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$key = 'qiniu.png';
$auth = new Auth($accessKey, $secretKey);
// 异步任务的队列, 去后台新建: https://portal.qiniu.com/mps/pipeline
$pipeline = 'sdktest';
$pfop = new PersistentFop($auth, null);
// 进行zip压缩的url
$url1 = 'http://phpsdk.qiniudn.com/php-logo.png';
$url2 = 'http://phpsdk.qiniudn.com/1.png';
//压缩后的key
$zipKey = 'test.zip';
$fops = 'mkzip/2/url/' . \Qiniu\base64_urlSafeEncode($url1);
$fops .= '/url/' . \Qiniu\base64_urlSafeEncode($url2);
$fops .= '|saveas/' . \Qiniu\base64_urlSafeEncode("$bucket:$zipKey");
$notify_url = null;
$force = false;
list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notify_url, $force);
echo "\n====> pfop mkzip result: \n";
if ($err != null) {
var_dump($err);
} else {
echo "PersistentFop Id: $id\n";
$res = "http://api.qiniu.com/status/get/prefop?id=$id";
echo "Processing result: $res";
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
//对已经上传到七牛的视频发起异步转码操作
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
//要转码的文件所在的空间和文件名。
$key = 'qiniu.mp4';
//转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline
$pipeline = 'sdktest';
//转码完成后通知到你的业务服务器。
$notifyUrl = 'http://375dec79.ngrok.com/notify.php';
$force = false;
$config = new \Qiniu\Config();
$config->useHTTPS = true;
$pfop = new PersistentFop($auth, $config);
//要进行视频截图操作
$fops = "vframe/jpg/offset/1/w/480/h/360/rotate/90|saveas/" .
\Qiniu\base64_urlSafeEncode($bucket . ":qiniu_480x360.jpg");
list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force);
echo "\n====> pfop avthumb result: \n";
if ($err != null) {
var_dump($err);
} else {
echo "PersistentFop Id: $id\n";
}
//查询转码的进度和状态
list($ret, $err) = $pfop->status($id);
echo "\n====> pfop avthumb status: \n";
if ($err != null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
//对已经上传到七牛的视频发起异步转码操作
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
//要转码的文件所在的空间和文件名。
$key = 'qiniu.mp4';
//转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline
$pipeline = 'sdktest';
$force = false;
//转码完成后通知到你的业务服务器。
$notifyUrl = 'http://375dec79.ngrok.com/notify.php';
$config = new \Qiniu\Config();
//$config->useHTTPS=true;
$pfop = new PersistentFop($auth, $config);
//要进行转码的转码操作。 http://developer.qiniu.com/docs/v6/api/reference/fop/av/avthumb.html
$fops = "avthumb/mp4/s/640x360/vb/1.4m|saveas/" . \Qiniu\base64_urlSafeEncode($bucket . ":qiniu_640x360.mp4");
list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force);
echo "\n====> pfop avthumb result: \n";
if ($err != null) {
var_dump($err);
} else {
echo "PersistentFop Id: $id\n";
}
//查询转码的进度和状态
list($ret, $err) = $pfop->status($id);
echo "\n====> pfop avthumb status: \n";
if ($err != null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
//对已经上传到七牛的视频发起异步转码操作
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
//要转码的文件所在的空间和文件名。
$key = 'qiniu.mp4';
//转码是使用的队列名称。 https://portal.qiniu.com/mps/pipeline
$pipeline = 'sdktest';
//转码完成后通知到你的业务服务器。
$notifyUrl = 'http://375dec79.ngrok.com/notify.php';
$force = false;
$config = new \Qiniu\Config();
//$config->useHTTPS=true;
$pfop = new PersistentFop($auth, $config);
//需要添加水印的图片UrlSafeBase64
//可以参考http://developer.qiniu.com/code/v6/api/dora-api/av/video-watermark.html
$base64URL = Qiniu\base64_urlSafeEncode('http://devtools.qiniu.com/qiniu.png');
//水印参数
$fops = "avthumb/mp4/s/640x360/vb/1.4m/image/" . $base64URL . "|saveas/"
. \Qiniu\base64_urlSafeEncode($bucket . ":qiniu_wm.mp4");
list($id, $err) = $pfop->execute($bucket, $key, $fops, $pipeline, $notifyUrl, $force);
echo "\n====> pfop avthumb result: \n";
if ($err != null) {
var_dump($err);
} else {
echo "PersistentFop Id: $id\n";
}
//查询转码的进度和状态
list($ret, $err) = $pfop->status($id);
echo "\n====> pfop avthumb status: \n";
if ($err != null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
$accessKey = 'Access_Key';
$secretKey = 'Secret_Key';
$auth = new Auth($accessKey, $secretKey);
//要持久化处理的文件所在的空间和文件名。
$bucket = 'Bucket_Name';
//持久化处理使用的队列名称。 https://portal.qiniu.com/mps/pipeline
$pipeline = 'pipeline_name';
//持久化处理完成后通知到你的业务服务器。
$notifyUrl = 'http://375dec79.ngrok.com/notify.php';
$pfop = new PersistentFop($auth, $bucket, $pipeline, $notifyUrl);
$id = "z2.5955c739e3d0041bf80c9baa";
//查询持久化处理的进度和状态
list($ret, $err) = $pfop->status($id);
echo "\n====> pfop avthumb status: \n";
if ($err != null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Http\Client;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$argusManager = new \Qiniu\Storage\ArgusManager($auth, $config);
$reqBody = array();
$reqBody['uri'] = "xxxx";
$ops = array();
$ops = array(
array(
'op' => 'pulp',
'params' => array(
'labels' => array(
array(
'label' => "1",
'select' => 1,
'score' => 2,
),
)
)
),
);
$params = array();
$params = array(
'async' => false,
'vframe' => array(
'mode' => 1,
'interval' => 8,
)
);
$req = array();
$req['data'] = $reqBody;
$req['ops'] = $ops;
$req['params'] = $params;
$body = json_encode($req);
$vid = "xxxx";
list($ret, $err) = $argusManager->pulpVideo($body, $vid);
if ($err !== null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$private = 1;
list($Info, $err) = $bucketManager->putBucketAccessMode($bucket, $private);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$mode = 1;
list($Info, $err) = $bucketManager->putBucketAccessStyleMode($bucket, $mode);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$name = 'testdemo';
$prefix = 'test1';
$suffix = 'mp3';
$event = array("move","copy");
$callbackURL = 'http://www.qiniu.com';
list($Info, $err) = $bucketManager->putBucketEvent($bucket, $name, $prefix, $suffix, $event, $callbackURL);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$maxAge = 15768000;
list($Info, $err) = $bucketManager->putBucketMaxAge($bucket, $maxAge);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$size = 99999;
$count = 99;
list($Info, $err) = $bucketManager->putBucketQuota($bucket, $size, $count);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$mode = 1;
$norefer = "1";
$pattern = "*.qiniu.com";
list($Info, $err) = $bucketManager->putReferAntiLeech($bucket, $mode, $norefer, $pattern);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Etag;
$localFile = "/Users/jemy/Documents/qiniu.mp4";
list($etag, $err) = Etag::sum($localFile);
if ($err == null) {
echo "Etag: $etag";
} else {
var_dump($err);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
//每次最多不能超过1000个
$keyMimePairs = array(
'qiniu.mp4' => 'video/x-mp4',
'qiniu.png' => 'image/x-png',
'qiniu.jpg' => 'image/x-jpg'
);
$ops = $bucketManager->buildBatchChangeMime($bucket, $keyMimePairs);
list($ret, $err) = $bucketManager->batch($ops);
if ($err) {
print_r($err);
} else {
print_r($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
//每次最多不能超过1000个
$keys = array(
'qiniu.mp4',
'qiniu.png',
'qiniu.jpg'
);
$keyTypePairs = array();
//type=0表示普通存储,type=1表示低频存储
foreach ($keys as $key) {
$keyTypePairs[$key] = 1;
}
$ops = $bucketManager->buildBatchChangeType($bucket, $keyTypePairs);
list($ret, $err) = $bucketManager->batch($ops);
if ($err) {
print_r($err);
} else {
print_r($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
//每次最多不能超过1000个
$keys = array(
'qiniu.mp4',
'qiniu.png',
'qiniu.jpg'
);
$keyPairs = array();
foreach ($keys as $key) {
$keyPairs[$key] = $key . "_copy";
}
$srcBucket = $bucket;
$destBucket = $bucket;
$ops = $bucketManager->buildBatchCopy($srcBucket, $keyPairs, $destBucket, true);
list($ret, $err) = $bucketManager->batch($ops);
if ($err) {
print_r($err);
} else {
print_r($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
//每次最多不能超过1000个
$keys = array(
'qiniu.mp4',
'qiniu.png',
'qiniu.jpg'
);
$ops = $bucketManager->buildBatchDelete($bucket, $keys);
list($ret, $err) = $bucketManager->batch($ops);
if ($err) {
print_r($err);
} else {
print_r($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
//每次最多不能超过1000个
$keys = array(
'qiniu.mp4',
'qiniu.png',
'qiniu.jpg'
);
$keyDayPairs = array();
//day=0表示永久存储
foreach ($keys as $key) {
$keyDayPairs[$key] = 0;
}
$ops = $bucketManager->buildBatchDeleteAfterDays($bucket, $keyDayPairs);
list($ret, $err) = $bucketManager->batch($ops);
if ($err) {
print_r($err);
} else {
print_r($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
//每次最多不能超过1000个
$keys = array(
'qiniu.mp4',
'qiniu.png',
'qiniu.jpg'
);
$keyPairs = array();
foreach ($keys as $key) {
$keyPairs[$key . "_copy"] = $key . "_move";
}
$srcBucket = $bucket;
$destBucket = $bucket;
$ops = $bucketManager->buildBatchMove($srcBucket, $keyPairs, $destBucket, true);
list($ret, $err) = $bucketManager->batch($ops);
if ($err) {
print_r($err);
} else {
print_r($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
//每次最多不能超过1000个
$keys = array(
'qiniu.mp4',
'qiniu.png',
'qiniu.jpg'
);
$ops = $bucketManager->buildBatchStat($bucket, $keys);
list($ret, $err) = $bucketManager->batch($ops);
if ($err) {
print_r($err);
} else {
print_r($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
list($domains, $err) = $bucketManager->domains($bucket);
if ($err) {
print_r($err);
} else {
print_r($domains);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
list($buckets, $err) = $bucketManager->buckets(true);
if ($err) {
print_r($err);
} else {
print_r($buckets);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$key = 'qiniu.mp4';
$newMime = 'video/x-mp4';
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$err = $bucketManager->changeMime($bucket, $key, $newMime);
if ($err) {
print_r($err);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$key = "qiniu.jpg";
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$status = 1;//0表示启用;1表示禁用
$err = $bucketManager->changeStatus($bucket, $key, $status);
if ($err) {
print_r($err);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$key = "qiniu.mp4";
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$fileType = 1;//0 表示普通存储,1表示低频存储
$err = $bucketManager->changeType($bucket, $key, $fileType);
if ($err) {
print_r($err);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$key = "qiniu.mp4";
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$srcBucket = $bucket;
$destBucket = $bucket;
$srcKey = $key;
$destKey = $key . "_copy";
$err = $bucketManager->copy($srcBucket, $srcKey, $destBucket, $destKey, true);
if ($err) {
print_r($err);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$key = "qiniu.mp4_copy";
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$err = $bucketManager->delete($bucket, $key);
if ($err) {
print_r($err);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$key = 'qiniu.mp4';
$days = 10;
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$err = $bucketManager->deleteAfterDays($bucket, $key, $days);
if ($err) {
print_r($err);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
// 构建Auth对象
$auth = new Auth($accessKey, $secretKey);
// 私有空间中的外链 http://<domain>/<file_key>
$baseUrl = 'http://if-pri.qiniudn.com/qiniu.png?imageView2/1/h/500';
// 对链接进行签名
$signedUrl = $auth->privateDownloadUrl($baseUrl);
echo $signedUrl;
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Storage\BucketManager;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$bucketManager = new BucketManager($auth);
$url = 'http://devtools.qiniu.com/qiniu.png';
$key = time() . '.png';
// 指定抓取的文件保存名称
list($ret, $err) = $bucketManager->fetch($url, $bucket, $key);
echo "=====> fetch $url to bucket: $bucket key: $key\n";
if ($err !== null) {
var_dump($err);
} else {
print_r($ret);
}
// 不指定key时,以文件内容的hash作为文件名
$key = null;
list($ret, $err) = $bucketManager->fetch($url, $bucket, $key);
echo "=====> fetch $url to bucket: $bucket key: $(etag)\n";
if ($err !== null) {
var_dump($err);
} else {
print_r($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$key = "qiniu.mp4";
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$srcBucket = $bucket;
$destBucket = $bucket;
$srcKey = $key . "_copy";
$destKey = $key . "_move";
$err = $bucketManager->move($srcBucket, $srcKey, $destBucket, $destKey, true);
if ($err) {
print_r($err);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$key = "qiniu.mp4";
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$err = $bucketManager->prefetch($bucket, $key);
if ($err) {
print_r($err);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = 'gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5';
$secretKey = '9G4isTkVuj5ITPqH1ajhljJMTc2k4m-hZh5r5ZsK';
$bucket = 'file';
$domain = 'lfxfile.qiniuts.com';
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$err = $bucketManager->publishDomain($bucket, $domain);
if ($err) {
print_r($err);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$key = "qiniu.mp4";
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
list($fileInfo, $err) = $bucketManager->stat($bucket, $key);
if ($err) {
print_r($err);
} else {
print_r($fileInfo);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Storage\BucketManager;
// http://developer.qiniu.com/docs/v6/api/reference/rs/list.html#list-description
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$bucketManager = new BucketManager($auth);
// 要列取文件的公共前缀
$prefix = '';
// 上次列举返回的位置标记,作为本次列举的起点信息。
$marker = '';
// 本次列举的条目数
$limit = 200;
$delimiter = '/';
// 列举文件
do {
list($ret, $err) = $bucketManager->listFiles($bucket, $prefix, $marker, $limit, $delimiter);
if ($err !== null) {
echo "\n====> list file err: \n";
var_dump($err);
} else {
$marker = null;
if (array_key_exists('marker', $ret)) {
$marker = $ret['marker'];
}
echo "Marker: $marker\n";
echo "\nList Items====>\n";
//var_dump($ret['items']);
print('items count:' . count($ret['items']) . "\n");
if (array_key_exists('commonPrefixes', $ret)) {
print_r($ret['commonPrefixes']);
}
}
} while (!empty($marker));
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Storage\BucketManager;
// http://developer.qiniu.com/docs/v6/api/reference/rs/list.html#list-description
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
$bucketManager = new BucketManager($auth);
// 要列取文件的公共前缀
$prefix = '';
// 上次列举返回的位置标记,作为本次列举的起点信息。
$marker = '';
// 本次列举的条目数
$limit = 100;
$delimiter = '/';
// 列举文件
list($ret, $err) = $bucketManager->listFiles($bucket, $prefix, $marker, $limit, $delimiter);
if ($err !== null) {
echo "\n====> list file err: \n";
var_dump($err);
} else {
if (array_key_exists('marker', $ret)) {
echo "Marker:" . $ret["marker"] . "\n";
}
echo "\nList Iterms====>\n";
//var_dump($ret['items']);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Storage\BucketManager;
// http://developer.qiniu.com/docs/v6/api/reference/rs/list.html#list-description
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = 'xxxx';
$auth = new Auth($accessKey, $secretKey);
$bucketManager = new BucketManager($auth);
// 要列取文件的公共前缀
$prefix = '';
// 上次列举返回的位置标记,作为本次列举的起点信息。
$marker = '';
// 本次列举的条目数
$limit = 1000;
$delimiter = '';
list($ret, $err) = $bucketManager->listFilesv2($bucket, $prefix, $marker, $limit, $delimiter, true);
if ($err) {
print_r($err);
} else {
print_r($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Processing\PersistentFop;
// 后台来获取AK, SK
$accessKey = 'Access_Key';
$secretKey = 'Secret_Key';
//生成EncodedEntryURI的值
$entry = '<bucket>:<Key>';//<Key>为生成缩略图的文件名
//生成的值
$encodedEntryURI = \Qiniu\base64_urlSafeEncode($entry);
//使用SecretKey对新的下载URL进行HMAC1-SHA1签名
$newurl = "78re52.com1.z0.glb.clouddn.com/resource/Ship.jpg?imageView2/2/w/200/h/200|saveas/" . $encodedEntryURI;
$sign = hash_hmac("sha1", $newurl, $secretKey, true);
//对签名进行URL安全的Base64编码
$encodedSign = \Qiniu\base64_urlSafeEncode($sign);
//最终得到的完整下载URL
$finalURL = "http://" . $newurl . "/sign/" . $accessKey . ":" . $encodedSign;
$callbackBody = file_get_contents("$finalURL");
echo $callbackBody;
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$name = 'demo';
$prefix = 'test';
$suffix = 'mp4';
$event = 'mkfile';
$callbackURL = 'https://www.qiniu.com';
list($Info, $err) = $bucketManager->updateBucketEvent($bucket, $name, $prefix, $suffix, $event, $callbackURL);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$auth = new Auth($accessKey, $secretKey);
$config = new \Qiniu\Config();
$bucketManager = new \Qiniu\Storage\BucketManager($auth, $config);
$bucket = 'xxxx';
$name = 'demo';
$prefix = 'test';
$delete_after_days = 90;
$to_line_after_days =80;
list($Info, $err) = $bucketManager->updateBucketLifecycleRule(
$bucket,
$name,
$prefix,
$delete_after_days,
$to_line_after_days
);
if ($err) {
print_r($err);
} else {
print_r($Info);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Storage\UploadManager;
// use Qiniu\Config;
// use Qiniu\Zone;
// 指定zone上传
// $zone = Zone::qvmZonez0(); //华东QVM内网上传指定host
// $config = new Config($zone);
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
// 上传文件到七牛后, 七牛将文件名和文件大小回调给业务服务器.
// 可参考文档: http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html
$policy = array(
'callbackUrl' => 'http://your.domain.com/upload_verify_callback.php',
'callbackBody' => 'filename=$(fname)&filesize=$(fsize)'
);
$uptoken = $auth->uploadToken($bucket, null, 3600, $policy);
//上传文件的本地路径
$filePath = './php-logo.png';
//指定 config
// $uploadMgr = new UploadManager($config);
$uploadMgr = new UploadManager();
list($ret, $err) = $uploadMgr->putFile($uptoken, null, $filePath);
echo "\n====> putFile result: \n";
if ($err !== null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Storage\UploadManager;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
// 在七牛保存的文件名
$key = 'php-logo.png';
$uploadMgr = new UploadManager();
$pfop = "imageMogr2/rotate/90|saveas/" . \Qiniu\base64_urlSafeEncode($bucket . ":php-logo-rotate.png");
//转码完成后通知到你的业务服务器。(公网可以访问,并相应200 OK)
$notifyUrl = 'http://notify.fake.com';
//独立的转码队列:https://portal.qiniu.com/mps/pipeline
$pipeline = 'sdktest';
$policy = array(
'persistentOps' => $pfop,
'persistentNotifyUrl' => $notifyUrl,
'persistentPipeline' => $pipeline
);
$token = $auth->uploadToken($bucket, null, 3600, $policy);
list($ret, $err) = $uploadMgr->putFile($token, null, $key);
echo "\n====> putFile result: \n";
if ($err !== null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Storage\UploadManager;
$accessKey = 'Access_Key';
$secretKey = 'Secret_Key';
$auth = new Auth($accessKey, $secretKey);
// 空间名 http://developer.qiniu.com/docs/v6/api/overview/concepts.html#bucket
$bucket = 'Bucket_Name';
// 生成上传Token
$token = $auth->uploadToken($bucket);
// 构建 UploadManager 对象
$uploadMgr = new UploadManager();
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
use Qiniu\Storage\UploadManager;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$pipeline = 'sdktest';
$auth = new Auth($accessKey, $secretKey);
$token = $auth->uploadToken($bucket);
$uploadMgr = new UploadManager();
//----------------------------------------upload demo1 ----------------------------------------
// 上传字符串到七牛
list($ret, $err) = $uploadMgr->put($token, null, 'content string');
echo "\n====> put result: \n";
if ($err !== null) {
var_dump($err);
} else {
var_dump($ret);
}
//----------------------------------------upload demo2 ----------------------------------------
// 上传文件到七牛
$filePath = './php-logo.png';
$key = 'php-logo.png';
list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath);
echo "\n====> putFile result: \n";
if ($err !== null) {
var_dump($err);
} else {
var_dump($ret);
}
//----------------------------------------upload demo3 ----------------------------------------
// 上传文件到七牛后, 七牛将文件名和文件大小回调给业务服务器.
// 可参考文档: http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html
$policy = array(
'callbackUrl' => 'http://172.30.251.210/upload_verify_callback.php',
'callbackBody' => 'filename=$(fname)&filesize=$(fsize)'
// 'callbackBodyType' => 'application/json',
// 'callbackBody' => '{"filename":$(fname), "filesize": $(fsize)}' //设置application/json格式回调
);
$token = $auth->uploadToken($bucket, null, 3600, $policy);
list($ret, $err) = $uploadMgr->putFile($token, null, $key);
echo "\n====> putFile result: \n";
if ($err !== null) {
var_dump($err);
} else {
var_dump($ret);
}
//----------------------------------------upload demo4 ----------------------------------------
//上传视频,上传完成后进行m3u8的转码, 并给视频打水印
$wmImg = Qiniu\base64_urlSafeEncode('http://devtools.qiniudn.com/qiniu.png');
$pfop = "avthumb/m3u8/wmImage/$wmImg";
//转码完成后回调到业务服务器。(公网可以访问,并相应200 OK)
$notifyUrl = 'http://notify.fake.com';
//独立的转码队列:https://portal.qiniu.com/mps/pipeline
$policy = array(
'persistentOps' => $pfop,
'persistentNotifyUrl' => $notifyUrl,
'persistentPipeline' => $pipeline
);
$token = $auth->uploadToken($bucket, null, 3600, $policy);
print($token);
list($ret, $err) = $uploadMgr->putFile($token, null, $key);
echo "\n====> putFile result: \n";
if ($err !== null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
// 引入鉴权类
use Qiniu\Auth;
// 引入上传类
use Qiniu\Storage\UploadManager;
// 需要填写你的 Access Key 和 Secret Key
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
// 构建鉴权对象
$auth = new Auth($accessKey, $secretKey);
// 生成上传 Token
$token = $auth->uploadToken($bucket);
// 要上传文件的本地路径
$filePath = './php-logo.png';
// 上传到七牛后保存的文件名
$key = 'my-php-logo.png';
// 初始化 UploadManager 对象并进行文件的上传。
$uploadMgr = new UploadManager();
// 调用 UploadManager 的 putFile 方法进行文件的上传。
list($ret, $err) = $uploadMgr->putFile($token, $key, $filePath);
echo "\n====> putFile result: \n";
if ($err !== null) {
var_dump($err);
} else {
var_dump($ret);
}
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use \Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
// 初始化Auth状态
$auth = new Auth($accessKey, $secretKey);
// 简单上传凭证
$expires = 3600;
$policy = null;
$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true);
print($upToken . "\n");
// 自定义凭证有效期(示例2小时)
$expires = 7200;
$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true);
print($upToken . "\n");
// 覆盖上传凭证
$expires = 3600;
$keyToOverwrite = 'qiniu.mp4';
$upToken = $auth->uploadToken($bucket, $keyToOverwrite, $expires, $policy, true);
print($upToken . "\n");
//自定义上传回复(非callback模式)凭证
$returnBody = '{"key":"$(key)","hash":"$(etag)","fsize":$(fsize),"bucket":"$(bucket)","name":"$(x:name)"}';
$policy = array(
'returnBody' => $returnBody
);
$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true);
print($upToken . "\n");
//带回调业务服务器的凭证(application/json)
$policy = array(
'callbackUrl' => 'http://api.example.com/qiniu/upload/callback',
'callbackBody' => '{"key":"$(key)","hash":"$(etag)","fsize":$(fsize),"bucket":"$(bucket)","name":"$(x:name)"}',
'callbackBodyType' => 'application/json'
);
$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true);
print($upToken . "\n");
//带回调业务服务器的凭证(application/x-www-form-urlencoded)
$policy = array(
'callbackUrl' => 'http://api.example.com/qiniu/upload/callback',
'callbackBody' => 'key=$(key)&hash=$(etag)&bucket=$(bucket)&fsize=$(fsize)&name=$(x:name)'
);
$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true);
print($upToken . "\n");
//带数据处理的凭证
$saveMp4Entry = \Qiniu\base64_urlSafeEncode($bucket . ":avthumb_test_target.mp4");
$saveJpgEntry = \Qiniu\base64_urlSafeEncode($bucket . ":vframe_test_target.jpg");
$avthumbMp4Fop = "avthumb/mp4|saveas/" . $saveMp4Entry;
$vframeJpgFop = "vframe/jpg/offset/1|saveas/" . $saveJpgEntry;
$policy = array(
'persistentOps' => $avthumbMp4Fop . ";" . $vframeJpgFop,
'persistentPipeline' => "video-pipe",
'persistentNotifyUrl' => "http://api.example.com/qiniu/pfop/notify",
);
$upToken = $auth->uploadToken($bucket, null, $expires, $policy, true);
print($upToken . "\n");
... ...
<?php
require_once __DIR__ . '/../autoload.php';
use Qiniu\Auth;
$accessKey = getenv('QINIU_ACCESS_KEY');
$secretKey = getenv('QINIU_SECRET_KEY');
$bucket = getenv('QINIU_TEST_BUCKET');
$auth = new Auth($accessKey, $secretKey);
//获取回调的body信息
$callbackBody = file_get_contents('php://input');
//回调的contentType
$contentType = 'application/x-www-form-urlencoded';
//回调的签名信息,可以验证该回调是否来自七牛
$authorization = $_SERVER['HTTP_AUTHORIZATION'];
//七牛回调的url,具体可以参考:http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html
$url = 'http://172.30.251.210/upload_verify_callback.php';
$isQiniuCallback = $auth->verifyCallback($contentType, $authorization, $url, $callbackBody);
if ($isQiniuCallback) {
$resp = array('ret' => 'success');
} else {
$resp = array('ret' => 'failed');
}
echo json_encode($resp);
... ...
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="./tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
>
<testsuites>
<testsuite name="Qiniu SDK Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
... ...