fix options

This commit is contained in:
joyqi 2021-09-02 11:58:02 +08:00
parent 7bd37f7d8c
commit 86587d40ce
5 changed files with 9 additions and 16 deletions

View File

@ -744,7 +744,6 @@ function install_step_1_perform()
{
$errors = [];
$checks = [
'curl',
'mbstring',
'json',
'Reflection',

View File

@ -312,7 +312,7 @@ EOF;
* 使用方法:
* <code>
* $input = '这是一段被截断的html文本<a href="#"';
* echo Typecho_Common::fixHtml($input);
* echo Common::fixHtml($input);
* //output: 这是一段被截断的html文本
* </code>
*
@ -378,7 +378,7 @@ EOF;
* 使用方法:
* <code>
* $input = '<a href="http://test/test.php" title="example">hello</a>';
* $output = Typecho_Common::stripTags($input, <a href="">);
* $output = Common::stripTags($input, <a href="">);
* echo $output;
* //display: '<a href="http://test/test.php">hello</a>'
* </code>

View File

@ -3,7 +3,7 @@
namespace Typecho;
/**
* Typecho_Feed
* Feed
*
* @package Feed
*/

View File

@ -22,24 +22,18 @@ class Client
/** 定义行结束符 */
public const EOL = "\r\n";
private const ADAPTERS = ['Curl', 'Socket'];
private const ADAPTERS = [Adapter\Curl::class, Adapter\Socket::class];
/**
* 获取可用的连接
*
* @param string ...$adapters
* @return ?Adapter
*/
public static function get(string ...$adapters): ?Adapter
public static function get(): ?Adapter
{
if (empty($adapters)) {
$adapters = self::ADAPTERS;
}
foreach ($adapters as $adapter) {
$adapterName = 'Typecho_Http_Client_Adapter_' . $adapter;
if (call_user_func([$adapterName, 'isAvailable'])) {
return new $adapterName();
foreach (self::ADAPTERS as $adapter) {
if (call_user_func([$adapter, 'isAvailable'])) {
return new $adapter();
}
}

View File

@ -195,7 +195,7 @@ class Helper
}
/**
* 获取Widget_Options对象
* 获取Options对象
*
* @return Options
*/