first commit
This commit is contained in:
38
var/IXR/Base64.php
Executable file
38
var/IXR/Base64.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace IXR;
|
||||
|
||||
/**
|
||||
* IXR Base64编码
|
||||
*
|
||||
* @package IXR
|
||||
*/
|
||||
class Base64
|
||||
{
|
||||
/**
|
||||
* 编码数据
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private string $data;
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*
|
||||
* @param string $data
|
||||
*/
|
||||
public function __construct(string $data)
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取XML数据
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getXml()
|
||||
{
|
||||
return '<base64>' . base64_encode($this->data) . '</base64>';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user