Commit 9935ab32 by biao Committed by lixq

1

parent b9d83882
...@@ -86,21 +86,22 @@ CREATE TABLE IF NOT EXISTS school_mst( ...@@ -86,21 +86,22 @@ CREATE TABLE IF NOT EXISTS school_mst(
original_source int8 NOT NULL DEFAULT '0', original_source int8 NOT NULL DEFAULT '0',
title text NOT NULL, title text NOT NULL,
school_type varchar(64) NOT NULL, school_type varchar(64) NOT NULL,
front_image varchar(64) NOT NULL, front_image text NOT NULL,
comment text NOT NULL, comment text NOT NULL,
address text NOT NULL, address text NOT NULL,
province varchar(64), province varchar(64),
city varchar(64), city varchar(64),
district varchar(64), district varchar(64),
street text, street text,
longitude text NOT NULL, longitude text,
latitude text NOT NULL DEFAULT 'UNKNOW', latitude text,
delete_flg tinyint(1) NOT NULL DEFAULT '0' delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4; ) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX school_mst_id_idx ON school_mst(id); Create INDEX school_mst_id_idx ON school_mst(id);
Create INDEX school_mst_title_idx ON school_mst(title(255));
Create INDEX school_mst_school_type_idx ON school_mst(school_type); Create INDEX school_mst_school_type_idx ON school_mst(school_type);
Create INDEX school_mst_province_idx ON school_mst(province);
Create INDEX school_mst_city_idx ON school_mst(city);
##----grade_mst create ##----grade_mst create
...@@ -196,10 +197,10 @@ CREATE TABLE IF NOT EXISTS user_mst( ...@@ -196,10 +197,10 @@ CREATE TABLE IF NOT EXISTS user_mst(
organization_title text, organization_title text,
legal_person varchar(255), legal_person varchar(255),
organization_contact text, organization_contact text,
legal_person_imgage1 varchar(255), legal_person_imgage1 text,
legal_person_imgage2 varchar(255), legal_person_imgage2 text,
licensen_imgage varchar(255), licensen_imgage text,
other_imgage varchar(255), other_imgage text,
organization_status varchar(64) NOT NULL DEFAULT 'NEW', organization_status varchar(64) NOT NULL DEFAULT 'NEW',
ability_point int8 NOT NULL DEFAULT '0', ability_point int8 NOT NULL DEFAULT '0',
service_point int8 NOT NULL DEFAULT '0', service_point int8 NOT NULL DEFAULT '0',
...@@ -214,8 +215,9 @@ DROP TABLE IF EXISTS social_event_dat; ...@@ -214,8 +215,9 @@ DROP TABLE IF EXISTS social_event_dat;
CREATE TABLE IF NOT EXISTS social_event_dat( CREATE TABLE IF NOT EXISTS social_event_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment, id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
school_no text NOT NULL DEFAULT '0', school_no text NOT NULL,
class_no text NOT NULL DEFAULT '0', class_no text NOT NULL,
event_id int8 NOT NULL,
original_source int8 NOT NULL DEFAULT '0', original_source int8 NOT NULL DEFAULT '0',
title text NOT NULL, title text NOT NULL,
author text NOT NULL, author text NOT NULL,
...@@ -254,12 +256,14 @@ DROP TABLE IF EXISTS family_event_dat; ...@@ -254,12 +256,14 @@ DROP TABLE IF EXISTS family_event_dat;
CREATE TABLE IF NOT EXISTS family_event_dat( CREATE TABLE IF NOT EXISTS family_event_dat(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment, id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
school_no text NOT NULL DEFAULT '0', school_no text NOT NULL,
class_no text NOT NULL DEFAULT '0', class_no text NOT NULL,
event_id int8 NOT NULL,
original_source int8 NOT NULL DEFAULT '0', original_source int8 NOT NULL DEFAULT '0',
title text NOT NULL, title text NOT NULL,
author text NOT NULL, author text NOT NULL,
publish_time timestamp NOT NULL, publish_time timestamp NOT NULL,
images text,
content text NOT NULL, content text NOT NULL,
scope int8 NOT NULL, scope int8 NOT NULL,
delete_flg tinyint(1) NOT NULL DEFAULT '0' delete_flg tinyint(1) NOT NULL DEFAULT '0'
...@@ -358,7 +362,7 @@ CREATE TABLE IF NOT EXISTS certificate_mst( ...@@ -358,7 +362,7 @@ CREATE TABLE IF NOT EXISTS certificate_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment, id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
title varchar(128) NOT NULL, title varchar(128) NOT NULL,
front_image varchar(64) NOT NULL, front_image text NOT NULL,
point text, point text,
status varchar(64) NOT NULL DEFAULT '0', status varchar(64) NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0' delete_flg tinyint(1) NOT NULL DEFAULT '0'
...@@ -390,7 +394,7 @@ CREATE TABLE IF NOT EXISTS course_media_dat( ...@@ -390,7 +394,7 @@ CREATE TABLE IF NOT EXISTS course_media_dat(
course_id int8 NOT NULL DEFAULT '0', course_id int8 NOT NULL DEFAULT '0',
title varchar(128) NOT NULL, title varchar(128) NOT NULL,
tags text NOT NULL, tags text NOT NULL,
front_image varchar(64) NOT NULL, front_image text NOT NULL,
media text NOT NULL, media text NOT NULL,
teacher varchar(128), teacher varchar(128),
is_free tinyint(1) NOT NULL DEFAULT '0', is_free tinyint(1) NOT NULL DEFAULT '0',
...@@ -422,11 +426,13 @@ CREATE TABLE IF NOT EXISTS course_mst( ...@@ -422,11 +426,13 @@ CREATE TABLE IF NOT EXISTS course_mst(
id bigint unsigned NOT NULL PRIMARY KEY auto_increment, id bigint unsigned NOT NULL PRIMARY KEY auto_increment,
registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, registration_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
title varchar(128) NOT NULL, title varchar(128) NOT NULL,
front_image varchar(64) NOT NULL, front_image text NOT NULL,
teacher_profile text, teacher_profile text,
delete_flg tinyint(1) NOT NULL DEFAULT '0' delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4; ) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
Create INDEX course_mst_id_idx ON course_mst(id);
Create INDEX course_mst_title_idx ON course_mst(title);
##----user_point_log create ##----user_point_log create
......
<?php <?php
/** /**
* SchoolMst Entity * SchoolMst Entity
* $Id: SchoolMst.inc,v 1.1 2020/1/16 11:09:00 Exp $ * $Id: SchoolMst.inc,v 1.1 2020/1/20 15:52:15 Exp $
* @author lixq * @author lixq
* @package jp.compass.entity * @package jp.compass.entity
* @access public * @access public
...@@ -121,8 +121,8 @@ class SchoolMst extends CompassDynamicData ...@@ -121,8 +121,8 @@ class SchoolMst extends CompassDynamicData
ParamUtil::copyObj2ArrayNullField($v_param, $this, "city"); ParamUtil::copyObj2ArrayNullField($v_param, $this, "city");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "district"); ParamUtil::copyObj2ArrayNullField($v_param, $this, "district");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "street"); ParamUtil::copyObj2ArrayNullField($v_param, $this, "street");
ParamUtil::copyObj2Array($v_param, $this, "longitude"); ParamUtil::copyObj2ArrayNullField($v_param, $this, "longitude");
ParamUtil::copyObj2Array($v_param, $this, "latitude"); ParamUtil::copyObj2ArrayNullField($v_param, $this, "latitude");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg"); ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
// 保存 // 保存
......
<?php
use OSS\OssClient;
USE OSS\Core\OssException;
require_once (dirname ( __FILE__ ) . '/../../extralib/autoload.php');
Class AliUploadHandler{
var $Access_Key ;
var $Secret_Key ;
var $bucket ;
var $endpoint ;
public function __construct(){
$this->init();
}
public function init(){
$this->Access_Key = OSS_ACCESS_KEY;
$this->Secret_Key = OSS_ACCESS_SECRET;
$this->bucket = OSS_BUCKET;
$this->endpoint = OSS_END_POINT;
}
/**
* 上传接口
* @Author
* @DateTime 2017-03-08
* @param string $bucket bucket name
* @param string $object object name
* @param string $file local file path
* @param array $options
* @throws OssException [文件类型]
*/
public function uploadImg($dst,$src){
//获取对象
$auth = new OssClient($this->Access_Key,$this->Secret_Key,$this->endpoint);
try {
//上传图片
$result = $auth->uploadFile($this->bucket,$dst,$src);
return $result['info']['url'];
} catch (OssException $e) {
ErrorLogger::doOutput(__FUNCTION__ . "uploadImg: FAILED\n");
ErrorLogger::doOutput($e->getMessage() . "\n");
return $e->getMessage();
}
ErrorLogger::doOutput(__FUNCTION__ . "uploadImg: OK" . "\n");
}
/**
* @Author
* @DateTime 2018-03-08
* @return [type] [description]
*/
public function uploadVideo($dst,$src){
$ossClient = new OssClient($this->Access_Key,$this->Secret_Key,$this->endpoint);
try{
$result = $ossClient->multiuploadFile($this->bucket,$dst,$src);
return $result['info']['url'];
} catch(OssException $e) {
ErrorLogger::doOutput(__FUNCTION__ . "uploadVideo: FAILED\n");
ErrorLogger::doOutput($e->getMessage() . "\n");
return;
}
ErrorLogger::doOutput(__FUNCTION__ . "uploadVideo: OK" . "\n");
}
/**
* 删除文件
*
* @param $srcFile 文件路径
*
*/
public function delete($desPath)
{
$ossClient = new OssClient($this->Access_Key,$this->Secret_Key,$this->endpoint);
try{
$ossClient->deleteObject($this->bucket, $desPath);
} catch(OssException $e) {
ErrorLogger::doOutput(__FUNCTION__ . "delete: FAILED\n");
ErrorLogger::doOutput($e->getMessage() . "\n");
return;
}
ErrorLogger::doOutput(__FUNCTION__ . "delete: OK" . "\n");
}
}
\ No newline at end of file
...@@ -7,6 +7,25 @@ ...@@ -7,6 +7,25 @@
* @package jp.fishow.handler * @package jp.fishow.handler
*/ */
class CompassHandler{ class CompassHandler{
/**
* API请求时发生错误
*/
public static function responseApiNg($error_code = 0, $error_message = null) {
$arr = ["status"=>"NG", "error_code"=>$error_code, "error_message"=>$error_message];
echo json_encode($arr);
exit;
}
/**
* API请求时返回正常结果
*/
public static function responseApiOk($result = []) {
$arr = ["status"=>"OK", "data"=>$result];
echo json_encode($arr);
exit;
}
/** /**
* 图片显示URL取得 * 图片显示URL取得
* child_path(不包含"/") * child_path(不包含"/")
...@@ -416,6 +435,75 @@ class CompassHandler{ ...@@ -416,6 +435,75 @@ class CompassHandler{
} }
return $return; return $return;
} }
/**
* 根据条件查询government list
*/
public static function getGovernmentlList($param, $order_key = "id", $sort = "DESC", $offset = null, $limit = null) {
$from = "select * from government_mst";
$sql_where =" where true";
$sql_where.=" order by ".$order_key.' '.$sort.' limit '.$limit.' OFFSET '.$offset;
// 検索を行う
$db = &CompassDBManager::getInstance();
$result = $db->executeQuery($from.$sql_where);
$return = [];
if(count($result) > 0){
foreach ($result as $tmp){
array_push($return, new GovernmentMst($tmp));
}
}
return $return;
}
/**
* 根据条件查询school list
*/
public static function getSchoollList($param, $order_key = "id", $sort = "DESC", $offset = null, $limit = null) {
$from = "select * from school_mst";
$sql_where =" where true";
$sql_where.=" order by ".$order_key.' '.$sort.' limit '.$limit.' OFFSET '.$offset;
// 検索を行う
$db = &CompassDBManager::getInstance();
$result = $db->executeQuery($from.$sql_where);
$return = [];
if(count($result) > 0){
foreach ($result as $tmp){
array_push($return, new SchoolMst($tmp));
}
}
return $return;
}
/**
* 根据条件查询班级 list
*/
public static function getClassList($param, $order_key = "id", $sort = "DESC", $offset = null, $limit = null) {
$from = "select cm.*,gm.title as grade_title from class_mst cm left join grade_mst gm on cm.grade_id=gm.id";
$sql_where =" where cm.delete_flg=false";
if (isset($param["school_id"]) && !empty($param["school_id"])) {
$sql_where .= " and cm.school_id=".$param["school_id"];
}
$sql_where.=" order by ".$order_key.' '.$sort;
// 検索を行う
$db = &CompassDBManager::getInstance();
$result = $db->executeQuery($from.$sql_where);
return $result;
}
/**
* 根据条件查询合集视频 list
*/
public static function getCourseList($param, $order_key = "id", $sort = "DESC", $offset = null, $limit = null) {
$from = "select cm.*,gm.title as grade_title from course_mst cm left join grade_mst gm on cm.grade_id=gm.id";
$sql_where =" where cm.delete_flg=false";
if (isset($param["school_id"]) && !empty($param["school_id"])) {
$sql_where .= " and cm.school_id=".$param["school_id"];
}
$sql_where.=" order by ".$order_key.' '.$sort;
// 検索を行う
$db = &CompassDBManager::getInstance();
$result = $db->executeQuery($from.$sql_where);
return $result;
}
} }
?> ?>
\ No newline at end of file
<?php
namespace OSS\Core;
/**
* Class OssException
*
* This is the class that OSSClient is expected to thrown, which the caller needs to handle properly.
* It has the OSS specific errors which is useful for troubleshooting.
*
* @package OSS\Core
*/
class OssException extends \Exception
{
private $details = array();
function __construct($details)
{
if (is_array($details)) {
$message = $details['code'] . ': ' . $details['message']
. ' RequestId: ' . $details['request-id'];
parent::__construct($message);
$this->details = $details;
} else {
$message = $details;
parent::__construct($message);
}
}
public function getHTTPStatus()
{
return isset($this->details['status']) ? $this->details['status'] : '';
}
public function getRequestId()
{
return isset($this->details['request-id']) ? $this->details['request-id'] : '';
}
public function getErrorCode()
{
return isset($this->details['code']) ? $this->details['code'] : '';
}
public function getErrorMessage()
{
return isset($this->details['message']) ? $this->details['message'] : '';
}
public function getDetails()
{
return isset($this->details['body']) ? $this->details['body'] : '';
}
}
Copyright (c) 2006-2010 Ryan Parman, Foleeo Inc., and contributors. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of Ryan Parman, Foleeo Inc. nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
<?php
namespace OSS\Http;
class RequestCore_Exception extends \Exception
{
}
\ No newline at end of file
<?php
namespace OSS\Http;
/**
* Container for all response-related methods.
*/
class ResponseCore
{
/**
* Store the HTTP header information.
*/
public $header;
/**
* Store the SimpleXML response.
*/
public $body;
/**
* Store the HTTP response code.
*/
public $status;
/**
* Construct a new instance of this class.
*
* @param array $header (Required) Associative array of HTTP headers (typically returned by <RequestCore::get_response_header()>).
* @param string $body (Required) XML-formatted response from OSS.
* @param integer $status (Optional) HTTP response status code from the request.
* @return Mixed Contains an <php:array> `header` property (HTTP headers as an associative array), a <php:SimpleXMLElement> or <php:string> `body` property, and an <php:integer> `status` code.
*/
public function __construct($header, $body, $status = null)
{
$this->header = $header;
$this->body = $body;
$this->status = $status;
return $this;
}
/**
* Did we receive the status code we expected?
*
* @param integer|array $codes (Optional) The status code(s) to expect. Pass an <php:integer> for a single acceptable value, or an <php:array> of integers for multiple acceptable values.
* @return boolean Whether we received the expected status code or not.
*/
public function isOK($codes = array(200, 201, 204, 206))
{
if (is_array($codes)) {
return in_array($this->status, $codes);
}
return $this->status === $codes;
}
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Bucket information class. This is the type of element in BucketListInfo's
*
* Class BucketInfo
* @package OSS\Model
*/
class BucketInfo
{
/**
* BucketInfo constructor.
*
* @param string $location
* @param string $name
* @param string $createDate
*/
public function __construct($location, $name, $createDate)
{
$this->location = $location;
$this->name = $name;
$this->createDate = $createDate;
}
/**
* Get bucket location
*
* @return string
*/
public function getLocation()
{
return $this->location;
}
/**
* Get bucket name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Get bucket creation time.
*
* @return string
*/
public function getCreateDate()
{
return $this->createDate;
}
/**
* bucket region
*
* @var string
*/
private $location;
/**
* bucket name
*
* @var string
*/
private $name;
/**
* bucket creation time
*
* @var string
*/
private $createDate;
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Class BucketListInfo
*
* It's the type of return value of ListBuckets.
*
* @package OSS\Model
*/
class BucketListInfo
{
/**
* BucketListInfo constructor.
* @param array $bucketList
*/
public function __construct(array $bucketList)
{
$this->bucketList = $bucketList;
}
/**
* Get the BucketInfo list
*
* @return BucketInfo[]
*/
public function getBucketList()
{
return $this->bucketList;
}
/**
* BucketInfo list
*
* @var array
*/
private $bucketList = array();
}
\ No newline at end of file
<?php
namespace OSS\Model;
use OSS\Core\OssException;
/**
* Class CnameConfig
* @package OSS\Model
*
* TODO: fix link
* @link http://help.aliyun.com/document_detail/oss/api-reference/cors/PutBucketcors.html
*/
class CnameConfig implements XmlConfig
{
public function __construct()
{
$this->cnameList = array();
}
/**
* @return array
* @example
* array(2) {
* [0]=>
* array(3) {
* ["Domain"]=>
* string(11) "www.foo.com"
* ["Status"]=>
* string(7) "enabled"
* ["LastModified"]=>
* string(8) "20150101"
* }
* [1]=>
* array(3) {
* ["Domain"]=>
* string(7) "bar.com"
* ["Status"]=>
* string(8) "disabled"
* ["LastModified"]=>
* string(8) "20160101"
* }
* }
*/
public function getCnames()
{
return $this->cnameList;
}
public function addCname($cname)
{
if (count($this->cnameList) >= self::OSS_MAX_RULES) {
throw new OssException(
"num of cname in the config exceeds self::OSS_MAX_RULES: " . strval(self::OSS_MAX_RULES));
}
$this->cnameList[] = array('Domain' => $cname);
}
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
if (!isset($xml->Cname)) return;
foreach ($xml->Cname as $entry) {
$cname = array();
foreach ($entry as $key => $value) {
$cname[strval($key)] = strval($value);
}
$this->cnameList[] = $cname;
}
}
public function serializeToXml()
{
$strXml = <<<EOF
<?xml version="1.0" encoding="utf-8"?>
<BucketCnameConfiguration>
</BucketCnameConfiguration>
EOF;
$xml = new \SimpleXMLElement($strXml);
foreach ($this->cnameList as $cname) {
$node = $xml->addChild('Cname');
foreach ($cname as $key => $value) {
$node->addChild($key, $value);
}
}
return $xml->asXML();
}
public function __toString()
{
return $this->serializeToXml();
}
const OSS_MAX_RULES = 10;
private $cnameList = array();
}
\ No newline at end of file
<?php
namespace OSS\Model;
use OSS\Core\OssException;
/**
* Class CorsConfig
* @package OSS\Model
*
* @link http://help.aliyun.com/document_detail/oss/api-reference/cors/PutBucketcors.html
*/
class CorsConfig implements XmlConfig
{
/**
* CorsConfig constructor.
*/
public function __construct()
{
$this->rules = array();
}
/**
* Get CorsRule list
*
* @return CorsRule[]
*/
public function getRules()
{
return $this->rules;
}
/**
* Add a new CorsRule
*
* @param CorsRule $rule
* @throws OssException
*/
public function addRule($rule)
{
if (count($this->rules) >= self::OSS_MAX_RULES) {
throw new OssException("num of rules in the config exceeds self::OSS_MAX_RULES: " . strval(self::OSS_MAX_RULES));
}
$this->rules[] = $rule;
}
/**
* Parse CorsConfig from the xml.
*
* @param string $strXml
* @throws OssException
* @return null
*/
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
if (!isset($xml->CORSRule)) return;
foreach ($xml->CORSRule as $rule) {
$corsRule = new CorsRule();
foreach ($rule as $key => $value) {
if ($key === self::OSS_CORS_ALLOWED_HEADER) {
$corsRule->addAllowedHeader(strval($value));
} elseif ($key === self::OSS_CORS_ALLOWED_METHOD) {
$corsRule->addAllowedMethod(strval($value));
} elseif ($key === self::OSS_CORS_ALLOWED_ORIGIN) {
$corsRule->addAllowedOrigin(strval($value));
} elseif ($key === self::OSS_CORS_EXPOSE_HEADER) {
$corsRule->addExposeHeader(strval($value));
} elseif ($key === self::OSS_CORS_MAX_AGE_SECONDS) {
$corsRule->setMaxAgeSeconds(strval($value));
}
}
$this->addRule($corsRule);
}
return;
}
/**
* Serialize the object into xml string.
*
* @return string
*/
public function serializeToXml()
{
$xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><CORSConfiguration></CORSConfiguration>');
foreach ($this->rules as $rule) {
$xmlRule = $xml->addChild('CORSRule');
$rule->appendToXml($xmlRule);
}
return $xml->asXML();
}
public function __toString()
{
return $this->serializeToXml();
}
const OSS_CORS_ALLOWED_ORIGIN = 'AllowedOrigin';
const OSS_CORS_ALLOWED_METHOD = 'AllowedMethod';
const OSS_CORS_ALLOWED_HEADER = 'AllowedHeader';
const OSS_CORS_EXPOSE_HEADER = 'ExposeHeader';
const OSS_CORS_MAX_AGE_SECONDS = 'MaxAgeSeconds';
const OSS_MAX_RULES = 10;
/**
* CorsRule list
*
* @var CorsRule[]
*/
private $rules = array();
}
\ No newline at end of file
<?php
namespace OSS\Model;
use OSS\Core\OssException;
/**
* Class CorsRule
* @package OSS\Model
* @link http://help.aliyun.com/document_detail/oss/api-reference/cors/PutBucketcors.html
*/
class CorsRule
{
/**
* Add an allowedOrigin rule
*
* @param string $allowedOrigin
*/
public function addAllowedOrigin($allowedOrigin)
{
if (!empty($allowedOrigin)) {
$this->allowedOrigins[] = $allowedOrigin;
}
}
/**
* Add an allowedMethod rule
*
* @param string $allowedMethod
*/
public function addAllowedMethod($allowedMethod)
{
if (!empty($allowedMethod)) {
$this->allowedMethods[] = $allowedMethod;
}
}
/**
* Add an allowedHeader rule
*
* @param string $allowedHeader
*/
public function addAllowedHeader($allowedHeader)
{
if (!empty($allowedHeader)) {
$this->allowedHeaders[] = $allowedHeader;
}
}
/**
* Add an exposeHeader rule
*
* @param string $exposeHeader
*/
public function addExposeHeader($exposeHeader)
{
if (!empty($exposeHeader)) {
$this->exposeHeaders[] = $exposeHeader;
}
}
/**
* @return int
*/
public function getMaxAgeSeconds()
{
return $this->maxAgeSeconds;
}
/**
* @param int $maxAgeSeconds
*/
public function setMaxAgeSeconds($maxAgeSeconds)
{
$this->maxAgeSeconds = $maxAgeSeconds;
}
/**
* Get the AllowedHeaders list
*
* @return string[]
*/
public function getAllowedHeaders()
{
return $this->allowedHeaders;
}
/**
* Get the AllowedOrigins list
*
* @return string[]
*/
public function getAllowedOrigins()
{
return $this->allowedOrigins;
}
/**
* Get the AllowedMethods list
*
* @return string[]
*/
public function getAllowedMethods()
{
return $this->allowedMethods;
}
/**
* Get the ExposeHeaders list
*
* @return string[]
*/
public function getExposeHeaders()
{
return $this->exposeHeaders;
}
/**
* Serialize all the rules into the xml represented by parameter $xmlRule
*
* @param \SimpleXMLElement $xmlRule
* @throws OssException
*/
public function appendToXml(&$xmlRule)
{
if (!isset($this->maxAgeSeconds)) {
throw new OssException("maxAgeSeconds is not set in the Rule");
}
foreach ($this->allowedOrigins as $allowedOrigin) {
$xmlRule->addChild(CorsConfig::OSS_CORS_ALLOWED_ORIGIN, $allowedOrigin);
}
foreach ($this->allowedMethods as $allowedMethod) {
$xmlRule->addChild(CorsConfig::OSS_CORS_ALLOWED_METHOD, $allowedMethod);
}
foreach ($this->allowedHeaders as $allowedHeader) {
$xmlRule->addChild(CorsConfig::OSS_CORS_ALLOWED_HEADER, $allowedHeader);
}
foreach ($this->exposeHeaders as $exposeHeader) {
$xmlRule->addChild(CorsConfig::OSS_CORS_EXPOSE_HEADER, $exposeHeader);
}
$xmlRule->addChild(CorsConfig::OSS_CORS_MAX_AGE_SECONDS, strval($this->maxAgeSeconds));
}
private $allowedHeaders = array();
private $allowedOrigins = array();
private $allowedMethods = array();
private $exposeHeaders = array();
private $maxAgeSeconds = null;
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Class GetLiveChannelHistory
* @package OSS\Model
*/
class GetLiveChannelHistory implements XmlConfig
{
public function getLiveRecordList()
{
return $this->liveRecordList;
}
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
if (isset($xml->LiveRecord)) {
foreach ($xml->LiveRecord as $record) {
$liveRecord = new LiveChannelHistory();
$liveRecord->parseFromXmlNode($record);
$this->liveRecordList[] = $liveRecord;
}
}
}
public function serializeToXml()
{
throw new OssException("Not implemented.");
}
private $liveRecordList = array();
}
<?php
namespace OSS\Model;
/**
* Class GetLiveChannelInfo
* @package OSS\Model
*/
class GetLiveChannelInfo implements XmlConfig
{
public function getDescription()
{
return $this->description;
}
public function getStatus()
{
return $this->status;
}
public function getType()
{
return $this->type;
}
public function getFragDuration()
{
return $this->fragDuration;
}
public function getFragCount()
{
return $this->fragCount;
}
public function getPlayListName()
{
return $this->playlistName;
}
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
$this->description = strval($xml->Description);
$this->status = strval($xml->Status);
if (isset($xml->Target)) {
foreach ($xml->Target as $target) {
$this->type = strval($target->Type);
$this->fragDuration = strval($target->FragDuration);
$this->fragCount = strval($target->FragCount);
$this->playlistName = strval($target->PlaylistName);
}
}
}
public function serializeToXml()
{
throw new OssException("Not implemented.");
}
private $description;
private $status;
private $type;
private $fragDuration;
private $fragCount;
private $playlistName;
}
<?php
namespace OSS\Model;
/**
* Class GetLiveChannelStatus
* @package OSS\Model
*/
class GetLiveChannelStatus implements XmlConfig
{
public function getStatus()
{
return $this->status;
}
public function getConnectedTime()
{
return $this->connectedTime;
}
public function getRemoteAddr()
{
return $this->remoteAddr;
}
public function getVideoWidth()
{
return $this->videoWidth;
}
public function getVideoHeight()
{
return $this->videoHeight;
}
public function getVideoFrameRate()
{
return $this->videoFrameRate;
}
public function getVideoBandwidth()
{
return $this->videoBandwidth;
}
public function getVideoCodec()
{
return $this->videoCodec;
}
public function getAudioBandwidth()
{
return $this->audioBandwidth;
}
public function getAudioSampleRate()
{
return $this->audioSampleRate;
}
public function getAudioCodec()
{
return $this->audioCodec;
}
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
$this->status = strval($xml->Status);
$this->connectedTime = strval($xml->ConnectedTime);
$this->remoteAddr = strval($xml->RemoteAddr);
if (isset($xml->Video)) {
foreach ($xml->Video as $video) {
$this->videoWidth = intval($video->Width);
$this->videoHeight = intval($video->Height);
$this->videoFrameRate = intval($video->FrameRate);
$this->videoBandwidth = intval($video->Bandwidth);
$this->videoCodec = strval($video->Codec);
}
}
if (isset($xml->Video)) {
foreach ($xml->Audio as $audio) {
$this->audioBandwidth = intval($audio->Bandwidth);
$this->audioSampleRate = intval($audio->SampleRate);
$this->audioCodec = strval($audio->Codec);
}
}
}
public function serializeToXml()
{
throw new OssException("Not implemented.");
}
private $status;
private $connectedTime;
private $remoteAddr;
private $videoWidth;
private $videoHeight;
private $videoFrameRate;
private $videoBandwidth;
private $videoCodec;
private $audioBandwidth;
private $audioSampleRate;
private $audioCodec;
}
<?php
namespace OSS\Model;
/**
* Class LifecycleAction
* @package OSS\Model
* @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketLifecycle.html
*/
class LifecycleAction
{
/**
* LifecycleAction constructor.
* @param string $action
* @param string $timeSpec
* @param string $timeValue
*/
public function __construct($action, $timeSpec, $timeValue)
{
$this->action = $action;
$this->timeSpec = $timeSpec;
$this->timeValue = $timeValue;
}
/**
* @return LifecycleAction
*/
public function getAction()
{
return $this->action;
}
/**
* @param string $action
*/
public function setAction($action)
{
$this->action = $action;
}
/**
* @return string
*/
public function getTimeSpec()
{
return $this->timeSpec;
}
/**
* @param string $timeSpec
*/
public function setTimeSpec($timeSpec)
{
$this->timeSpec = $timeSpec;
}
/**
* @return string
*/
public function getTimeValue()
{
return $this->timeValue;
}
/**
* @param string $timeValue
*/
public function setTimeValue($timeValue)
{
$this->timeValue = $timeValue;
}
/**
* Use appendToXml to insert actions into xml.
*
* @param \SimpleXMLElement $xmlRule
*/
public function appendToXml(&$xmlRule)
{
$xmlAction = $xmlRule->addChild($this->action);
$xmlAction->addChild($this->timeSpec, $this->timeValue);
}
private $action;
private $timeSpec;
private $timeValue;
}
\ No newline at end of file
<?php
namespace OSS\Model;
use OSS\Core\OssException;
/**
* Class BucketLifecycleConfig
* @package OSS\Model
* @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketLifecycle.html
*/
class LifecycleConfig implements XmlConfig
{
/**
* Parse the xml into this object.
*
* @param string $strXml
* @throws OssException
* @return null
*/
public function parseFromXml($strXml)
{
$this->rules = array();
$xml = simplexml_load_string($strXml);
if (!isset($xml->Rule)) return;
$this->rules = array();
foreach ($xml->Rule as $rule) {
$id = strval($rule->ID);
$prefix = strval($rule->Prefix);
$status = strval($rule->Status);
$actions = array();
foreach ($rule as $key => $value) {
if ($key === 'ID' || $key === 'Prefix' || $key === 'Status') continue;
$action = $key;
$timeSpec = null;
$timeValue = null;
foreach ($value as $timeSpecKey => $timeValueValue) {
$timeSpec = $timeSpecKey;
$timeValue = strval($timeValueValue);
}
$actions[] = new LifecycleAction($action, $timeSpec, $timeValue);
}
$this->rules[] = new LifecycleRule($id, $prefix, $status, $actions);
}
return;
}
/**
* Serialize the object to xml
*
* @return string
*/
public function serializeToXml()
{
$xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><LifecycleConfiguration></LifecycleConfiguration>');
foreach ($this->rules as $rule) {
$xmlRule = $xml->addChild('Rule');
$rule->appendToXml($xmlRule);
}
return $xml->asXML();
}
/**
*
* Add a LifecycleRule
*
* @param LifecycleRule $lifecycleRule
* @throws OssException
*/
public function addRule($lifecycleRule)
{
if (!isset($lifecycleRule)) {
throw new OssException("lifecycleRule is null");
}
$this->rules[] = $lifecycleRule;
}
/**
* Serialize the object into xml string.
*
* @return string
*/
public function __toString()
{
return $this->serializeToXml();
}
/**
* Get all lifecycle rules.
*
* @return LifecycleRule[]
*/
public function getRules()
{
return $this->rules;
}
/**
* @var LifecycleRule[]
*/
private $rules;
}
<?php
namespace OSS\Model;
/**
* Class LifecycleRule
* @package OSS\Model
*
* @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketLifecycle.html
*/
class LifecycleRule
{
/**
* Get Id
*
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* @param string $id Rule Id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* Get a file prefix
*
* @return string
*/
public function getPrefix()
{
return $this->prefix;
}
/**
* Set a file prefix
*
* @param string $prefix The file prefix
*/
public function setPrefix($prefix)
{
$this->prefix = $prefix;
}
/**
* Get Lifecycle status
*
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* Set Lifecycle status
*
* @param string $status
*/
public function setStatus($status)
{
$this->status = $status;
}
/**
*
* @return LifecycleAction[]
*/
public function getActions()
{
return $this->actions;
}
/**
* @param LifecycleAction[] $actions
*/
public function setActions($actions)
{
$this->actions = $actions;
}
/**
* LifecycleRule constructor.
*
* @param string $id rule Id
* @param string $prefix File prefix
* @param string $status Rule status, which has the following valid values: [self::LIFECYCLE_STATUS_ENABLED, self::LIFECYCLE_STATUS_DISABLED]
* @param LifecycleAction[] $actions
*/
public function __construct($id, $prefix, $status, $actions)
{
$this->id = $id;
$this->prefix = $prefix;
$this->status = $status;
$this->actions = $actions;
}
/**
* @param \SimpleXMLElement $xmlRule
*/
public function appendToXml(&$xmlRule)
{
$xmlRule->addChild('ID', $this->id);
$xmlRule->addChild('Prefix', $this->prefix);
$xmlRule->addChild('Status', $this->status);
foreach ($this->actions as $action) {
$action->appendToXml($xmlRule);
}
}
private $id;
private $prefix;
private $status;
private $actions = array();
const LIFECYCLE_STATUS_ENABLED = 'Enabled';
const LIFECYCLE_STATUS_DISABLED = 'Disabled';
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Class ListMultipartUploadInfo
* @package OSS\Model
*
* @link http://help.aliyun.com/document_detail/oss/api-reference/multipart-upload/ListMultipartUploads.html
*/
class ListMultipartUploadInfo
{
/**
* ListMultipartUploadInfo constructor.
*
* @param string $bucket
* @param string $keyMarker
* @param string $uploadIdMarker
* @param string $nextKeyMarker
* @param string $nextUploadIdMarker
* @param string $delimiter
* @param string $prefix
* @param int $maxUploads
* @param string $isTruncated
* @param array $uploads
*/
public function __construct($bucket, $keyMarker, $uploadIdMarker, $nextKeyMarker, $nextUploadIdMarker, $delimiter, $prefix, $maxUploads, $isTruncated, array $uploads)
{
$this->bucket = $bucket;
$this->keyMarker = $keyMarker;
$this->uploadIdMarker = $uploadIdMarker;
$this->nextKeyMarker = $nextKeyMarker;
$this->nextUploadIdMarker = $nextUploadIdMarker;
$this->delimiter = $delimiter;
$this->prefix = $prefix;
$this->maxUploads = $maxUploads;
$this->isTruncated = $isTruncated;
$this->uploads = $uploads;
}
/**
* 得到bucket名称
*
* @return string
*/
public function getBucket()
{
return $this->bucket;
}
/**
* @return string
*/
public function getKeyMarker()
{
return $this->keyMarker;
}
/**
*
* @return string
*/
public function getUploadIdMarker()
{
return $this->uploadIdMarker;
}
/**
* @return string
*/
public function getNextKeyMarker()
{
return $this->nextKeyMarker;
}
/**
* @return string
*/
public function getNextUploadIdMarker()
{
return $this->nextUploadIdMarker;
}
/**
* @return string
*/
public function getDelimiter()
{
return $this->delimiter;
}
/**
* @return string
*/
public function getPrefix()
{
return $this->prefix;
}
/**
* @return int
*/
public function getMaxUploads()
{
return $this->maxUploads;
}
/**
* @return string
*/
public function getIsTruncated()
{
return $this->isTruncated;
}
/**
* @return UploadInfo[]
*/
public function getUploads()
{
return $this->uploads;
}
private $bucket = "";
private $keyMarker = "";
private $uploadIdMarker = "";
private $nextKeyMarker = "";
private $nextUploadIdMarker = "";
private $delimiter = "";
private $prefix = "";
private $maxUploads = 0;
private $isTruncated = "false";
private $uploads = array();
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Class ListPartsInfo
* @package OSS\Model
* @link http://help.aliyun.com/document_detail/oss/api-reference/multipart-upload/ListParts.html
*/
class ListPartsInfo
{
/**
* ListPartsInfo constructor.
* @param string $bucket
* @param string $key
* @param string $uploadId
* @param int $nextPartNumberMarker
* @param int $maxParts
* @param string $isTruncated
* @param array $listPart
*/
public function __construct($bucket, $key, $uploadId, $nextPartNumberMarker, $maxParts, $isTruncated, array $listPart)
{
$this->bucket = $bucket;
$this->key = $key;
$this->uploadId = $uploadId;
$this->nextPartNumberMarker = $nextPartNumberMarker;
$this->maxParts = $maxParts;
$this->isTruncated = $isTruncated;
$this->listPart = $listPart;
}
/**
* @return string
*/
public function getBucket()
{
return $this->bucket;
}
/**
* @return string
*/
public function getKey()
{
return $this->key;
}
/**
* @return string
*/
public function getUploadId()
{
return $this->uploadId;
}
/**
* @return int
*/
public function getNextPartNumberMarker()
{
return $this->nextPartNumberMarker;
}
/**
* @return int
*/
public function getMaxParts()
{
return $this->maxParts;
}
/**
* @return string
*/
public function getIsTruncated()
{
return $this->isTruncated;
}
/**
* @return array
*/
public function getListPart()
{
return $this->listPart;
}
private $bucket = "";
private $key = "";
private $uploadId = "";
private $nextPartNumberMarker = 0;
private $maxParts = 0;
private $isTruncated = "";
private $listPart = array();
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Class LiveChannelConfig
* @package OSS\Model
*/
class LiveChannelConfig implements XmlConfig
{
public function __construct($option = array())
{
if (isset($option['description'])) {
$this->description = $option['description'];
}
if (isset($option['status'])) {
$this->status = $option['status'];
}
if (isset($option['type'])) {
$this->type = $option['type'];
}
if (isset($option['fragDuration'])) {
$this->fragDuration = $option['fragDuration'];
}
if (isset($option['fragCount'])) {
$this->fragCount = $option['fragCount'];
}
if (isset($option['playListName'])) {
$this->playListName = $option['playListName'];
}
}
public function getDescription()
{
return $this->description;
}
public function getStatus()
{
return $this->status;
}
public function getType()
{
return $this->type;
}
public function getFragDuration()
{
return $this->fragDuration;
}
public function getFragCount()
{
return $this->fragCount;
}
public function getPlayListName()
{
return $this->playListName;
}
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
$this->description = strval($xml->Description);
$this->status = strval($xml->Status);
$target = $xml->Target;
$this->type = strval($target->Type);
$this->fragDuration = intval($target->FragDuration);
$this->fragCount = intval($target->FragCount);
$this->playListName = strval($target->PlayListName);
}
public function serializeToXml()
{
$strXml = <<<EOF
<?xml version="1.0" encoding="utf-8"?>
<LiveChannelConfiguration>
</LiveChannelConfiguration>
EOF;
$xml = new \SimpleXMLElement($strXml);
if (isset($this->description)) {
$xml->addChild('Description', $this->description);
}
if (isset($this->status)) {
$xml->addChild('Status', $this->status);
}
$node = $xml->addChild('Target');
$node->addChild('Type', $this->type);
if (isset($this->fragDuration)) {
$node->addChild('FragDuration', $this->fragDuration);
}
if (isset($this->fragCount)) {
$node->addChild('FragCount', $this->fragCount);
}
if (isset($this->playListName)) {
$node->addChild('PlayListName', $this->playListName);
}
return $xml->asXML();
}
public function __toString()
{
return $this->serializeToXml();
}
private $description;
private $status = "enabled";
private $type;
private $fragDuration = 5;
private $fragCount = 3;
private $playListName = "playlist.m3u8";
}
<?php
namespace OSS\Model;
/**
* Class LiveChannelHistory
* @package OSS\Model
*
*/
class LiveChannelHistory implements XmlConfig
{
public function __construct()
{
}
public function getStartTime()
{
return $this->startTime;
}
public function getEndTime()
{
return $this->endTime;
}
public function getRemoteAddr()
{
return $this->remoteAddr;
}
public function parseFromXmlNode($xml)
{
if (isset($xml->StartTime)) {
$this->startTime = strval($xml->StartTime);
}
if (isset($xml->EndTime)) {
$this->endTime = strval($xml->EndTime);
}
if (isset($xml->RemoteAddr)) {
$this->remoteAddr = strval($xml->RemoteAddr);
}
}
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
$this->parseFromXmlNode($xml);
}
public function serializeToXml()
{
throw new OssException("Not implemented.");
}
private $startTime;
private $endTime;
private $remoteAddr;
}
<?php
namespace OSS\Model;
/**
* Class LiveChannelInfo
* @package OSS\Model
*
*/
class LiveChannelInfo implements XmlConfig
{
public function __construct($name = null, $description = null)
{
$this->name = $name;
$this->description = $description;
$this->publishUrls = array();
$this->playUrls = array();
}
public function getName()
{
return $this->name;
}
public function setName($name)
{
$this->name = $name;
}
public function getPublishUrls()
{
return $this->publishUrls;
}
public function getPlayUrls()
{
return $this->playUrls;
}
public function getStatus()
{
return $this->status;
}
public function getLastModified()
{
return $this->lastModified;
}
public function getDescription()
{
return $this->description;
}
public function setDescription($description)
{
$this->description = $description;
}
public function parseFromXmlNode($xml)
{
if (isset($xml->Name)) {
$this->name = strval($xml->Name);
}
if (isset($xml->Description)) {
$this->description = strval($xml->Description);
}
if (isset($xml->Status)) {
$this->status = strval($xml->Status);
}
if (isset($xml->LastModified)) {
$this->lastModified = strval($xml->LastModified);
}
if (isset($xml->PublishUrls)) {
foreach ($xml->PublishUrls as $url) {
$this->publishUrls[] = strval($url->Url);
}
}
if (isset($xml->PlayUrls)) {
foreach ($xml->PlayUrls as $url) {
$this->playUrls[] = strval($url->Url);
}
}
}
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
$this->parseFromXmlNode($xml);
}
public function serializeToXml()
{
throw new OssException("Not implemented.");
}
private $name;
private $description;
private $publishUrls;
private $playUrls;
private $status;
private $lastModified;
}
<?php
namespace OSS\Model;
/**
* Class LiveChannelListInfo
*
* The data returned by ListBucketLiveChannels
*
* @package OSS\Model
* @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html
*/
class LiveChannelListInfo implements XmlConfig
{
/**
* @return string
*/
public function getBucketName()
{
return $this->bucket;
}
public function setBucketName($name)
{
$this->bucket = $name;
}
/**
* @return string
*/
public function getPrefix()
{
return $this->prefix;
}
/**
* @return string
*/
public function getMarker()
{
return $this->marker;
}
/**
* @return int
*/
public function getMaxKeys()
{
return $this->maxKeys;
}
/**
* @return mixed
*/
public function getIsTruncated()
{
return $this->isTruncated;
}
/**
* @return LiveChannelInfo[]
*/
public function getChannelList()
{
return $this->channelList;
}
/**
* @return string
*/
public function getNextMarker()
{
return $this->nextMarker;
}
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
$this->prefix = strval($xml->Prefix);
$this->marker = strval($xml->Marker);
$this->maxKeys = intval($xml->MaxKeys);
$this->isTruncated = (strval($xml->IsTruncated) == 'true');
$this->nextMarker = strval($xml->NextMarker);
if (isset($xml->LiveChannel)) {
foreach ($xml->LiveChannel as $chan) {
$channel = new LiveChannelInfo();
$channel->parseFromXmlNode($chan);
$this->channelList[] = $channel;
}
}
}
public function serializeToXml()
{
throw new OssException("Not implemented.");
}
private $bucket = '';
private $prefix = '';
private $marker = '';
private $nextMarker = '';
private $maxKeys = 100;
private $isTruncated = 'false';
private $channelList = array();
}
<?php
namespace OSS\Model;
/**
* Class LoggingConfig
* @package OSS\Model
* @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketLogging.html
*/
class LoggingConfig implements XmlConfig
{
/**
* LoggingConfig constructor.
* @param null $targetBucket
* @param null $targetPrefix
*/
public function __construct($targetBucket = null, $targetPrefix = null)
{
$this->targetBucket = $targetBucket;
$this->targetPrefix = $targetPrefix;
}
/**
* @param $strXml
* @return null
*/
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
if (!isset($xml->LoggingEnabled)) return;
foreach ($xml->LoggingEnabled as $status) {
foreach ($status as $key => $value) {
if ($key === 'TargetBucket') {
$this->targetBucket = strval($value);
} elseif ($key === 'TargetPrefix') {
$this->targetPrefix = strval($value);
}
}
break;
}
}
/**
* Serialize to xml string
*
*/
public function serializeToXml()
{
$xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><BucketLoggingStatus></BucketLoggingStatus>');
if (isset($this->targetBucket) && isset($this->targetPrefix)) {
$loggingEnabled = $xml->addChild('LoggingEnabled');
$loggingEnabled->addChild('TargetBucket', $this->targetBucket);
$loggingEnabled->addChild('TargetPrefix', $this->targetPrefix);
}
return $xml->asXML();
}
/**
* @return string
*/
public function __toString()
{
return $this->serializeToXml();
}
/**
* @return string
*/
public function getTargetBucket()
{
return $this->targetBucket;
}
/**
* @return string
*/
public function getTargetPrefix()
{
return $this->targetPrefix;
}
private $targetBucket = "";
private $targetPrefix = "";
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
*
* Class ObjectInfo
*
* The element type of ObjectListInfo, which is the return value type of listObjects
*
* The return value of listObjects includes two arrays
* One is the returned ObjectListInfo, which is similar to a file list in a file system.
* The other is the returned prefix list, which is similar to a folder list in a file system.
*
* @package OSS\Model
*/
class ObjectInfo
{
/**
* ObjectInfo constructor.
*
* @param string $key
* @param string $lastModified
* @param string $eTag
* @param string $type
* @param int $size
* @param string $storageClass
*/
public function __construct($key, $lastModified, $eTag, $type, $size, $storageClass)
{
$this->key = $key;
$this->lastModified = $lastModified;
$this->eTag = $eTag;
$this->type = $type;
$this->size = $size;
$this->storageClass = $storageClass;
}
/**
* @return string
*/
public function getKey()
{
return $this->key;
}
/**
* @return string
*/
public function getLastModified()
{
return $this->lastModified;
}
/**
* @return string
*/
public function getETag()
{
return $this->eTag;
}
/**
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* @return int
*/
public function getSize()
{
return $this->size;
}
/**
* @return string
*/
public function getStorageClass()
{
return $this->storageClass;
}
private $key = "";
private $lastModified = "";
private $eTag = "";
private $type = "";
private $size = 0;
private $storageClass = "";
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Class ObjectListInfo
*
* The class of return value of ListObjects
*
* @package OSS\Model
* @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html
*/
class ObjectListInfo
{
/**
* ObjectListInfo constructor.
*
* @param string $bucketName
* @param string $prefix
* @param string $marker
* @param string $nextMarker
* @param string $maxKeys
* @param string $delimiter
* @param null $isTruncated
* @param array $objectList
* @param array $prefixList
*/
public function __construct($bucketName, $prefix, $marker, $nextMarker, $maxKeys, $delimiter, $isTruncated, array $objectList, array $prefixList)
{
$this->bucketName = $bucketName;
$this->prefix = $prefix;
$this->marker = $marker;
$this->nextMarker = $nextMarker;
$this->maxKeys = $maxKeys;
$this->delimiter = $delimiter;
$this->isTruncated = $isTruncated;
$this->objectList = $objectList;
$this->prefixList = $prefixList;
}
/**
* @return string
*/
public function getBucketName()
{
return $this->bucketName;
}
/**
* @return string
*/
public function getPrefix()
{
return $this->prefix;
}
/**
* @return string
*/
public function getMarker()
{
return $this->marker;
}
/**
* @return int
*/
public function getMaxKeys()
{
return $this->maxKeys;
}
/**
* @return string
*/
public function getDelimiter()
{
return $this->delimiter;
}
/**
* @return mixed
*/
public function getIsTruncated()
{
return $this->isTruncated;
}
/**
* Get the ObjectInfo list.
*
* @return ObjectInfo[]
*/
public function getObjectList()
{
return $this->objectList;
}
/**
* Get the PrefixInfo list
*
* @return PrefixInfo[]
*/
public function getPrefixList()
{
return $this->prefixList;
}
/**
* @return string
*/
public function getNextMarker()
{
return $this->nextMarker;
}
private $bucketName = "";
private $prefix = "";
private $marker = "";
private $nextMarker = "";
private $maxKeys = 0;
private $delimiter = "";
private $isTruncated = null;
private $objectList = array();
private $prefixList = array();
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Class PartInfo
* @package OSS\Model
*/
class PartInfo
{
/**
* PartInfo constructor.
*
* @param int $partNumber
* @param string $lastModified
* @param string $eTag
* @param int $size
*/
public function __construct($partNumber, $lastModified, $eTag, $size)
{
$this->partNumber = $partNumber;
$this->lastModified = $lastModified;
$this->eTag = $eTag;
$this->size = $size;
}
/**
* @return int
*/
public function getPartNumber()
{
return $this->partNumber;
}
/**
* @return string
*/
public function getLastModified()
{
return $this->lastModified;
}
/**
* @return string
*/
public function getETag()
{
return $this->eTag;
}
/**
* @return int
*/
public function getSize()
{
return $this->size;
}
private $partNumber = 0;
private $lastModified = "";
private $eTag = "";
private $size = 0;
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Class PrefixInfo
*
* ListObjects return Prefix list of classes
* The returned data contains two arrays
* One is to get the list of objects【Can be understood as the corresponding file system file list】
* One is to get Prefix list【Can be understood as the corresponding file system directory list】
*
* @package OSS\Model
* @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/GetBucket.html
*/
class PrefixInfo
{
/**
* PrefixInfo constructor.
* @param string $prefix
*/
public function __construct($prefix)
{
$this->prefix = $prefix;
}
/**
* @return string
*/
public function getPrefix()
{
return $this->prefix;
}
private $prefix;
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Class RefererConfig
*
* @package OSS\Model
* @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketReferer.html
*/
class RefererConfig implements XmlConfig
{
/**
* @param string $strXml
* @return null
*/
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
if (!isset($xml->AllowEmptyReferer)) return;
if (!isset($xml->RefererList)) return;
$this->allowEmptyReferer =
(strval($xml->AllowEmptyReferer) === 'TRUE' || strval($xml->AllowEmptyReferer) === 'true') ? true : false;
foreach ($xml->RefererList->Referer as $key => $refer) {
$this->refererList[] = strval($refer);
}
}
/**
* serialize the RefererConfig object into xml string
*
* @return string
*/
public function serializeToXml()
{
$xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><RefererConfiguration></RefererConfiguration>');
if ($this->allowEmptyReferer) {
$xml->addChild('AllowEmptyReferer', 'true');
} else {
$xml->addChild('AllowEmptyReferer', 'false');
}
$refererList = $xml->addChild('RefererList');
foreach ($this->refererList as $referer) {
$refererList->addChild('Referer', $referer);
}
return $xml->asXML();
}
/**
* @return string
*/
function __toString()
{
return $this->serializeToXml();
}
/**
* @param boolean $allowEmptyReferer
*/
public function setAllowEmptyReferer($allowEmptyReferer)
{
$this->allowEmptyReferer = $allowEmptyReferer;
}
/**
* @param string $referer
*/
public function addReferer($referer)
{
$this->refererList[] = $referer;
}
/**
* @return boolean
*/
public function isAllowEmptyReferer()
{
return $this->allowEmptyReferer;
}
/**
* @return array
*/
public function getRefererList()
{
return $this->refererList;
}
private $allowEmptyReferer = true;
private $refererList = array();
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Class StorageCapacityConfig
*
* @package OSS\Model
* @link http://docs.alibaba-inc.com/pages/viewpage.action?pageId=271614763
*/
class StorageCapacityConfig implements XmlConfig
{
/**
* StorageCapacityConfig constructor.
*
* @param int $storageCapacity
*/
public function __construct($storageCapacity)
{
$this->storageCapacity = $storageCapacity;
}
/**
* Not implemented
*/
public function parseFromXml($strXml)
{
throw new OssException("Not implemented.");
}
/**
* Serialize StorageCapacityConfig into xml
*
* @return string
*/
public function serializeToXml()
{
$xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><BucketUserQos></BucketUserQos>');
$xml->addChild('StorageCapacity', strval($this->storageCapacity));
return $xml->asXML();
}
/**
* To string
*
* @return string
*/
function __toString()
{
return $this->serializeToXml();
}
/**
* Set storage capacity
*
* @param int $storageCapacity
*/
public function setStorageCapacity($storageCapacity)
{
$this->storageCapacity = $storageCapacity;
}
/**
* Get storage capacity
*
* @return int
*/
public function getStorageCapacity()
{
return $this->storageCapacity;
}
private $storageCapacity = 0;
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Class UploadInfo
*
* The return value of ListMultipartUpload
*
* @package OSS\Model
*/
class UploadInfo
{
/**
* UploadInfo constructor.
*
* @param string $key
* @param string $uploadId
* @param string $initiated
*/
public function __construct($key, $uploadId, $initiated)
{
$this->key = $key;
$this->uploadId = $uploadId;
$this->initiated = $initiated;
}
/**
* @return string
*/
public function getKey()
{
return $this->key;
}
/**
* @return string
*/
public function getUploadId()
{
return $this->uploadId;
}
/**
* @return string
*/
public function getInitiated()
{
return $this->initiated;
}
private $key = "";
private $uploadId = "";
private $initiated = "";
}
\ No newline at end of file
<?php
namespace OSS\Model;
use OSS\Core\OssException;
/**
* Class WebsiteConfig
* @package OSS\Model
* @link http://help.aliyun.com/document_detail/oss/api-reference/bucket/PutBucketWebsite.html
*/
class WebsiteConfig implements XmlConfig
{
/**
* WebsiteConfig constructor.
* @param string $indexDocument
* @param string $errorDocument
*/
public function __construct($indexDocument = "", $errorDocument = "")
{
$this->indexDocument = $indexDocument;
$this->errorDocument = $errorDocument;
}
/**
* @param string $strXml
* @return null
*/
public function parseFromXml($strXml)
{
$xml = simplexml_load_string($strXml);
if (isset($xml->IndexDocument) && isset($xml->IndexDocument->Suffix)) {
$this->indexDocument = strval($xml->IndexDocument->Suffix);
}
if (isset($xml->ErrorDocument) && isset($xml->ErrorDocument->Key)) {
$this->errorDocument = strval($xml->ErrorDocument->Key);
}
}
/**
* Serialize the WebsiteConfig object into xml string.
*
* @return string
* @throws OssException
*/
public function serializeToXml()
{
$xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><WebsiteConfiguration></WebsiteConfiguration>');
$index_document_part = $xml->addChild('IndexDocument');
$error_document_part = $xml->addChild('ErrorDocument');
$index_document_part->addChild('Suffix', $this->indexDocument);
$error_document_part->addChild('Key', $this->errorDocument);
return $xml->asXML();
}
/**
* @return string
*/
public function getIndexDocument()
{
return $this->indexDocument;
}
/**
* @return string
*/
public function getErrorDocument()
{
return $this->errorDocument;
}
private $indexDocument = "";
private $errorDocument = "";
}
\ No newline at end of file
<?php
namespace OSS\Model;
/**
* Interface XmlConfig
* @package OSS\Model
*/
interface XmlConfig
{
/**
* Interface method: Parse the object from the xml.
*
* @param string $strXml
* @return null
*/
public function parseFromXml($strXml);
/**
* Interface method: Serialize the object into xml.
*
* @return string
*/
public function serializeToXml();
}
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
namespace OSS\Result;
use OSS\Core\OssException;
/**
* The type of the return value of getBucketAcl, it wraps the data parsed from xml.
*
* @package OSS\Result
*/
class AclResult extends Result
{
/**
* @return string
* @throws OssException
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
if (empty($content)) {
throw new OssException("body is null");
}
$xml = simplexml_load_string($content);
if (isset($xml->AccessControlList->Grant)) {
return strval($xml->AccessControlList->Grant);
} else {
throw new OssException("xml format exception");
}
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Core\OssException;
/**
* Class AppendResult
* @package OSS\Result
*/
class AppendResult extends Result
{
/**
* Get the value of next-append-position from append's response headers
*
* @return int
* @throws OssException
*/
protected function parseDataFromResponse()
{
$header = $this->rawResponse->header;
if (isset($header["x-oss-next-append-position"])) {
return intval($header["x-oss-next-append-position"]);
}
throw new OssException("cannot get next-append-position");
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
/**
* Class BodyResult
* @package OSS\Result
*/
class BodyResult extends Result
{
/**
* @return string
*/
protected function parseDataFromResponse()
{
return empty($this->rawResponse->body) ? "" : $this->rawResponse->body;
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
/**
* Class CallbackResult
* @package OSS\Result
*/
class CallbackResult extends PutSetDeleteResult
{
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 && (int)(intval($status)) !== 203) {
return true;
}
return false;
}
}
<?php
namespace OSS\Result;
/**
* Class CopyObjectResult
* @package OSS\Result
*/
class CopyObjectResult extends Result
{
/**
* @return array()
*/
protected function parseDataFromResponse()
{
$body = $this->rawResponse->body;
$xml = simplexml_load_string($body);
$result = array();
if (isset($xml->LastModified)) {
$result[] = $xml->LastModified;
}
if (isset($xml->ETag)) {
$result[] = $xml->ETag;
}
return $result;
}
}
<?php
namespace OSS\Result;
/**
* Class DeleteObjectsResult
* @package OSS\Result
*/
class DeleteObjectsResult extends Result
{
/**
* @return array()
*/
protected function parseDataFromResponse()
{
$body = $this->rawResponse->body;
$xml = simplexml_load_string($body);
$objects = array();
if (isset($xml->Deleted)) {
foreach($xml->Deleted as $deleteKey)
$objects[] = $deleteKey->Key;
}
return $objects;
}
}
<?php
namespace OSS\Result;
/**
* Class ExistResult checks if bucket or object exists, according to the http status in response headers.
* @package OSS\Result
*/
class ExistResult extends Result
{
/**
* @return bool
*/
protected function parseDataFromResponse()
{
return intval($this->rawResponse->status) === 200 ? true : false;
}
/**
* Check if the response status is OK according to the http status code.
* [200-299]: OK; [404]: Not found. It means the object or bucket is not found--it's a valid response too.
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Model\CnameConfig;
class GetCnameResult extends Result
{
/**
* @return CnameConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new CnameConfig();
$config->parseFromXml($content);
return $config;
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Model\CorsConfig;
class GetCorsResult extends Result
{
/**
* @return CorsConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new CorsConfig();
$config->parseFromXml($content);
return $config;
}
/**
* Check if the response is OK, according to the http status. [200-299]:OK, the Cors config could be got; [404]: not found--no Cors config.
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Model\LifecycleConfig;
/**
* Class GetLifecycleResult
* @package OSS\Result
*/
class GetLifecycleResult extends Result
{
/**
* Parse the LifecycleConfig object from the response
*
* @return LifecycleConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new LifecycleConfig();
$config->parseFromXml($content);
return $config;
}
/**
* Check if the response is OK according to the http status.
* [200-299]: OK, and the LifecycleConfig could be got; [404] The Life cycle config is not found.
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}
<?php
namespace OSS\Result;
use OSS\Model\GetLiveChannelHistory;
class GetLiveChannelHistoryResult extends Result
{
/**
* @return
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$channelList = new GetLiveChannelHistory();
$channelList->parseFromXml($content);
return $channelList;
}
}
<?php
namespace OSS\Result;
use OSS\Model\GetLiveChannelInfo;
class GetLiveChannelInfoResult extends Result
{
/**
* @return
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$channelList = new GetLiveChannelInfo();
$channelList->parseFromXml($content);
return $channelList;
}
}
<?php
namespace OSS\Result;
use OSS\Model\GetLiveChannelStatus;
class GetLiveChannelStatusResult extends Result
{
/**
* @return
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$channelList = new GetLiveChannelStatus();
$channelList->parseFromXml($content);
return $channelList;
}
}
<?php
namespace OSS\Result;
use OSS\Core\OssException;
/**
* Class GetLocationResult getBucketLocation interface returns the result class, encapsulated
* The returned xml data is parsed
*
* @package OSS\Result
*/
class GetLocationResult extends Result
{
/**
* Parse data from response
*
* @return string
* @throws OssException
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
if (empty($content)) {
throw new OssException("body is null");
}
$xml = simplexml_load_string($content);
return $xml;
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Model\LoggingConfig;
/**
* Class GetLoggingResult
* @package OSS\Result
*/
class GetLoggingResult extends Result
{
/**
* Parse LoggingConfig data
*
* @return LoggingConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new LoggingConfig();
$config->parseFromXml($content);
return $config;
}
/**
* Judged according to the return HTTP status code, [200-299] that is OK, get the bucket configuration interface,
* 404 is also considered a valid response
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Model\RefererConfig;
/**
* Class GetRefererResult
* @package OSS\Result
*/
class GetRefererResult extends Result
{
/**
* Parse RefererConfig data
*
* @return RefererConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new RefererConfig();
$config->parseFromXml($content);
return $config;
}
/**
* Judged according to the return HTTP status code, [200-299] that is OK, get the bucket configuration interface,
* 404 is also considered a valid response
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Core\OssException;
/**
* Class AclResult GetBucketAcl interface returns the result class, encapsulated
* The returned xml data is parsed
*
* @package OSS\Result
*/
class GetStorageCapacityResult extends Result
{
/**
* Parse data from response
*
* @return string
* @throws OssException
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
if (empty($content)) {
throw new OssException("body is null");
}
$xml = simplexml_load_string($content);
if (isset($xml->StorageCapacity)) {
return intval($xml->StorageCapacity);
} else {
throw new OssException("xml format exception");
}
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Model\WebsiteConfig;
/**
* Class GetWebsiteResult
* @package OSS\Result
*/
class GetWebsiteResult extends Result
{
/**
* Parse WebsiteConfig data
*
* @return WebsiteConfig
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$config = new WebsiteConfig();
$config->parseFromXml($content);
return $config;
}
/**
* Judged according to the return HTTP status code, [200-299] that is OK, get the bucket configuration interface,
* 404 is also considered a valid response
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2 || (int)(intval($status)) === 404) {
return true;
}
return false;
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
/**
* Class HeaderResult
* @package OSS\Result
* @link https://docs.aliyun.com/?spm=5176.383663.13.7.HgUIqL#/pub/oss/api-reference/object&GetObjectMeta
*/
class HeaderResult extends Result
{
/**
* The returned ResponseCore header is used as the return data
*
* @return array
*/
protected function parseDataFromResponse()
{
return empty($this->rawResponse->header) ? array() : $this->rawResponse->header;
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Core\OssException;
/**
* Class initiateMultipartUploadResult
* @package OSS\Result
*/
class InitiateMultipartUploadResult extends Result
{
/**
* Get uploadId in result and return
*
* @throws OssException
* @return string
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$xml = simplexml_load_string($content);
if (isset($xml->UploadId)) {
return strval($xml->UploadId);
}
throw new OssException("cannot get UploadId");
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Model\BucketInfo;
use OSS\Model\BucketListInfo;
/**
* Class ListBucketsResult
*
* @package OSS\Result
*/
class ListBucketsResult extends Result
{
/**
* @return BucketListInfo
*/
protected function parseDataFromResponse()
{
$bucketList = array();
$content = $this->rawResponse->body;
$xml = new \SimpleXMLElement($content);
if (isset($xml->Buckets) && isset($xml->Buckets->Bucket)) {
foreach ($xml->Buckets->Bucket as $bucket) {
$bucketInfo = new BucketInfo(strval($bucket->Location),
strval($bucket->Name),
strval($bucket->CreationDate));
$bucketList[] = $bucketInfo;
}
}
return new BucketListInfo($bucketList);
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Model\LiveChannelListInfo;
class ListLiveChannelResult extends Result
{
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$channelList = new LiveChannelListInfo();
$channelList->parseFromXml($content);
return $channelList;
}
}
<?php
namespace OSS\Result;
use OSS\Core\OssUtil;
use OSS\Model\ListMultipartUploadInfo;
use OSS\Model\UploadInfo;
/**
* Class ListMultipartUploadResult
* @package OSS\Result
*/
class ListMultipartUploadResult extends Result
{
/**
* Parse the return data from the ListMultipartUpload interface
*
* @return ListMultipartUploadInfo
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$xml = simplexml_load_string($content);
$encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : "";
$bucket = isset($xml->Bucket) ? strval($xml->Bucket) : "";
$keyMarker = isset($xml->KeyMarker) ? strval($xml->KeyMarker) : "";
$keyMarker = OssUtil::decodeKey($keyMarker, $encodingType);
$uploadIdMarker = isset($xml->UploadIdMarker) ? strval($xml->UploadIdMarker) : "";
$nextKeyMarker = isset($xml->NextKeyMarker) ? strval($xml->NextKeyMarker) : "";
$nextKeyMarker = OssUtil::decodeKey($nextKeyMarker, $encodingType);
$nextUploadIdMarker = isset($xml->NextUploadIdMarker) ? strval($xml->NextUploadIdMarker) : "";
$delimiter = isset($xml->Delimiter) ? strval($xml->Delimiter) : "";
$delimiter = OssUtil::decodeKey($delimiter, $encodingType);
$prefix = isset($xml->Prefix) ? strval($xml->Prefix) : "";
$prefix = OssUtil::decodeKey($prefix, $encodingType);
$maxUploads = isset($xml->MaxUploads) ? intval($xml->MaxUploads) : 0;
$isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
$listUpload = array();
if (isset($xml->Upload)) {
foreach ($xml->Upload as $upload) {
$key = isset($upload->Key) ? strval($upload->Key) : "";
$key = OssUtil::decodeKey($key, $encodingType);
$uploadId = isset($upload->UploadId) ? strval($upload->UploadId) : "";
$initiated = isset($upload->Initiated) ? strval($upload->Initiated) : "";
$listUpload[] = new UploadInfo($key, $uploadId, $initiated);
}
}
return new ListMultipartUploadInfo($bucket, $keyMarker, $uploadIdMarker,
$nextKeyMarker, $nextUploadIdMarker,
$delimiter, $prefix, $maxUploads, $isTruncated, $listUpload);
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Core\OssUtil;
use OSS\Model\ObjectInfo;
use OSS\Model\ObjectListInfo;
use OSS\Model\PrefixInfo;
/**
* Class ListObjectsResult
* @package OSS\Result
*/
class ListObjectsResult extends Result
{
/**
* Parse the xml data returned by the ListObjects interface
*
* return ObjectListInfo
*/
protected function parseDataFromResponse()
{
$xml = new \SimpleXMLElement($this->rawResponse->body);
$encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : "";
$objectList = $this->parseObjectList($xml, $encodingType);
$prefixList = $this->parsePrefixList($xml, $encodingType);
$bucketName = isset($xml->Name) ? strval($xml->Name) : "";
$prefix = isset($xml->Prefix) ? strval($xml->Prefix) : "";
$prefix = OssUtil::decodeKey($prefix, $encodingType);
$marker = isset($xml->Marker) ? strval($xml->Marker) : "";
$marker = OssUtil::decodeKey($marker, $encodingType);
$maxKeys = isset($xml->MaxKeys) ? intval($xml->MaxKeys) : 0;
$delimiter = isset($xml->Delimiter) ? strval($xml->Delimiter) : "";
$delimiter = OssUtil::decodeKey($delimiter, $encodingType);
$isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
$nextMarker = isset($xml->NextMarker) ? strval($xml->NextMarker) : "";
$nextMarker = OssUtil::decodeKey($nextMarker, $encodingType);
return new ObjectListInfo($bucketName, $prefix, $marker, $nextMarker, $maxKeys, $delimiter, $isTruncated, $objectList, $prefixList);
}
private function parseObjectList($xml, $encodingType)
{
$retList = array();
if (isset($xml->Contents)) {
foreach ($xml->Contents as $content) {
$key = isset($content->Key) ? strval($content->Key) : "";
$key = OssUtil::decodeKey($key, $encodingType);
$lastModified = isset($content->LastModified) ? strval($content->LastModified) : "";
$eTag = isset($content->ETag) ? strval($content->ETag) : "";
$type = isset($content->Type) ? strval($content->Type) : "";
$size = isset($content->Size) ? intval($content->Size) : 0;
$storageClass = isset($content->StorageClass) ? strval($content->StorageClass) : "";
$retList[] = new ObjectInfo($key, $lastModified, $eTag, $type, $size, $storageClass);
}
}
return $retList;
}
private function parsePrefixList($xml, $encodingType)
{
$retList = array();
if (isset($xml->CommonPrefixes)) {
foreach ($xml->CommonPrefixes as $commonPrefix) {
$prefix = isset($commonPrefix->Prefix) ? strval($commonPrefix->Prefix) : "";
$prefix = OssUtil::decodeKey($prefix, $encodingType);
$retList[] = new PrefixInfo($prefix);
}
}
return $retList;
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Model\ListPartsInfo;
use OSS\Model\PartInfo;
/**
* Class ListPartsResult
* @package OSS\Result
*/
class ListPartsResult extends Result
{
/**
* Parse the xml data returned by the ListParts interface
*
* @return ListPartsInfo
*/
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$xml = simplexml_load_string($content);
$bucket = isset($xml->Bucket) ? strval($xml->Bucket) : "";
$key = isset($xml->Key) ? strval($xml->Key) : "";
$uploadId = isset($xml->UploadId) ? strval($xml->UploadId) : "";
$nextPartNumberMarker = isset($xml->NextPartNumberMarker) ? intval($xml->NextPartNumberMarker) : "";
$maxParts = isset($xml->MaxParts) ? intval($xml->MaxParts) : "";
$isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
$partList = array();
if (isset($xml->Part)) {
foreach ($xml->Part as $part) {
$partNumber = isset($part->PartNumber) ? intval($part->PartNumber) : "";
$lastModified = isset($part->LastModified) ? strval($part->LastModified) : "";
$eTag = isset($part->ETag) ? strval($part->ETag) : "";
$size = isset($part->Size) ? intval($part->Size) : "";
$partList[] = new PartInfo($partNumber, $lastModified, $eTag, $size);
}
}
return new ListPartsInfo($bucket, $key, $uploadId, $nextPartNumberMarker, $maxParts, $isTruncated, $partList);
}
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Model\LiveChannelInfo;
class PutLiveChannelResult extends Result
{
protected function parseDataFromResponse()
{
$content = $this->rawResponse->body;
$channel = new LiveChannelInfo();
$channel->parseFromXml($content);
return $channel;
}
}
<?php
namespace OSS\Result;
/**
* Class PutSetDeleteResult
* @package OSS\Result
*/
class PutSetDeleteResult extends Result
{
/**
* @return array()
*/
protected function parseDataFromResponse()
{
$body = array('body' => $this->rawResponse->body);
return array_merge($this->rawResponse->header, $body);
}
}
<?php
namespace OSS\Result;
use OSS\Core\OssException;
use OSS\Http\ResponseCore;
/**
* Class Result, The result class of The operation of the base class, different requests in dealing with the return of data have different logic,
* The specific parsing logic postponed to subclass implementation
*
* @package OSS\Model
*/
abstract class Result
{
/**
* Result constructor.
* @param $response ResponseCore
* @throws OssException
*/
public function __construct($response)
{
if ($response === null) {
throw new OssException("raw response is null");
}
$this->rawResponse = $response;
$this->parseResponse();
}
/**
* Get requestId
*
* @return string
*/
public function getRequestId()
{
if (isset($this->rawResponse) &&
isset($this->rawResponse->header) &&
isset($this->rawResponse->header['x-oss-request-id'])
) {
return $this->rawResponse->header['x-oss-request-id'];
} else {
return '';
}
}
/**
* Get the returned data, different request returns the data format is different
*
* $return mixed
*/
public function getData()
{
return $this->parsedData;
}
/**
* Subclass implementation, different requests return data has different analytical logic, implemented by subclasses
*
* @return mixed
*/
abstract protected function parseDataFromResponse();
/**
* Whether the operation is successful
*
* @return mixed
*/
public function isOK()
{
return $this->isOk;
}
/**
* @throws OssException
*/
public function parseResponse()
{
$this->isOk = $this->isResponseOk();
if ($this->isOk) {
$this->parsedData = $this->parseDataFromResponse();
} else {
$httpStatus = strval($this->rawResponse->status);
$requestId = strval($this->getRequestId());
$code = $this->retrieveErrorCode($this->rawResponse->body);
$message = $this->retrieveErrorMessage($this->rawResponse->body);
$body = $this->rawResponse->body;
$details = array(
'status' => $httpStatus,
'request-id' => $requestId,
'code' => $code,
'message' => $message,
'body' => $body
);
throw new OssException($details);
}
}
/**
* Try to get the error message from body
*
* @param $body
* @return string
*/
private function retrieveErrorMessage($body)
{
if (empty($body) || false === strpos($body, '<?xml')) {
return '';
}
$xml = simplexml_load_string($body);
if (isset($xml->Message)) {
return strval($xml->Message);
}
return '';
}
/**
* Try to get the error Code from body
*
* @param $body
* @return string
*/
private function retrieveErrorCode($body)
{
if (empty($body) || false === strpos($body, '<?xml')) {
return '';
}
$xml = simplexml_load_string($body);
if (isset($xml->Code)) {
return strval($xml->Code);
}
return '';
}
/**
* Judging from the return http status code, [200-299] that is OK
*
* @return bool
*/
protected function isResponseOk()
{
$status = $this->rawResponse->status;
if ((int)(intval($status) / 100) == 2) {
return true;
}
return false;
}
/**
* Return the original return data
*
* @return ResponseCore
*/
public function getRawResponse()
{
return $this->rawResponse;
}
/**
* Indicate whether the request is successful
*/
protected $isOk = false;
/**
* Data parsed by subclasses
*/
protected $parsedData = null;
/**
* Store the original Response returned by the auth function
*
* @var ResponseCore
*/
protected $rawResponse;
}
\ No newline at end of file
<?php
namespace OSS\Result;
use OSS\Core\OssException;
use OSS\OssClient;
/**
*
* @package OSS\Result
*/
class SymlinkResult extends Result
{
/**
* @return string
* @throws OssException
*/
protected function parseDataFromResponse()
{
$this->rawResponse->header[OssClient::OSS_SYMLINK_TARGET] = rawurldecode($this->rawResponse->header[OssClient::OSS_SYMLINK_TARGET]);
return $this->rawResponse->header;
}
}
<?php
namespace OSS\Result;
use OSS\Core\OssException;
/**
* Class UploadPartResult
* @package OSS\Result
*/
class UploadPartResult extends Result
{
/**
* 结果中part的ETag
*
* @return string
* @throws OssException
*/
protected function parseDataFromResponse()
{
$header = $this->rawResponse->header;
if (isset($header["etag"])) {
return $header["etag"];
}
throw new OssException("cannot get ETag");
}
}
\ No newline at end of file
<?php
function classLoader($class)
{
$path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
$file = __DIR__ . DIRECTORY_SEPARATOR . $path . '.php';
if (file_exists($file)) {
require_once $file;
}
}
spl_autoload_register('classLoader');
\ No newline at end of file
...@@ -61,7 +61,7 @@ $government_list = CompassHandler::getGovernmentlListForAccount(); ...@@ -61,7 +61,7 @@ $government_list = CompassHandler::getGovernmentlListForAccount();
$_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_edit_input.js"); $_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_edit_input.js");
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["menu_clicked"] = "4-1"; $layout_pages["menu_clicked"] = "5-1";
$layout_pages["right"] = "account_edit_input.inc"; $layout_pages["right"] = "account_edit_input.inc";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
...@@ -65,7 +65,7 @@ if (count($account_list) > 1) { ...@@ -65,7 +65,7 @@ if (count($account_list) > 1) {
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "account_edit_input.inc"; $layout_pages["right"] = "account_edit_input.inc";
$layout_pages["menu_clicked"] = "4-1"; $layout_pages["menu_clicked"] = "5-1";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
} }
......
...@@ -27,6 +27,8 @@ $sort = ParamUtil::getRequestString("sort", "DESC"); ...@@ -27,6 +27,8 @@ $sort = ParamUtil::getRequestString("sort", "DESC");
$page_num = ParamUtil::getRequestNumber("page_num", 1); $page_num = ParamUtil::getRequestNumber("page_num", 1);
$page_row = MANAGER_DEFAULT_ROW_COUNT; $page_row = MANAGER_DEFAULT_ROW_COUNT;
$paging_url_link = "./account_list.php"; $paging_url_link = "./account_list.php";
$account_list = [];
// 一览取得 // 一览取得
$param = array(); $param = array();
$param["delete_flg"] = false; $param["delete_flg"] = false;
...@@ -47,6 +49,6 @@ if ($account_count > 0) { ...@@ -47,6 +49,6 @@ if ($account_count > 0) {
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "account_list.inc"; $layout_pages["right"] = "account_list.inc";
$layout_pages["menu_clicked"] = "4-1"; $layout_pages["menu_clicked"] = "5-1";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
...@@ -35,6 +35,6 @@ $_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_new_input.js"); ...@@ -35,6 +35,6 @@ $_SCRIPT_FILE = array("scripts/validators.js", "scripts/account_new_input.js");
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "account_new_input.inc"; $layout_pages["right"] = "account_new_input.inc";
$layout_pages["menu_clicked"] = "4-1"; $layout_pages["menu_clicked"] = "5-1";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
...@@ -62,7 +62,7 @@ if (count($account_list) > 0) { ...@@ -62,7 +62,7 @@ if (count($account_list) > 0) {
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "account_new_input.inc"; $layout_pages["right"] = "account_new_input.inc";
$layout_pages["menu_clicked"] = "4-1"; $layout_pages["menu_clicked"] = "5-1";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
} }
......
<?php
/**
* 视频标签添加
* $Id: ajax_add_media_tag.php
* @author lixq
* @access public
* @package manager.public_html
*/
// クラス・設定読み込み
require_once ("manager_include.inc");
// ログインチェック
require_once ("check_login.inc");
$tag = ParamUtil::getRequestString("tag");
// 参数检查
if (empty($tag)) {
CompassHandler::responseApiNg("0001", "请输入标签名!");
}
$param = [];
$param["delete_flg"] = false;
$param["tag"] = $tag;
$tag_count = MediaTagDat::getListCount($param);
if($tag_count > 0){
CompassHandler::responseApiNg("0002", "已存在此标签名!");
}
$media_tag_dat = new MediaTagDat();
$media_tag_dat->tag = $tag;
$media_tag_dat->save();
CompassHandler::responseApiOk("");
\ No newline at end of file
<?php <?php
/** /**
* 管理员管理 * 班级管理
* $Id: account_edit_input.php,v 1.1 2015/10/08 11:18:46 wanggb Exp $ * $Id: class_edit_input.php,v 1.1 2015/10/08 11:18:46 wanggb Exp $
* @author wanggb * @author wanggb
* @package manager.public_html * @package manager.public_html
*/ */
...@@ -13,35 +13,27 @@ require_once("manager_include.inc"); ...@@ -13,35 +13,27 @@ require_once("manager_include.inc");
require_once("check_login.inc"); require_once("check_login.inc");
// 权限检查 // 权限检查
if (!checkAuthority("ADMIN")) { if (!checkAuthority("3")) {
// エラー表示 // エラー表示
$layout_pages = array(); $layout_pages = array();
$layout_pages["footer"] = "footer.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["top"] = "menu.inc"; $layout_pages["right"] = "error.inc";
$layout_pages["middle"] = "error.inc";
$message = "权限不足,请联系系统管理员。"; $message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
} }
// 参数取得 // 参数取得
$id = ParamUtil::getRequestString("id"); $id = ParamUtil::getRequestString("id");
$action_type = ParamUtil::getRequestString("action_type"); $class_mst = ClassMst::getById($id);
$class_mst = new ClassMst(); $school_title = SchoolMst::getById($class_mst->school_id)->title;
if($action_type=="edit"){ $grade_title = GradeMst::getById($class_mst->grade_id)->title;
$class_mst = ClassMst::getById($id);
}
//年级列表取得
$param = array();
$param["school_id"] = 1;
$param["delete_flg"] = false;
$grade_list = GradeMst::getList($param,"id","asc");
// 页面表示 // 页面表示
$_SCRIPT_FILE = array("scripts/validators.js", "scripts/class.js"); $_SCRIPT_FILE = array("scripts/validators.js", "scripts/class.js");
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "class_edit_input.inc"; $layout_pages["right"] = "class_edit_input.inc";
$layout_pages["menu_clicked"] = "menu_class"; $layout_pages["menu_clicked"] = "1-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
...@@ -13,55 +13,39 @@ require_once("manager_include.inc"); ...@@ -13,55 +13,39 @@ require_once("manager_include.inc");
require_once("check_login.inc"); require_once("check_login.inc");
// 权限检查 // 权限检查
if (!checkAuthority("ADMIN")) { if (!checkAuthority("3")) {
// エラー表示 // エラー表示
$layout_pages = array(); $layout_pages = array();
$layout_pages["footer"] = "footer.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["top"] = "menu.inc"; $layout_pages["right"] = "error.inc";
$layout_pages["middle"] = "error.inc";
$message = "权限不足,请联系系统管理员。"; $message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/topmenutopsub_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
} }
// 参数取得 // 参数取得
$action_type = ParamUtil::getRequestString("action_type");//new edit $member_count = ParamUtil::getRequestString("member_count");//new edit
$id = ParamUtil::getRequestString("id"); $id = ParamUtil::getRequestString("id");
$class_no = ParamUtil::getRequestString("class_no");
$title = ParamUtil::getRequestString("title");
$member_count = ParamUtil::getRequestNumber("member_count");
$school_id = ParamUtil::getRequestNumber("school_id", 1);
$grade_id = ParamUtil::getRequestNumber("grade_id");
$manager_id = ParamUtil::getRequestNumber("manager_id",0);
//创建的时候
if($action_type=="new") {
$class_mst = new ClassMst();
}
//编辑 //编辑
if($action_type=="edit") { $class_mst = ClassMst::getById($id);
$class_mst = ClassMst::getById($id); if ($class_mst == null) {
if ($class_mst == null) {
// エラー表示 // エラー表示
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc"; $layout_pages["right"] = "error.inc";
$layout_pages["menu_clicked"] = "menu_class"; $layout_pages["menu_clicked"] = "1-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
}
} }
// 数据库更新 // 数据库更新
$class_mst->school_id = $school_id;
$class_mst->grade_id = $grade_id;
$class_mst->class_no = $class_no;
$class_mst->title = $title;
$class_mst->member_count = $member_count; $class_mst->member_count = $member_count;
$class_mst->manager_id = $manager_id;
$class_mst->save(); $class_mst->save();
// 跳到一览页 $layout_pages = array();
header("Location:class_list.php"); $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "class_edit_result.inc";
$layout_pages["menu_clicked"] = "1-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
<?php <?php
/** /**
* 管理员管理 * 班级设定
* $Id: account_list.php,v 1.1 2015/10/08 11:18:46 wanggb Exp $ * $Id: class_list.php,v 1.1 2015/10/08 11:18:46 wanggb Exp $
* @author zhanghuichuan * @author zhanghuichuan
* @package manager.public_html * @package manager.public_html
*/ */
...@@ -12,7 +12,7 @@ require_once("manager_include.inc"); ...@@ -12,7 +12,7 @@ require_once("manager_include.inc");
require_once("check_login.inc"); require_once("check_login.inc");
// 权限检查 // 权限检查
if (!checkAuthority("ADMIN")) { if (!checkAuthority("3")) {
// エラー表示 // エラー表示
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
...@@ -22,15 +22,28 @@ if (!checkAuthority("ADMIN")) { ...@@ -22,15 +22,28 @@ if (!checkAuthority("ADMIN")) {
exit; exit;
} }
$school_id = ParamUtil::getRequestString("school_id");
if(!empty($_account->school_id)){
$school_id = $_account->school_id;
$school_mst = SchoolMst::getById($school_id);
}
// 一览取得 // 一览取得
$param = array(); $param = array();
$param["delete_flg"] = false; if(!empty($school_id)){
$class_list = ClassMst::getList($param,"id","asc"); $param["school_id"] = $school_id;
}
$class_list = CompassHandler::getClassList($param,"id","asc");
if(empty($school_id)){
$param = array();
$param["delete_flg"] = false;
$school_list = SchoolMst::getList($param);
}
// ページ // ページ
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "class_list.inc"; $layout_pages["right"] = "class_list.inc";
$layout_pages["menu_clicked"] = "menu_class"; $layout_pages["menu_clicked"] = "1-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
<?php
/**
* 合集视频
* $Id: collection_media_list.php,v 1.1 2020/01/03 11:18:46 Exp $
* @author lixq
* @package manager.public_html
*/
// 底层包含
require_once("manager_include.inc");
// 登录检查
require_once("check_login.inc");
// 权限检查
if (!checkAuthority("11")) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
$message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
$title = ParamUtil::getRequestString("title");
$order_key = ParamUtil::getRequestString("order_key", "id");
$sort = ParamUtil::getRequestString("sort", "ASC");
$page_num = ParamUtil::getRequestNumber("page_num", 1);
$page_row = MANAGER_DEFAULT_ROW_COUNT;
$paging_url_link = "./collection_media_list.php";
// trueの場合、Sessionを再設定
$search_flg = ParamUtil::getRequestBoolean("search_flg", false);
$session_name = "collection_media_list";
if ($search_flg) {
if (isset($_SESSION[$session_name])){
$param = $_SESSION[$session_name];
} else {
$param = array();
}
if (isset($param["title"])) {
$title = $param["title"];
}
if (isset($param["page_num"])) {
$page_num = $param["page_num"];
}
} else {
// 検索条件を作成してsessionに設定
$param = array();
if (!empty($school_title)) {
$param["title"] = $title;
}
if (!empty($page_num)) {
$param["page_num"] = $page_num;
}
$_SESSION[$session_name] = $param;
}
$school_list = [];
// 一览取得
$param = array();
$param["delete_flg"] = false;
if (!empty($title)) {
$param["title_ALT"] = "%" . $title . "%";
}
//总件数
$course_count = CourseMst::getListCount($param);
// 获取相应页面的数据
if ($course_count > 0) {
$offset = ($page_num - 1) * $page_row;
$course_list = CompassHandler::getCourseList($param, $order_key, $sort, $offset, $page_row);
$page_count = ceil($school_count / $page_row);
$show_page_num = MANAGER_PAGING_SHOW_PAGE_COUNT;
$page_range = PagingHandler::getPageRange($page_num, $page_count, $show_page_num);
$page_first = $page_range[0];
$page_end = $page_range[1];
}
// ページ
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "school_list.inc";
$layout_pages["menu_clicked"] = "1-1";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
\ No newline at end of file
...@@ -19,6 +19,11 @@ textarea { ...@@ -19,6 +19,11 @@ textarea {
font-family:arial, 'Microsoft Yahei', '微软雅黑'; font-family:arial, 'Microsoft Yahei', '微软雅黑';
font-size: 10pt; font-size: 10pt;
border: solid 1px #606060; border: solid 1px #606060;
color: #606266;
width:200px;
margin-bottom:15px;
color: #606266;
border-radius: 4px;
} }
textarea:focus { textarea:focus {
border: 1px solid #9595E0; border: 1px solid #9595E0;
...@@ -494,4 +499,14 @@ th.contents_title { ...@@ -494,4 +499,14 @@ th.contents_title {
margin-left:10px; margin-left:10px;
font-size: 10pt; font-size: 10pt;
} }
/*分页部分*/
.page_footer{
margin-top: 20px;
margin-bottom: 20px;
width: 100%;
}
.height_30{
height:30px;
padding:0 10px !important;
}
/*******2020/1/3添加新式样结束*******/ /*******2020/1/3添加新式样结束*******/
/* ポップアップセレクト */
.popselect input[type="text"]{
background-image: url(../images/search_icon.png);
background-repeat:no-repeat;
background-position:right;
background-color: #D0DFFF;
}
/** メッセージ表示用のダイアログ */
div.hiddendialog{
position: absolute;
visibility:hidden;
top: 0px;
left: 0px;
width: 1px;
height: 1px;
}
/**
* 画面表示用のレイヤーとしてのDIV
*/
div.showdialog {
/*position: absolute; */
position: fixed;
visibility:visible;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
z-index:3;
border: none 1px #000000;
background-image: url(../images/shadow.png);
background-repeat: repeat;
color: #000000;
overflow: hidden;
text-align:center;
}
/**
* ダイアログとしての表示領域
*/
div #selectdialogouterframe{
position: relative;
margin-top: 40px;
margin-left: auto;
margin-right: auto;
text-align: left;
background:#E7E7E7;
border:1px solid #C0C0C0;
border-radius:5px;
overflow: hidden;
}
/**
* ダイアログの中の見出し。
*/
div.selectdialoginnerheader{
position: relative;
margin-top: 5px;
margin-left: auto;
margin-right: 5px;
margin-bottom: 0px;
overflow: hidden;
text-align: right;
}
div.selectdialoginnerheader a {
margin-right: 10px;
}
/**
* ダイアログの中の表示領域。ここの中でスクロールする。
*/
div.selectdialoginnerframe{
position: relative;
margin-top: 5px;
margin-left: auto;
margin-right: auto;
margin-bottom: 10px;
overflow-y: scroll;
background:#FFFFFF;
}
.searchtable {
text-align:left;
margin: 20px auto;
width:90%;
border-collapse: collapse;
}
.searchtable tr td {
padding:5px;
width:166px;
text-align:left;
}
.candidatetable {
text-align:left;
margin: 20px auto;
width:90%;
border:1px dashed #C0C0C0;
border-collapse: collapse;
}
.candidatetable tr td {
padding:5px;
width:166px;
border:1px dashed #C0C0C0;
}
.candidatetable tr td.no_popup_result {
text-align:center;
}
.candidatetable tr td a {
text-align:left;
}
.candidatetable th {
height:17px;
text-align:center;
background-color:#EFEFEF;
border:1px dashed #C0C0C0;
}
/*checkbox table three row*/
.threerowtable {
text-align:left;
margin: 20px auto;
width:90%;
border:1px dashed #C0C0C0;
border-collapse: collapse;
}
.threerowtable tr td {
padding:5px;
width:40%;
border:1px dashed #C0C0C0;
}
.threerowtable tr td .checkbox{
padding:5px;
width:20%;
border:1px dashed #C0C0C0;
}
.threerowtable tr td.no_popup_result {
text-align:center;
}
.threerowtable tr td a {
text-align:left;
}
.threerowtable th {
height:17px;
text-align:center;
background-color:#EFEFEF;
border:1px dashed #C0C0C0;
}
.threerowtable tr td .image_td{
width: 40px;
}
/**
* 候補一覧テーブル内容
*/
table.candidatetable {
/*
position: relative;
width: 100%;
height: 650px;
*/
}
td.img_td {
text-align: center;
vertical-align: middle;
}
.candidatetable_child_table{
border:medium none ;
}
.candidatetable_child_table tr td{
border:medium none ;
text-align: center;
vertical-align: middle;
}
.candidatetable_child_table tr td.image_td {
width:70px;
}
.candidatetable_child_table tr td.image_title_td{
text-align: left;
}
\ No newline at end of file
...@@ -30,6 +30,6 @@ $government_mst = GovernmentMst::getById($id); ...@@ -30,6 +30,6 @@ $government_mst = GovernmentMst::getById($id);
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "government_edit_input.inc"; $layout_pages["right"] = "government_edit_input.inc";
$layout_pages["menu_clicked"] = "4-2"; $layout_pages["menu_clicked"] = "5-2";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
...@@ -31,7 +31,7 @@ if ($government_mst == null) { ...@@ -31,7 +31,7 @@ if ($government_mst == null) {
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc"; $layout_pages["right"] = "error.inc";
$layout_pages["menu_clicked"] = "4-2"; $layout_pages["menu_clicked"] = "5-2";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
} }
...@@ -43,6 +43,6 @@ $government_mst->save(); ...@@ -43,6 +43,6 @@ $government_mst->save();
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "government_edit_result.inc"; $layout_pages["right"] = "government_edit_result.inc";
$layout_pages["menu_clicked"] = "4-2"; $layout_pages["menu_clicked"] = "5-2";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
...@@ -22,15 +22,33 @@ if (!checkAuthority("ADMIN")) { ...@@ -22,15 +22,33 @@ if (!checkAuthority("ADMIN")) {
exit; exit;
} }
$government_list = [];
$order_key = ParamUtil::getRequestString("order_key", "id");
$sort = ParamUtil::getRequestString("sort", "ASC");
$page_num = ParamUtil::getRequestNumber("page_num", 1);
$page_row = MANAGER_DEFAULT_ROW_COUNT;
$paging_url_link = "./government_list.php";
// 一览取得 // 一览取得
$param = array(); $param = array();
$param["delete_flg"] = false; $param["delete_flg"] = false;
$government_list = GovernmentMst::getList($param,"id","asc"); //总件数
$government_count = GovernmentMst::getListCount($param);
// 获取相应页面的数据
if ($government_count > 0) {
$offset = ($page_num - 1) * $page_row;
$government_list = CompassHandler::getGovernmentlList($param, $order_key, $sort, $offset, $page_row);
$page_count = ceil($government_count / $page_row);
$show_page_num = MANAGER_PAGING_SHOW_PAGE_COUNT;
$page_range = PagingHandler::getPageRange($page_num, $page_count, $show_page_num);
$page_first = $page_range[0];
$page_end = $page_range[1];
}
// ページ // ページ
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "government_list.inc"; $layout_pages["right"] = "government_list.inc";
$layout_pages["menu_clicked"] = "4-2"; $layout_pages["menu_clicked"] = "5-2";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
...@@ -27,6 +27,6 @@ if (!checkAuthority("ADMIN")) { ...@@ -27,6 +27,6 @@ if (!checkAuthority("ADMIN")) {
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "government_new.inc"; $layout_pages["right"] = "government_new.inc";
$layout_pages["menu_clicked"] = "4-2"; $layout_pages["menu_clicked"] = "5-2";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
...@@ -87,7 +87,7 @@ if (!empty($csv_error_msg)) { ...@@ -87,7 +87,7 @@ if (!empty($csv_error_msg)) {
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "government_new.inc"; $layout_pages["right"] = "government_new.inc";
$layout_pages["menu_clicked"] = "4-2"; $layout_pages["menu_clicked"] = "5-2";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
} }
...@@ -95,6 +95,6 @@ if (!empty($csv_error_msg)) { ...@@ -95,6 +95,6 @@ if (!empty($csv_error_msg)) {
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "government_new_result.inc"; $layout_pages["right"] = "government_new_result.inc";
$layout_pages["menu_clicked"] = "4-2"; $layout_pages["menu_clicked"] = "5-2";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc"); require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit; exit;
\ No newline at end of file
...@@ -11,8 +11,10 @@ require_once("manager_include.inc"); ...@@ -11,8 +11,10 @@ require_once("manager_include.inc");
// 登录检查 // 登录检查
require_once("check_login.inc"); require_once("check_login.inc");
// 权限检查 // 权限检查
if (!checkAuthority("ADMIN")) { if (!checkAuthority("3")) {
// エラー表示 // エラー表示
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
...@@ -22,11 +24,24 @@ if (!checkAuthority("ADMIN")) { ...@@ -22,11 +24,24 @@ if (!checkAuthority("ADMIN")) {
exit; exit;
} }
$school_id = ParamUtil::getRequestString("school_id");
if(!empty($_account->school_id)){
$school_id = $_account->school_id;
$school_mst = SchoolMst::getById($school_id);
}
// 一览取得 // 一览取得
$param = array(); $param = array();
$param["delete_flg"] = false; $param["delete_flg"] = false;
if(!empty($school_id)){
$param["school_id"] = $school_id;
}
$grade_list = GradeMst::getList($param,"id","asc"); $grade_list = GradeMst::getList($param,"id","asc");
if(empty($school_id)){
$param = array();
$param["delete_flg"] = false;
$school_list = SchoolMst::getList($param);
}
// ページ // ページ
$layout_pages = array(); $layout_pages = array();
$layout_pages["left"] = "menu.inc"; $layout_pages["left"] = "menu.inc";
......
<?php
/**
* 视频上传
* $Id: media_upload.php,v 1.1 2020/01/03 11:18:46 Exp $
* @author lixq
* @package manager.public_html
*/
// 底层包含
require_once("manager_include.inc");
// 登录检查
require_once("check_login.inc");
// 权限检查
if (!checkAuthority("11")) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
$message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
$param = [];
$param["delete_flg"] = false;
$media_tag_list = MediaTagDat::getList($param);
$course_list = CourseMst::getList($param);
// JavaScriptページ
$_SCRIPT_FILE = array("scripts/validators.js", "scripts/media_upload.js","scripts/form_checkbox_common.js");
// ページ
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "media_upload.inc";
$layout_pages["menu_clicked"] = "4-3";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
\ No newline at end of file
<?php
/**
* Popup合集视频一览取得
* $Id: pop_media_list.php
* @author wangtl
* @package manager.public_html
*/
// クラス・設定読み込み
require_once("manager_include.inc");
// ログインチェック
require_once("check_login.inc");
// 権限チェック
if (!checkAuthority("11")) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
$message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
$param["delete_flg"] = false;
$course_list = CourseMst::getList($param,"id","ASC");
$result = array();
foreach ($course_list as $tmp) {
array_push($result, $tmp);
}
echo json_encode($result);
?>
<?php
/**
* Popup视频标签一览取得
* $Id: pop_tag_list.php
* @author wangtl
* @package manager.public_html
*/
// クラス・設定読み込み
require_once("manager_include.inc");
// ログインチェック
require_once("check_login.inc");
// 権限チェック
if (!checkAuthority("11")) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
$message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
$tag_id = ParamUtil::getRequestString("tag_id");
$param = array();
if (!empty($tag_id)) {
$param["id"] = explode(",",$tag_id);
}
$param["delete_flg"] = false;
$tag_list = MediaTagDat::getList($param,"id","ASC");
$result = array();
foreach ($tag_list as $tmp) {
array_push($result, $tmp);
}
echo json_encode($result);
?>
<?php
/**
* 学校管理编辑
* $Id: school_edit.php,v 1.1 2020/01/03 11:18:46 Exp $
* @author lixq
* @package manager.public_html
*/
// 底层包含
require_once("manager_include.inc");
// 登录检查
require_once("check_login.inc");
// 权限检查
if (!checkAuthority("3")) {
// エラー表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "error.inc";
$message = "权限不足,请联系系统管理员。";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
}
// 参数取得
$id = ParamUtil::getRequestString("id");
$school_mst = SchoolMst::getById($id);
$can_back = true;
// 页面表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
$layout_pages["right"] = "school_edit_input.inc";
$layout_pages["menu_clicked"] = "1-1";
require_once(MANAGER_TEMPLATE_DIR_PATH . "/layout/leftmenu_layout.inc");
exit;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment