mirror of
https://github.com/typecho/typecho.git
synced 2025-03-18 08:59:40 +01:00
fix options
This commit is contained in:
parent
7bd37f7d8c
commit
86587d40ce
@ -744,7 +744,6 @@ function install_step_1_perform()
|
||||
{
|
||||
$errors = [];
|
||||
$checks = [
|
||||
'curl',
|
||||
'mbstring',
|
||||
'json',
|
||||
'Reflection',
|
||||
|
@ -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>
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace Typecho;
|
||||
|
||||
/**
|
||||
* Typecho_Feed
|
||||
* Feed
|
||||
*
|
||||
* @package Feed
|
||||
*/
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ class Helper
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Widget_Options对象
|
||||
* 获取Options对象
|
||||
*
|
||||
* @return Options
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user