<?php
class onez_cloud {
var $debug = false;
var $_config = false;
var $_homepage = false;
var $_db = false;
var $context = [];
var $logs = [];
var $tables = [];
var $_output = ['status' => 'success'];
var $_option = false;
function __construct() {
$this->context = [];
}
/**
* 读取用户get或post的信息
*
* @param string $keys 键
* @param string $method 方法:G get,P post
* @param boolean $cvtype 是否为数字
*
* @return string
*/
function gp($keys, $cvtype = 1, $method = null) {
global $G;
if ($method == 'G') {
$value = $_GET[$keys];
} elseif ($method == 'P') {
$value = $_POST[$keys];
} else {
$value = $_REQUEST[$keys];
}
$G['gp_' . $keys] = $value;
if (!empty($cvtype) || $cvtype == 2) {
$value = $this->charcv($value, $cvtype == 2, true);
}
$value == 'undefined' && $value = '';
return $value;
}
/**
* 读取变量
*
* @param mixed $mixed 字符串
* @param boolean $isint 是否为数字
* @param boolean $istrim 是否去除空格
*
* @return
*/
function charcv($mixed, $isint = false, $istrim = false) {
if (is_array($mixed)) {
foreach ($mixed as $key => $value) {
$mixed[$key] = $this->charcv($value, $isint, $istrim);
}
} elseif ($isint) {
$mixed = (int)$mixed;
} elseif (!is_numeric($mixed) && ($istrim ? $mixed = trim($mixed) : $mixed) && $mixed) {
$mixed = str_replace(array(
"\0",
"%00",
"\r"
) , '', $mixed);
$mixed = preg_replace(array(
'/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]/',
'/&(?!(#[0-9]+|[a-z]+);)/is'
) , array(
'',
'&'
) , $mixed);
$mixed = str_replace(array(
"%3C",
'<'
) , '<', $mixed);
$mixed = str_replace(array(
"%3E",
'>'
) , '>', $mixed);
$mixed = str_replace('&', '&', $mixed);
$mixed = str_replace(array(
'"',
"'",
"\t",
' '
) , array(
'"',
''',
' ',
' '
) , $mixed);
}
return $mixed;
}
/**
* 读取本地文件数据
*
* @param string $filename 文件名
* @param string $method 默认rb
*
* @return mixed 文件数据
*/
function read($fileId, $method = "rb") {
$filename = dirname(__FILE__) . $fileId;
if (!file_exists($filename)) {
return;
}
if ($handle = @fopen($filename, $method)) {
flock($handle, LOCK_SH);
$size = filesize($filename);
if ($size > 0) {
$filedata = fread($handle, $size);
}
fclose($handle);
}
return $filedata;
}
function file_exists($fileId) {
return file_exists(dirname(__FILE__) . $fileId);
}
/**
* 写入本地文件
*
* @param string $filename 文件名
* @param mixed $data 文件内容
* @param string $method 写入方式,a+为追加
* @param boolean $iflock
*
* @return
*/
function write($fileId, $data, $method = "rb+", $iflock = 1) {
$filename = dirname(__FILE__) . $fileId;
$this->mkdirs(dirname($filename));
touch($filename);
$handle = fopen($filename, $method);
if ($iflock) {
flock($handle, LOCK_EX);
}
fwrite($handle, $data);
if ($method == "rb+") ftruncate($handle, strlen($data));
fclose($handle);
return $fileId;
}
/**
* 创建多级目录
*
* @param string $dir 要创建的完整路径
*
* @return
*/
function mkdirs($dir) {
if (!is_dir($dir)) {
$this->mkdirs(dirname($dir));
mkdir($dir, 0777);
}
return;
}
function fileUrl($fileId) {
return $this->context['homepage'] . $fileId;
}
/**
* 读取远程网址代码
*
* @param string $url 请求的网址
* @param mixed $fields 需要post的参数
* @param array $options 附加选项
*
* @return mixed 直接返回目标输出的内容
*/
function post($url, $fields = '', $options = null) {
!$options && $options = [];
if (!function_exists('curl_init')) {
return $this->mypost($url, $fields, $options);
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
if (strpos($url, 'https://') !== false) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
}
if ($options['useragent']) {
curl_setopt($ch, CURLOPT_USERAGENT, $options['useragent']);
} else {
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19');
}
curl_setopt($ch, CURLOPT_TIMEOUT, $options['timeout'] ? $options['timeout'] : 10);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$options['headers'] && curl_setopt($ch, CURLOPT_HTTPHEADER, $options['headers']);
if ($options['showheader']) {
curl_setopt($ch, CURLOPT_HEADER, 1);
} else {
curl_setopt($ch, CURLOPT_HEADER, 0);
}
if ($options['cookie']) {
if (file_exists($options['cookie'])) {
curl_setopt($ch, CURLOPT_COOKIEJAR, $options['cookie']);
curl_setopt($ch, CURLOPT_COOKIEFILE, $options['cookie']);
} else {
curl_setopt($ch, CURLOPT_COOKIE, $options['cookie']);
}
}
curl_setopt($ch, CURLOPT_REFERER, $options['baseurl'] ? $options['baseurl'] : $url);
if ($fields) {
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_POST, 1);
}
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
function mypost($url, $fields = '', $options = null) {
!$options && $options = array();
if ($fields) {
$opt = array(
'http' => array(
'method' => 'POST',
'header' => 'content-type:application/x-www-form-urlencoded' . ($options['headers'] ? (';' . implode(';', $options['headers'])) : '') ,
'content' => is_array($fields) ? http_build_query($fields) : $fields
)
);
$context = stream_context_create($opt);
$mydata = file_get_contents($url, false, $context);
} else {
if ($options['headers']) {
$opt = array(
'http' => array(
'method' => 'GET',
'header' => implode(';', $options['headers']) ,
)
);
$context = stream_context_create($opt);
$mydata = file_get_contents($url, false, $context);
} else {
$mydata = file_get_contents($url);
}
}
return $mydata;
}
//数据库操作
function db($request, $is_system = false) {
//读写权限判断
$r = $this->db_permission($request, $is_system);
if ($r['error']) {
return $this->error($r['error']);
}
$result = false;
if (!empty($request['where']['namespace'])) {
unset($request['where
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
佳蓝虚拟商品自动发货系统(全手机版) v2.1.5.zip (92个子文件)
api.php 74KB
data
default
init.php 1KB
tables
category
1.php 559B
1.index.php 382B
files
1.php 1KB
1.index.php 450B
card
1.php 656B
1.index.php 340B
order
1.php 14KB
1.index.php 3KB
user
1.php 1KB
1.index.php 466B
moneylog
1.php 9KB
1.index.php 3KB
withdraw
1.php 1KB
1.index.php 297B
news
1.php 263B
1.index.php 168B
buylog
1.php 4KB
1.index.php 894B
withdraw-account
1.php 355B
1.index.php 168B
product
1.php 6KB
1.index.php 453B
slider
1.php 315B
1.index.php 168B
help
1.php 437B
1.index.php 275B
config
1.php 8KB
1.index.php 168B
说明.htm 4KB
index.html 2KB
static
index.3e73f18a.css 93KB
js
pages-earn-earn~pages-index-index~pages-news-news~pages-products-products.1d146d8f.js 15KB
pages-admin.setting-admin.setting.2fd9b81e.js 12KB
pages-admin.products.edit-admin.products.edit.0da3f546.js 87KB
index.34b00cc6.js 212KB
pages-admin.helps-admin.helps.5d3615a2.js 47KB
pages-admin-admin~pages-admin.buylogs-admin.buylogs~pages-admin.cards-admin.cards~pages-admin.cards.~fcfaafd9.282ab77e.js 32KB
pages-withdraw.account.edit-withdraw.account.edit.d1c25e64.js 21KB
pages-setpwd-setpwd.0d3f85fc.js 10KB
pages-admin.users.view-admin.users.view.fcf0b11b.js 47KB
pages-withdraw.account-withdraw.account.435a1da7.js 48KB
pages-admin.category.edit-admin.category.edit.a2379815.js 11KB
pages-admin-admin~pages-admin.buylogs-admin.buylogs~pages-admin.cards-admin.cards~pages-admin.cards.~b23f837b.298ff36e.js 54KB
pages-admin.news.edit-admin.news.edit.1075947e.js 42KB
pages-news.view-news.view.f6971ccd.js 7KB
pages-products.view-products.view.de00781c.js 30KB
pages-admin.news-admin.news.b8a3480b.js 47KB
pages-admin.withdraw.edit-admin.withdraw.edit.9a1d23e0.js 63KB
pages-admin.products-admin.products.d8be8f48.js 48KB
pages-admin.cards-admin.cards.e09e6479.js 48KB
pages-withdraw.log-withdraw.log.dbb3071e.js 47KB
pages-admin.users.edit-admin.users.edit.86ec0169.js 60KB
pages-install-install.c0244d67.js 10KB
pages-admin-admin~pages-admin.buylogs-admin.buylogs~pages-admin.cards-admin.cards~pages-admin.cards.~322d569d.295bc5ee.js 19KB
pages-admin-admin~pages-admin.buylogs-admin.buylogs~pages-admin.cards-admin.cards~pages-admin.cards.~a972f2e0.2e3168af.js 51KB
pages-admin.cards.edit-admin.cards.edit.1e3ba410.js 12KB
pages-buylogs.view-buylogs.view.10594765.js 28KB
pages-admin.sliders.edit-admin.sliders.edit.b81732d9.js 70KB
pages-admin.withdraw-admin.withdraw.dd30be92.js 47KB
pages-admin.helps.edit-admin.helps.edit.c25ac483.js 24KB
pages-moneylog-moneylog.065e6589.js 47KB
pages-admin.buylogs-admin.buylogs.1dd59c3d.js 47KB
pages-admin.users.charge-admin.users.charge.4223de22.js 11KB
pages-buylogs.view-buylogs.view~pages-earn-earn~pages-index-index~pages-me-me~pages-news-news~pages-~ddac6fe2.9ffff69b.js 23KB
pages-me-me.9ec0b7b9.js 28KB
pages-buylogs-buylogs.6d61e82c.js 47KB
pages-news-news.407301b8.js 9KB
pages-system-auto.0758cbf5.js 3KB
pages-admin.users-admin.users.8eea7041.js 47KB
pages-admin.category-admin.category.eb96c511.js 47KB
pages-earn-earn.422aedc7.js 43KB
pages-poster-poster.15596e86.js 17KB
pages-index-index.5c448564.js 59KB
pages-helps-helps.0bed1848.js 20KB
pages-admin.sliders-admin.sliders.36e0c970.js 47KB
pages-products-products.42c8a835.js 41KB
pages-invites-invites.7de995cc.js 47KB
pages-withdraw-withdraw.bd4d0a52.js 52KB
chunk-vendors.7b84df87.js 697KB
pages-admin-admin.4051d87d.js 33KB
img
products_selected.png 3KB
earn_normal.png 3KB
index_normal.png 2KB
index_selected.png 2KB
me_normal.png 2KB
me_selected.png 3KB
earn_selected.png 3KB
products_normal.png 2KB
fonts
uni.75745d34.ttf 26KB
config
option.php 31KB
共 92 条
- 1
资源评论
芝麻粒儿
- 粉丝: 6w+
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功