diff --git a/Dockerfile b/Dockerfile
index f4df400f7..13814876e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,8 +4,7 @@ ARG timezone
ENV TIMEZONE=${timezone:-"Asia/Shanghai"} \
APP_ENV=prod \
- SCAN_CACHEABLE=(false)
-
+ SCAN_CACHEABLE=(true)
RUN set -ex \
# show php version and extensions
diff --git a/app/CodeFec/Admin/LogServer.php b/app/CodeFec/Admin/LogServer.php
index d4c30cca6..60b13a4cf 100644
--- a/app/CodeFec/Admin/LogServer.php
+++ b/app/CodeFec/Admin/LogServer.php
@@ -10,7 +10,7 @@
*/
namespace App\CodeFec\Admin;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use SleekDB\Exceptions\IdNotAllowedException;
use SleekDB\Exceptions\InvalidArgumentException;
use SleekDB\Exceptions\InvalidConfigurationException;
diff --git a/app/CodeFec/DockerInstall.php b/app/CodeFec/DockerInstall.php
index 75849f9c2..dea06e55a 100644
--- a/app/CodeFec/DockerInstall.php
+++ b/app/CodeFec/DockerInstall.php
@@ -17,7 +17,7 @@
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Schema\Schema;
use Hyperf\DbConnection\Db;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use PDOException;
use Swoole\Coroutine\System;
use Symfony\Component\Console\Application;
@@ -121,7 +121,7 @@ public function migrate()
$input = new ArrayInput($params);
$output = new NullOutput();
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
/** @var Application $application */
$application = $container->get(\Hyperf\Contract\ApplicationInterface::class);
@@ -150,7 +150,7 @@ public function migrate()
$input = new ArrayInput($params);
$output = new NullOutput();
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
/** @var Application $application */
$application = $container->get(\Hyperf\Contract\ApplicationInterface::class);
@@ -215,7 +215,7 @@ public function update_v2()
$input = new ArrayInput($params);
$output = new NullOutput();
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
/** @var Application $application */
$application = $container->get(\Hyperf\Contract\ApplicationInterface::class);
diff --git a/app/CodeFec/Header/functions.php b/app/CodeFec/Header/functions.php
index 0d4d6081c..36b4d5d85 100644
--- a/app/CodeFec/Header/functions.php
+++ b/app/CodeFec/Header/functions.php
@@ -14,7 +14,7 @@ class functions
{
public static function header(): HeaderInterface
{
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
return $container->get(HeaderInterface::class);
}
diff --git a/app/CodeFec/Install.php b/app/CodeFec/Install.php
index d489ee1d4..65d460ca2 100644
--- a/app/CodeFec/Install.php
+++ b/app/CodeFec/Install.php
@@ -17,7 +17,7 @@
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Schema\Schema;
use Hyperf\DbConnection\Db;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use PDOException;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
@@ -187,7 +187,7 @@ public function step_3()
$input = new ArrayInput($params);
$output = new NullOutput();
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
/** @var Application $application */
$application = $container->get(\Hyperf\Contract\ApplicationInterface::class);
@@ -216,7 +216,7 @@ public function step_3()
$input = new ArrayInput($params);
$output = new NullOutput();
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
/** @var Application $application */
$application = $container->get(\Hyperf\Contract\ApplicationInterface::class);
@@ -296,7 +296,7 @@ public function step_4()
$input = new ArrayInput($params);
$output = new NullOutput();
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
/** @var Application $application */
$application = $container->get(\Hyperf\Contract\ApplicationInterface::class);
diff --git a/app/CodeFec/Ui/Generate/PayGenerate.php b/app/CodeFec/Ui/Generate/PayGenerate.php
index 91770e1f5..61be12bf8 100644
--- a/app/CodeFec/Ui/Generate/PayGenerate.php
+++ b/app/CodeFec/Ui/Generate/PayGenerate.php
@@ -1,90 +1,96 @@
$type,
"value" => $value,
];
- $this->list = Arr::add($this->list,$id,$arr);
+ $this->list = Arr::set($this->list,$id,$arr);
return true;
}
diff --git a/app/CodeFec/Ui/functions.php b/app/CodeFec/Ui/functions.php
index 0393edb2d..f4fd08e9e 100644
--- a/app/CodeFec/Ui/functions.php
+++ b/app/CodeFec/Ui/functions.php
@@ -6,7 +6,7 @@ class functions
{
public static function Ui()
{
- return \Hyperf\Utils\ApplicationContext::getContainer()->get(UiInterface::class);
+ return \Hyperf\Context\ApplicationContext::getContainer()->get(UiInterface::class);
}
public static function get($type): array
diff --git a/app/CodeFec/Upgrading.php b/app/CodeFec/Upgrading.php
index 6faebf870..6d99a00a8 100644
--- a/app/CodeFec/Upgrading.php
+++ b/app/CodeFec/Upgrading.php
@@ -174,7 +174,7 @@ private function AdminPluginMigrateAll(): void
$input = new ArrayInput($params);
$output = new NullOutput();
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
/** @var Application $application */
$application = $container->get(\Hyperf\Contract\ApplicationInterface::class);
diff --git a/app/CodeFec/View/HyperfViewEngine.php b/app/CodeFec/View/HyperfViewEngine.php
index edbc661ce..2c40ca94c 100644
--- a/app/CodeFec/View/HyperfViewEngine.php
+++ b/app/CodeFec/View/HyperfViewEngine.php
@@ -11,25 +11,26 @@
namespace App\CodeFec\View;
use App\CodeFec\Plugins;
-use Hyperf\Utils\ApplicationContext;
+use Hyperf\Di\Annotation\Inject;
use Hyperf\View\Engine\EngineInterface;
use Hyperf\ViewEngine\Contract\FactoryInterface;
class HyperfViewEngine implements EngineInterface
{
+ #[Inject]
+ protected FactoryInterface $factory;
+
public function render($template, $data, $config): string
{
- /** @var FactoryInterface $factory */
- $factory = ApplicationContext::getContainer()->get(FactoryInterface::class);
// 插件
$plugin_list = (new Plugins())->getEnPlugins();
foreach ($plugin_list as $value) {
- $factory->addNamespace($value, plugin_path($value . '/resources/views'));
+ $this->factory->addNamespace($value, plugin_path($value . '/resources/views'));
}
// 主题
$name = get_options('theme', 'CodeFec');
- $factory->replaceNamespace('App', theme_path($name . '/resources/views'));
- $factory->replaceNamespace('Core', theme_path($name . '/resources/views'));
- return $factory->make($template, $data)->render();
+ $this->factory->replaceNamespace('App', theme_path($name . '/resources/views'));
+ $this->factory->replaceNamespace('Core', theme_path($name . '/resources/views'));
+ return $this->factory->make($template, $data)->render();
}
}
diff --git a/app/Command/ServerDocker.php b/app/Command/ServerDocker.php
index 57813b97e..75c616503 100644
--- a/app/Command/ServerDocker.php
+++ b/app/Command/ServerDocker.php
@@ -1,6 +1,6 @@
container = $container;
@@ -36,30 +41,51 @@ public function __construct(ContainerInterface $container)
$this->addOption('dir', 'D', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, '', []);
$this->addOption('no-restart', 'N', InputOption::VALUE_NONE, 'Whether no need to restart server');
}
-
+
public function configure()
{
parent::configure();
$this->setDescription('start docker server');
}
-
+
public function handle()
{
- if (!file_exists(BASE_PATH . '/app/CodeFec/storage/install.lock')) {
- if (!is_dir(BASE_PATH . '/app/CodeFec/storage')) {
+ if (! file_exists(BASE_PATH . '/app/CodeFec/storage/install.lock')) {
+ if (! is_dir(BASE_PATH . '/app/CodeFec/storage')) {
System::exec('cd ' . BASE_PATH . '/app/CodeFec && mkdir storage');
}
- $myfile = fopen(BASE_PATH . '/app/CodeFec/storage/install.step.lock', 'wb') or exit('Unable to open file!');
- fwrite($myfile, "5");
- fclose($myfile);
$install = make(DockerInstall::class, ['output' => $this->output, 'command' => $this]);
$install->run();
}
- go(function () {
- system_clear_cache();
- });
- $option = make(Option::class, ['dir' => $this->input->getOption('dir'), 'file' => $this->input->getOption('file'), 'restart' => !$this->input->getOption('no-restart')]);
- $watcher = make(Watcher::class, ['option' => $option, 'output' => $this->output]);
- $watcher->run();
}
-}
\ No newline at end of file
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ shell_exec('composer du');
+ $this->checkEnvironment($output);
+ $serverFactory = $this->container->get(ServerFactory::class);
+ $serverFactory->setEventDispatcher($this->container->get(EventDispatcherInterface::class));
+ $serverFactory->setLogger($this->container->get(StdoutLoggerInterface::class));
+ $serverConfig = $this->container->get(ConfigInterface::class)->get('server', []);
+ if (! $serverConfig) {
+ throw new \InvalidArgumentException('At least one se$rver should be defined.');
+ }
+ $serverFactory->configure($serverConfig);
+ Coroutine::set(['hook_flags' => \Hyperf\Support\swoole_hook_flags()]);
+ $serverFactory->start();
+ return 0;
+ }
+
+ private function checkEnvironment(OutputInterface $output)
+ {
+ if (! extension_loaded('swoole')) {
+ return;
+ }
+ $useShortname = ini_get_all('swoole')['swoole.use_shortname']['local_value'];
+ $useShortname = strtolower(trim(str_replace('0', '', $useShortname)));
+ if (! in_array($useShortname, ['', 'off', 'false'], true)) {
+ $output->writeln("ERROR Swoole short function names must be disabled before the server starts, please set swoole.use_shortname='Off' in your php.ini.");
+ exit(SIGTERM);
+ }
+ }
+}
diff --git a/app/Command/StartCommand.php b/app/Command/StartCommand.php
index 6220a18fa..1f0189c80 100644
--- a/app/Command/StartCommand.php
+++ b/app/Command/StartCommand.php
@@ -1,6 +1,6 @@
addOption('dir', 'D', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, '', []);
$this->addOption('no-restart', 'N', InputOption::VALUE_NONE, 'Whether no need to restart server');
}
-
+
public function handle()
{
// TODO: Implement handle() method.
}
-
+
protected function execute(InputInterface $input, OutputInterface $output)
{
shell_exec('composer du');
@@ -52,7 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->checkEnvironment($output);
$serverFactory = $this->container->get(ServerFactory::class)->setEventDispatcher($this->container->get(EventDispatcherInterface::class))->setLogger($this->container->get(StdoutLoggerInterface::class));
$serverConfig = $this->container->get(ConfigInterface::class)->get('server', []);
- if (!$serverConfig) {
+ if (! $serverConfig) {
throw new InvalidArgumentException('At least one server should be defined.');
}
$serverFactory->configure($serverConfig);
@@ -64,17 +63,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
return 0;
}
-
- private function removeFiles(...$values) : void
+
+ private function removeFiles(...$values): void
{
foreach ($values as $value) {
exec('rm -rf "' . $value . '"');
}
}
-
+
private function checkEnvironment(OutputInterface $output)
{
- if (!extension_loaded('swoole')) {
+ if (! extension_loaded('swoole')) {
return;
}
/**
@@ -102,9 +101,9 @@ private function checkEnvironment(OutputInterface $output)
*/
$useShortname = ini_get_all('swoole')['swoole.use_shortname']['local_value'];
$useShortname = strtolower(trim(str_replace('0', '', $useShortname)));
- if (!in_array($useShortname, ['', 'off', 'false'], true)) {
+ if (! in_array($useShortname, ['', 'off', 'false'], true)) {
$output->writeln("ERROR Swoole short function names must be disabled before the server starts, please set swoole.use_shortname='Off' in your php.ini.");
exit(SIGTERM);
}
}
-}
\ No newline at end of file
+}
diff --git a/app/Controller/Admin/BackupController.php b/app/Controller/Admin/BackupController.php
index d71abb124..0489419b6 100644
--- a/app/Controller/Admin/BackupController.php
+++ b/app/Controller/Admin/BackupController.php
@@ -16,7 +16,7 @@
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\Paginator\LengthAwarePaginator;
use Hyperf\Utils\Collection;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Swoole\Coroutine\System;
use Symfony\Component\Finder\Finder;
diff --git a/app/Controller/Admin/Hook/ComponentController.php b/app/Controller/Admin/Hook/ComponentController.php
index 645aa0f51..d99c479bc 100644
--- a/app/Controller/Admin/Hook/ComponentController.php
+++ b/app/Controller/Admin/Hook/ComponentController.php
@@ -18,7 +18,7 @@
use Hyperf\HttpServer\Annotation\PostMapping;
use Hyperf\Paginator\LengthAwarePaginator;
use Hyperf\Utils\Collection;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Hyperf\ViewEngine\Contract\FactoryInterface;
use Swoole\Coroutine\System;
use Symfony\Component\Finder\Finder;
@@ -52,7 +52,7 @@ public function preview()
{
$component = request()->input('component');
$component = 'customize.component.' . $component;
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
$factory = $container->get(FactoryInterface::class);
if (!$factory->exists($component)) {
return admin_abort('小部件不存在', 403);
diff --git a/app/Controller/ApiController.php b/app/Controller/ApiController.php
index 30701342a..1272ee66f 100755
--- a/app/Controller/ApiController.php
+++ b/app/Controller/ApiController.php
@@ -74,7 +74,7 @@ public function AdminPluginSave() : array
$params = ['command' => 'ClearCache'];
$input = new ArrayInput($params);
$output = new NullOutput();
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
/** @var Application $application */
$application = $container->get(\Hyperf\Contract\ApplicationInterface::class);
$application->setAutoExit(false);
@@ -122,7 +122,7 @@ public function AdminPluginMigrate($name = null) : array
$params = ['command' => 'CodeFec:migrate', 'path' => plugin_path($plugin_name . '/src/migrations')];
$input = new ArrayInput($params);
$output = new NullOutput();
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
/** @var Application $application */
$application = $container->get(\Hyperf\Contract\ApplicationInterface::class);
$application->setAutoExit(false);
@@ -150,7 +150,7 @@ public function AdminPluginUpdatePackage()
$params = ['command' => 'CodeFec:PluginsComposerInstall'];
$input = new ArrayInput($params);
$output = new NullOutput();
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
/** @var Application $application */
$application = $container->get(\Hyperf\Contract\ApplicationInterface::class);
$application->setAutoExit(false);
diff --git a/app/Controller/PluginsController.php b/app/Controller/PluginsController.php
index 68aecd5fa..b9e122ad4 100755
--- a/app/Controller/PluginsController.php
+++ b/app/Controller/PluginsController.php
@@ -18,7 +18,7 @@
use Hyperf\HttpServer\Annotation\PostMapping;
use Hyperf\Paginator\LengthAwarePaginator;
use Hyperf\Utils\Collection;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Http\Message\ResponseInterface;
@@ -152,7 +152,7 @@ private function migrate_resources($plugin_name)
$input = new ArrayInput($params);
$output = new NullOutput();
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
/** @var Application $application */
$application = $container->get(\Hyperf\Contract\ApplicationInterface::class);
diff --git a/app/Controller/ThemesController.php b/app/Controller/ThemesController.php
index 4c8711fba..172112dbd 100644
--- a/app/Controller/ThemesController.php
+++ b/app/Controller/ThemesController.php
@@ -8,7 +8,7 @@
use App\Request\Admin\PluginUpload;
use App\Request\Admin\ThemeUpload;
use Hyperf\HttpServer\Annotation\{Controller, GetMapping, Middleware, PostMapping};
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
#[Controller(prefix: "/admin/themes")]
#[Middleware(AdminMiddleware::class)]
diff --git a/app/Exception/Handler/AppExceptionHandler.php b/app/Exception/Handler/AppExceptionHandler.php
index a1ac66dc9..b6594ab17 100755
--- a/app/Exception/Handler/AppExceptionHandler.php
+++ b/app/Exception/Handler/AppExceptionHandler.php
@@ -13,7 +13,7 @@
use Hyperf\Contract\StdoutLoggerInterface;
use Hyperf\ExceptionHandler\ExceptionHandler;
use Hyperf\HttpMessage\Stream\SwooleStream;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Psr\Http\Message\ResponseInterface;
use Qbhy\HyperfAuth\Exception\UnauthorizedException;
use Throwable;
diff --git a/app/Exception/Handler/ValidationExceptionHandler.php b/app/Exception/Handler/ValidationExceptionHandler.php
index 991f0bfb8..61b4a93b8 100755
--- a/app/Exception/Handler/ValidationExceptionHandler.php
+++ b/app/Exception/Handler/ValidationExceptionHandler.php
@@ -35,7 +35,7 @@ public function handle(Throwable $throwable, ResponseInterface $response): Respo
if (! $response->hasHeader('content-type')) {
$response = $response->withAddedHeader('content-type', 'text/plain; charset=utf-8');
}
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
$responses = $container->get(\Hyperf\HttpServer\Contract\ResponseInterface::class);
return $responses->json(Json_Api($throwable->status, false, $body));
diff --git a/app/Listener/DbQueryExecutedListener.php b/app/Listener/DbQueryExecutedListener.php
index dcd6a80e4..b25bf0427 100755
--- a/app/Listener/DbQueryExecutedListener.php
+++ b/app/Listener/DbQueryExecutedListener.php
@@ -16,7 +16,7 @@
use Hyperf\Event\Contract\ListenerInterface;
use Hyperf\Logger\LoggerFactory;
use Hyperf\Utils\Arr;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
diff --git a/app/Listener/InstallSuccessListener.php b/app/Listener/InstallSuccessListener.php
index 914bbd914..16496042c 100644
--- a/app/Listener/InstallSuccessListener.php
+++ b/app/Listener/InstallSuccessListener.php
@@ -7,7 +7,7 @@
use Hyperf\DB\DB;
use Hyperf\Event\Annotation\Listener;
use Hyperf\Event\Contract\ListenerInterface;
-use Hyperf\Utils\ApplicationContext;
+use Hyperf\Context\ApplicationContext;
/**
* 安装成功
diff --git a/app/Middleware/CsrfMiddleware.php b/app/Middleware/CsrfMiddleware.php
index e01a48cca..aef81f085 100755
--- a/app/Middleware/CsrfMiddleware.php
+++ b/app/Middleware/CsrfMiddleware.php
@@ -11,7 +11,7 @@
namespace App\Middleware;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
diff --git a/app/Middleware/InstallMiddleware.php b/app/Middleware/InstallMiddleware.php
index 32638d97b..9a2141598 100755
--- a/app/Middleware/InstallMiddleware.php
+++ b/app/Middleware/InstallMiddleware.php
@@ -10,7 +10,7 @@
*/
namespace App\Middleware;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
diff --git a/app/Plugins/Comment/resources/views/Notice/comment.blade.php b/app/Plugins/Comment/resources/views/Notice/comment.blade.php
index 7be1cb841..03dd25026 100644
--- a/app/Plugins/Comment/resources/views/Notice/comment.blade.php
+++ b/app/Plugins/Comment/resources/views/Notice/comment.blade.php
@@ -16,7 +16,7 @@
{{__("topic.comment.comment content")}}
- {{\Hyperf\Utils\Str::limit(remove_bbCode(strip_tags($data->post->content)),100)}}
+ {{\Hyperf\Stringable\Str::limit(remove_bbCode(strip_tags($data->post->content)),100)}}
\ No newline at end of file
diff --git a/app/Plugins/Comment/resources/views/Notice/reply.blade.php b/app/Plugins/Comment/resources/views/Notice/reply.blade.php
index 8f1b9e0b4..1076d52bd 100644
--- a/app/Plugins/Comment/resources/views/Notice/reply.blade.php
+++ b/app/Plugins/Comment/resources/views/Notice/reply.blade.php
@@ -24,10 +24,10 @@
{{$data->parent->user->username}} {{__("app.Published on")}} {{$data->created_at}}
- {{\Hyperf\Utils\Str::limit(remove_bbCode(strip_tags($data->parent->post->content)),60)}}
+ {{\Hyperf\Stringable\Str::limit(remove_bbCode(strip_tags($data->parent->post->content)),60)}}
- {{\Hyperf\Utils\Str::limit(remove_bbCode(strip_tags($data->post->content)),100)}}
+ {{\Hyperf\Stringable\Str::limit(remove_bbCode(strip_tags($data->post->content)),100)}}
\ No newline at end of file
diff --git a/app/Plugins/Comment/resources/views/ShortCode/comment.blade.php b/app/Plugins/Comment/resources/views/ShortCode/comment.blade.php
index 0bd1f2a85..fc4641d62 100644
--- a/app/Plugins/Comment/resources/views/ShortCode/comment.blade.php
+++ b/app/Plugins/Comment/resources/views/ShortCode/comment.blade.php
@@ -47,7 +47,7 @@
{{$value->parent->user->username}} {{__("app.Published on")}} {{format_date($value->created_at)}}
- {!! \Hyperf\Utils\Str::limit(remove_bbCode(strip_tags($value->parent->post->content)),60) !!}
+ {!! \Hyperf\Stringable\Str::limit(remove_bbCode(strip_tags($value->parent->post->content)),60) !!}
@endif
diff --git a/app/Plugins/Comment/resources/views/Widget/source.blade.php b/app/Plugins/Comment/resources/views/Widget/source.blade.php
index 8036c375e..c479d3411 100644
--- a/app/Plugins/Comment/resources/views/Widget/source.blade.php
+++ b/app/Plugins/Comment/resources/views/Widget/source.blade.php
@@ -9,7 +9,7 @@ class="col-md-12 markdown mt-3 mb-2" style="font-size: 15px">
{{$value->parent->user->username}} {{__("app.Published on")}} {{format_date($value->parent->created_at)}}
- {!! \Hyperf\Utils\Str::limit(remove_bbCode(strip_tags($value->parent->post->content)),60) !!}
+ {!! \Hyperf\Stringable\Str::limit(remove_bbCode(strip_tags($value->parent->post->content)),60) !!}
@else
diff --git a/app/Plugins/Comment/resources/views/topic/create.blade.php b/app/Plugins/Comment/resources/views/topic/create.blade.php
index 027c98128..c37c24c5c 100644
--- a/app/Plugins/Comment/resources/views/topic/create.blade.php
+++ b/app/Plugins/Comment/resources/views/topic/create.blade.php
@@ -1,5 +1,5 @@
@extends('App::app')
-@section('title','评论帖子【'.\Hyperf\Utils\Str::limit($topic->title,25).'】')
+@section('title','评论帖子【'.\Hyperf\Stringable\Str::limit($topic->title,25).'】')
@section('content')
@@ -13,7 +13,7 @@
- {{\Hyperf\Utils\Str::limit($topic->title,25)}}
+ {{\Hyperf\Stringable\Str::limit($topic->title,25)}}
回帖
diff --git a/app/Plugins/Comment/resources/views/topic/edit.blade.php b/app/Plugins/Comment/resources/views/topic/edit.blade.php
index 9ec38863e..b1558bd8a 100644
--- a/app/Plugins/Comment/resources/views/topic/edit.blade.php
+++ b/app/Plugins/Comment/resources/views/topic/edit.blade.php
@@ -17,7 +17,7 @@
- {{\Hyperf\Utils\Str::limit($comment->topic->title,25)}}
+ {{\Hyperf\Stringable\Str::limit($comment->topic->title,25)}}
diff --git a/app/Plugins/Core/helpers.php b/app/Plugins/Core/helpers.php
index 5c8dafebc..f72cf7b6a 100755
--- a/app/Plugins/Core/helpers.php
+++ b/app/Plugins/Core/helpers.php
@@ -90,7 +90,7 @@ function core_menu_pd(string $id)
if (! function_exists('core_Itf_id')) {
function core_Itf_id($name, $id)
{
- return \Hyperf\Utils\Str::after($id, $name . '_');
+ return \Hyperf\Stringable\Str::after($id, $name . '_');
}
}
@@ -310,7 +310,7 @@ function intercept_province(string $address)
// 输出
$echo = null;
foreach ($province as $item) {
- if (\Hyperf\Utils\Str::is('*' . $item . '*', $address)) {
+ if (\Hyperf\Stringable\Str::is('*' . $item . '*', $address)) {
$echo = $item;
}
}
diff --git a/app/Plugins/Core/src/Command/Update/v238.php b/app/Plugins/Core/src/Command/Update/v238.php
index 23055b83a..9b5b48489 100644
--- a/app/Plugins/Core/src/Command/Update/v238.php
+++ b/app/Plugins/Core/src/Command/Update/v238.php
@@ -14,7 +14,7 @@
use Hyperf\Command\Command as HyperfCommand;
use Hyperf\Database\Schema\Schema;
use Hyperf\DbConnection\Db;
-use Hyperf\Utils\ApplicationContext;
+use Hyperf\Context\ApplicationContext;
use Psr\Container\ContainerInterface;
use Symfony\Component\Console\Helper\ProgressBar;
#[Command]
diff --git a/app/Plugins/Core/src/Controller/Order/UserController.php b/app/Plugins/Core/src/Controller/Order/UserController.php
index 398afa325..159e1dca5 100644
--- a/app/Plugins/Core/src/Controller/Order/UserController.php
+++ b/app/Plugins/Core/src/Controller/Order/UserController.php
@@ -9,7 +9,7 @@
use Hyperf\HttpServer\Annotation\GetMapping;
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\HttpServer\Annotation\PostMapping;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
#[Controller(prefix: "/user/order")]
#[Middleware(LoginMiddleware::class)]
#[Middleware(AuthMiddleware::class)]
diff --git a/app/Plugins/Core/src/Controller/Pay/SFPayController.php b/app/Plugins/Core/src/Controller/Pay/SFPayController.php
index f568c16f4..d789f4bcc 100644
--- a/app/Plugins/Core/src/Controller/Pay/SFPayController.php
+++ b/app/Plugins/Core/src/Controller/Pay/SFPayController.php
@@ -12,7 +12,7 @@
use Hyperf\HttpServer\Annotation\GetMapping;
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\HttpServer\Annotation\PostMapping;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use HyperfExt\Hashing\Hash;
#[Controller(prefix: '/pay/SFPay')]
#[Middleware(LoginMiddleware::class)]
diff --git a/app/Plugins/Core/src/Controller/User/UpdateController.php b/app/Plugins/Core/src/Controller/User/UpdateController.php
index 25a5aa4aa..38d63e827 100644
--- a/app/Plugins/Core/src/Controller/User/UpdateController.php
+++ b/app/Plugins/Core/src/Controller/User/UpdateController.php
@@ -96,7 +96,7 @@ public function myUpdate_ConfirmPassword($id, $hash) : ResponseInterface
#[PostMapping('/user/myUpdate/avatar')]
public function update_avatar(AvatarRequest $request, AvatarUpload $upload)
{
- $data = $upload->save($request->file('avatar'), auth()->id(), \Hyperf\Utils\Str::random(), 200);
+ $data = $upload->save($request->file('avatar'), auth()->id(), \Hyperf\Stringable\Str::random(), 200);
$path = $data['path'];
User::query()->where('id', auth()->id())->update(['avatar' => $path]);
// 头像上传成功
diff --git a/app/Plugins/Core/src/Jobs/CreateInvitationCodeJob.php b/app/Plugins/Core/src/Jobs/CreateInvitationCodeJob.php
index 74d81a8d8..e991e1bec 100644
--- a/app/Plugins/Core/src/Jobs/CreateInvitationCodeJob.php
+++ b/app/Plugins/Core/src/Jobs/CreateInvitationCodeJob.php
@@ -4,7 +4,7 @@
use App\Plugins\Core\src\Models\InvitationCode;
use Hyperf\AsyncQueue\Annotation\AsyncQueueMessage;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
class CreateInvitationCodeJob
{
#[AsyncQueueMessage]
diff --git a/app/Plugins/Core/src/Lib/Pay/PayService.php b/app/Plugins/Core/src/Lib/Pay/PayService.php
index 779d1b29d..62eb17ea3 100644
--- a/app/Plugins/Core/src/Lib/Pay/PayService.php
+++ b/app/Plugins/Core/src/Lib/Pay/PayService.php
@@ -19,7 +19,7 @@
use App\Plugins\User\src\Models\User;
use Hyperf\Di\Annotation\Inject;
use Hyperf\Utils\Arr;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Psr\Http\Message\ResponseInterface;
use Psr\SimpleCache\InvalidArgumentException;
class PayService
@@ -362,7 +362,7 @@ public function paying($order_id, $payment = null) : mixed
}
private function core_Itf_id($name, $id)
{
- return \Hyperf\Utils\Str::after($id, $name . '_');
+ return \Hyperf\Stringable\Str::after($id, $name . '_');
}
private function core_default($string = null, $default = null)
{
diff --git a/app/Plugins/Core/src/Lib/Pay/Service/SFPay.php b/app/Plugins/Core/src/Lib/Pay/Service/SFPay.php
index cb80df7c6..2c2b539b2 100644
--- a/app/Plugins/Core/src/Lib/Pay/Service/SFPay.php
+++ b/app/Plugins/Core/src/Lib/Pay/Service/SFPay.php
@@ -13,7 +13,7 @@
use App\Plugins\Core\src\Controller\Pay\PayInterFace;
use App\Plugins\Core\src\Models\PayOrder;
use App\Plugins\User\src\Models\User;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Psr\SimpleCache\InvalidArgumentException;
use Yansongda\Pay\Exception\ContainerException;
use Yansongda\Pay\Exception\InvalidParamsException;
diff --git a/app/Plugins/Core/src/Lib/ShortCode.php b/app/Plugins/Core/src/Lib/ShortCode.php
index 9f2ac205f..282294cb7 100644
--- a/app/Plugins/Core/src/Lib/ShortCode.php
+++ b/app/Plugins/Core/src/Lib/ShortCode.php
@@ -15,7 +15,7 @@
use App\Plugins\Core\src\Models\InvitationCode;
use App\Plugins\Topic\src\Models\TopicTag;
use App\Plugins\User\src\Models\User;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
class ShortCode
{
diff --git a/app/Plugins/Core/src/Lib/ShortCodeR/Defaults.php b/app/Plugins/Core/src/Lib/ShortCodeR/Defaults.php
index 7d0ea8d88..b89a90025 100644
--- a/app/Plugins/Core/src/Lib/ShortCodeR/Defaults.php
+++ b/app/Plugins/Core/src/Lib/ShortCodeR/Defaults.php
@@ -4,7 +4,7 @@
use App\Plugins\Comment\src\Model\TopicComment;
use App\Plugins\Topic\src\Models\Topic;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
class Defaults
{
diff --git a/app/Plugins/Core/src/Lib/ShortCodeR/ShortCodeR.php b/app/Plugins/Core/src/Lib/ShortCodeR/ShortCodeR.php
index 6e00dbbf1..4127052d7 100644
--- a/app/Plugins/Core/src/Lib/ShortCodeR/ShortCodeR.php
+++ b/app/Plugins/Core/src/Lib/ShortCodeR/ShortCodeR.php
@@ -7,7 +7,7 @@
use Hyperf\Di\Annotation\AnnotationCollector;
use Hyperf\Utils\Arr;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use JetBrains\PhpStorm\Pure;
use Thunder\Shortcode\HandlerContainer\HandlerContainer;
use Thunder\Shortcode\Parser\RegularParser;
diff --git a/app/Plugins/Core/src/Lib/TextParsing.php b/app/Plugins/Core/src/Lib/TextParsing.php
index 5e686a9a1..943906807 100644
--- a/app/Plugins/Core/src/Lib/TextParsing.php
+++ b/app/Plugins/Core/src/Lib/TextParsing.php
@@ -11,7 +11,7 @@
namespace App\Plugins\Core\src\Lib;
use App\Plugins\User\src\Models\User;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
class TextParsing
{
public function keywords($keywords) : string
diff --git a/app/Plugins/Core/src/ShortCode/Single.php b/app/Plugins/Core/src/ShortCode/Single.php
index 6a4386e6c..af3858b0c 100644
--- a/app/Plugins/Core/src/ShortCode/Single.php
+++ b/app/Plugins/Core/src/ShortCode/Single.php
@@ -17,7 +17,7 @@ class Single
#[ShortCodeR(name: 'friend_links')]
public function friend_links()
{
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
return $container->get(RenderInterface::class)->render('App::widget.shortCode.friend_links');
}
}
\ No newline at end of file
diff --git a/app/Plugins/Core/src/migrations/2023_02_20_232723_optimize_index_all_table.php b/app/Plugins/Core/src/migrations/2023_02_20_232723_optimize_index_all_table.php
index c838e017b..11cfacb4d 100644
--- a/app/Plugins/Core/src/migrations/2023_02_20_232723_optimize_index_all_table.php
+++ b/app/Plugins/Core/src/migrations/2023_02_20_232723_optimize_index_all_table.php
@@ -12,7 +12,7 @@
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Schema\Schema;
use Hyperf\DB\DB;
-use Hyperf\Utils\ApplicationContext;
+use Hyperf\Context\ApplicationContext;
class OptimizeIndexAllTable extends Migration
{
diff --git a/app/Plugins/Topic/resources/views/KeyWords/data/index.blade.php b/app/Plugins/Topic/resources/views/KeyWords/data/index.blade.php
index 4c2202d6f..297b615a1 100644
--- a/app/Plugins/Topic/resources/views/KeyWords/data/index.blade.php
+++ b/app/Plugins/Topic/resources/views/KeyWords/data/index.blade.php
@@ -36,7 +36,7 @@
@endif
@foreach($topic_menu as $data)
- @if(\Hyperf\Utils\Str::contains(core_http_url(),$data['parameter']))
+ @if(\Hyperf\Stringable\Str::contains(core_http_url(),$data['parameter']))
{!!$data['icon']!!}{{$data['name']}}
diff --git a/app/Plugins/Topic/resources/views/ShortCode/tag.blade.php b/app/Plugins/Topic/resources/views/ShortCode/tag.blade.php
index 9a9a6eb4f..d7cde85cd 100644
--- a/app/Plugins/Topic/resources/views/ShortCode/tag.blade.php
+++ b/app/Plugins/Topic/resources/views/ShortCode/tag.blade.php
@@ -9,7 +9,7 @@
{{$value->name}}
-
{{ \Hyperf\Utils\Str::limit(core_default($value->description, __("app.no description")), 32) }}
+
{{ \Hyperf\Stringable\Str::limit(core_default($value->description, __("app.no description")), 32) }}
diff --git a/app/Plugins/Topic/resources/views/Tag/index.blade.php b/app/Plugins/Topic/resources/views/Tag/index.blade.php
index 0aac1f0f6..423031b87 100644
--- a/app/Plugins/Topic/resources/views/Tag/index.blade.php
+++ b/app/Plugins/Topic/resources/views/Tag/index.blade.php
@@ -34,7 +34,7 @@
@if($value->description)
- {{ \Hyperf\Utils\Str::limit($value->description,100) }} |
+ {{ \Hyperf\Stringable\Str::limit($value->description,100) }} |
@else
{{__("app.no description")}} |
@endif
diff --git a/app/Plugins/Topic/resources/views/Tag/jobs.blade.php b/app/Plugins/Topic/resources/views/Tag/jobs.blade.php
index cef4d693d..d8ac11e9b 100644
--- a/app/Plugins/Topic/resources/views/Tag/jobs.blade.php
+++ b/app/Plugins/Topic/resources/views/Tag/jobs.blade.php
@@ -30,7 +30,7 @@
@if($value->description)
- {{ \Hyperf\Utils\Str::limit($value->description,100) }} |
+ {{ \Hyperf\Stringable\Str::limit($value->description,100) }} |
@else
{{__("app.no description")}} |
@endif
diff --git a/app/Plugins/Topic/resources/views/Tags/data/index.blade.php b/app/Plugins/Topic/resources/views/Tags/data/index.blade.php
index e5764efb5..7f0752dd5 100644
--- a/app/Plugins/Topic/resources/views/Tags/data/index.blade.php
+++ b/app/Plugins/Topic/resources/views/Tags/data/index.blade.php
@@ -36,7 +36,7 @@
@endif
@foreach($topic_menu as $data)
- @if(\Hyperf\Utils\Str::contains(core_http_url(),$data['parameter']))
+ @if(\Hyperf\Stringable\Str::contains(core_http_url(),$data['parameter']))
{!!$data['icon']!!}{{$data['name']}}
diff --git a/app/Plugins/Topic/resources/views/Tags/index.blade.php b/app/Plugins/Topic/resources/views/Tags/index.blade.php
index e00cd74ff..fcb8b30f9 100644
--- a/app/Plugins/Topic/resources/views/Tags/index.blade.php
+++ b/app/Plugins/Topic/resources/views/Tags/index.blade.php
@@ -46,7 +46,7 @@
{{$value->name}}
-
{{ \Hyperf\Utils\Str::limit(core_default($value->description, __("app.no description")), 32) }}
+
{{ \Hyperf\Stringable\Str::limit(core_default($value->description, __("app.no description")), 32) }}
diff --git a/app/Plugins/Topic/src/Controllers/ApiController.php b/app/Plugins/Topic/src/Controllers/ApiController.php
index d7a3f81c7..16643403e 100644
--- a/app/Plugins/Topic/src/Controllers/ApiController.php
+++ b/app/Plugins/Topic/src/Controllers/ApiController.php
@@ -63,7 +63,7 @@ public function get_with_topic_data()
}
$data = Topic::query()->where('id', $topic_id)->select('id', 'title', 'user_id', 'options', 'created_at')->with('user')->first();
$user_avatar = super_avatar($data->user);
- $title = \Hyperf\Utils\Str::limit($data->title, 20);
+ $title = \Hyperf\Stringable\Str::limit($data->title, 20);
$username = $data->user->username;
$summary = '作者:' . $username;
return Json_Api(200, true, ['avatar' => $user_avatar, 'title' => $title, 'summary' => $summary, 'username' => $username]);
@@ -329,10 +329,10 @@ public function get_topic_include_ifpage()
}
$shang = Topic::query()->where([['id', '<', $topic_id]])->select('title', 'id')->orderBy('id', 'desc')->first();
$shang['url'] = '/' . @$shang['id'] . '.html';
- $shang['title'] = \Hyperf\Utils\Str::limit(@$shang['title'] ?: ' ', 20, '...');
+ $shang['title'] = \Hyperf\Stringable\Str::limit(@$shang['title'] ?: ' ', 20, '...');
$xia = Topic::query()->where([['id', '>', $topic_id]])->select('title', 'id')->orderBy('id', 'asc')->first();
$xia['url'] = '/' . @$xia['id'] . '.html';
- $xia['title'] = \Hyperf\Utils\Str::limit(@$xia['title'] ?: ' ', 20, '...');
+ $xia['title'] = \Hyperf\Stringable\Str::limit(@$xia['title'] ?: ' ', 20, '...');
return json_api(200, true, ['msg' => '获取成功', 'result' => ['shang' => $shang, 'xia' => $xia]]);
}
}
\ No newline at end of file
diff --git a/app/Plugins/User/helpers.php b/app/Plugins/User/helpers.php
index ccc28f7ce..d0bee62c4 100755
--- a/app/Plugins/User/helpers.php
+++ b/app/Plugins/User/helpers.php
@@ -9,7 +9,7 @@
* @license https://github.com/zhuchunshu/SForum/blob/master/LICENSE
*/
use App\Plugins\User\src\Models\UsersSetting;
-use Hyperf\Utils\ApplicationContext;
+use Hyperf\Context\ApplicationContext;
use Qbhy\HyperfAuth\AuthManager;
if (! function_exists('auth')) {
@@ -73,7 +73,7 @@ function user_TopicTagQuanxianCheck($topic_tag, $userClassId): bool
function file_suffix(string $path): string
{
$path = substr($path, strrpos($path, '/') + 1);
- return \Hyperf\Utils\Str::after($path, '.');
+ return \Hyperf\Stringable\Str::after($path, '.');
}
}
diff --git a/app/Plugins/User/resources/views/Admin/Files/upload.blade.php b/app/Plugins/User/resources/views/Admin/Files/upload.blade.php
index 3eb80c04a..2ba2c7a8d 100644
--- a/app/Plugins/User/resources/views/Admin/Files/upload.blade.php
+++ b/app/Plugins/User/resources/views/Admin/Files/upload.blade.php
@@ -26,7 +26,7 @@
文件上传成功!
- @if(\Hyperf\Utils\Str::is('http*//*',request()->input("url")))
+ @if(\Hyperf\Stringable\Str::is('http*//*',request()->input("url")))
@else
diff --git a/app/Plugins/User/resources/views/Collections.blade.php b/app/Plugins/User/resources/views/Collections.blade.php
index b5efcb168..8f1643eae 100644
--- a/app/Plugins/User/resources/views/Collections.blade.php
+++ b/app/Plugins/User/resources/views/Collections.blade.php
@@ -124,7 +124,7 @@ class="col-md-12 markdown">
{{get_topic_comment($value->type_id)->parent->user->username}} {{__("app.Published on")}} {{format_date(get_topic_comment($value->type_id)->created_at)}}
- {!! \Hyperf\Utils\Str::limit(remove_bbCode(strip_tags(get_topic_comment($value->type_id)->parent->post->content)),60) !!}
+ {!! \Hyperf\Stringable\Str::limit(remove_bbCode(strip_tags(get_topic_comment($value->type_id)->parent->post->content)),60) !!}
@endif
diff --git a/app/Plugins/User/resources/views/assets/exchange/goldsTo_credit.blade.php b/app/Plugins/User/resources/views/assets/exchange/goldsTo_credit.blade.php
index 35999041b..b9d54f6ec 100644
--- a/app/Plugins/User/resources/views/assets/exchange/goldsTo_credit.blade.php
+++ b/app/Plugins/User/resources/views/assets/exchange/goldsTo_credit.blade.php
@@ -4,8 +4,8 @@
@php($user = \App\Plugins\User\src\Models\User::query()->with('Options')->find(auth()->id()))
@if(count(explode('.',$user->Options->golds))>1)
- @php( $dc = \Hyperf\Utils\Str::after((string)$user->Options->golds,'.'))
- @php($dc = (int)\Hyperf\Utils\Str::length($dc))
+ @php( $dc = \Hyperf\Stringable\Str::after((string)$user->Options->golds,'.'))
+ @php($dc = (int)\Hyperf\Stringable\Str::length($dc))
@else
@php($dc = 0)
@endif
diff --git a/app/Plugins/User/resources/views/assets/exchange/moneyTo_credit.blade.php b/app/Plugins/User/resources/views/assets/exchange/moneyTo_credit.blade.php
index 75f20b8fa..1a89f32cc 100644
--- a/app/Plugins/User/resources/views/assets/exchange/moneyTo_credit.blade.php
+++ b/app/Plugins/User/resources/views/assets/exchange/moneyTo_credit.blade.php
@@ -4,8 +4,8 @@
@php($user = \App\Plugins\User\src\Models\User::query()->with('Options')->find(auth()->id()))
@if(count(explode('.',$user->Options->money))>1)
- @php( $dc = \Hyperf\Utils\Str::after((string)$user->Options->money,'.'))
- @php($dc = (int)\Hyperf\Utils\Str::length($dc))
+ @php( $dc = \Hyperf\Stringable\Str::after((string)$user->Options->money,'.'))
+ @php($dc = (int)\Hyperf\Stringable\Str::length($dc))
@else
@php($dc = 0)
@endif
diff --git a/app/Plugins/User/resources/views/assets/exchange/moneyTo_golds.blade.php b/app/Plugins/User/resources/views/assets/exchange/moneyTo_golds.blade.php
index c74d84ea5..7dd89170d 100644
--- a/app/Plugins/User/resources/views/assets/exchange/moneyTo_golds.blade.php
+++ b/app/Plugins/User/resources/views/assets/exchange/moneyTo_golds.blade.php
@@ -3,8 +3,8 @@
@php($user = \App\Plugins\User\src\Models\User::query()->with('Options')->find(auth()->id()))
@if(count(explode('.',$user->Options->money))>1)
- @php( $dc = \Hyperf\Utils\Str::after((string)$user->Options->money,'.'))
- @php($dc = (int)\Hyperf\Utils\Str::length($dc))
+ @php( $dc = \Hyperf\Stringable\Str::after((string)$user->Options->money,'.'))
+ @php($dc = (int)\Hyperf\Stringable\Str::length($dc))
@else
@php($dc = 0)
@endif
diff --git a/app/Plugins/User/resources/views/data.blade.php b/app/Plugins/User/resources/views/data.blade.php
index 1c6dcd0a4..06f67a199 100644
--- a/app/Plugins/User/resources/views/data.blade.php
+++ b/app/Plugins/User/resources/views/data.blade.php
@@ -257,7 +257,7 @@ class="injected-svg DownloadModal__ImageFile-sc-p17csy-5 iIfSkb grid_media"
{{$moderator->tag->name}}
-
{{ \Hyperf\Utils\Str::limit(core_default($moderator->tag->description, __("app.no description")), 32) }}
+
{{ \Hyperf\Stringable\Str::limit(core_default($moderator->tag->description, __("app.no description")), 32) }}
diff --git a/app/Plugins/User/resources/views/home/collections.blade.php b/app/Plugins/User/resources/views/home/collections.blade.php
index 6cefc60ca..1a3a22264 100644
--- a/app/Plugins/User/resources/views/home/collections.blade.php
+++ b/app/Plugins/User/resources/views/home/collections.blade.php
@@ -95,7 +95,7 @@ class="col-md-12 markdown">
{{get_topic_comment($value->type_id)->parent->user->username}} {{__("app.Published on")}} {{format_date(get_topic_comment($value->type_id)->created_at)}}
- {!! \Hyperf\Utils\Str::limit(remove_bbCode(strip_tags(get_topic_comment($value->type_id)->parent->post->content)),60) !!}
+ {!! \Hyperf\Stringable\Str::limit(remove_bbCode(strip_tags(get_topic_comment($value->type_id)->parent->post->content)),60) !!}
@endif
diff --git a/app/Plugins/User/resources/views/home/comment.blade.php b/app/Plugins/User/resources/views/home/comment.blade.php
index 32d25d847..5a54f6ce0 100644
--- a/app/Plugins/User/resources/views/home/comment.blade.php
+++ b/app/Plugins/User/resources/views/home/comment.blade.php
@@ -48,7 +48,7 @@
{{$value->parent->user->username}} {{__("app.Published on")}} {{format_date($value->created_at)}}
- {!! \Hyperf\Utils\Str::limit(remove_bbCode(strip_tags($value->parent->post->content)),60) !!}
+ {!! \Hyperf\Stringable\Str::limit(remove_bbCode(strip_tags($value->parent->post->content)),60) !!}
@endif
diff --git a/app/Plugins/User/resources/views/home/order.blade.php b/app/Plugins/User/resources/views/home/order.blade.php
index e159be595..03656ffb6 100644
--- a/app/Plugins/User/resources/views/home/order.blade.php
+++ b/app/Plugins/User/resources/views/home/order.blade.php
@@ -67,7 +67,7 @@ class="form-control" placeholder="输入订单号或交易号">
{{$order->status}}
|
- @if($order->trade_no) {{\Hyperf\Utils\Str::limit($order->trade_no,8)}} @else
+ | @if($order->trade_no) {{\Hyperf\Stringable\Str::limit($order->trade_no,8)}} @else
{{$order->status}} @endif
|
@if($order->amount_total){{$order->amount_total}} {{get_options('wealth_money_unit_name','元')}} @else with('Options')->find(auth()->id());
// 最多能兑换的金币数量
- $dc = \Hyperf\Utils\Str::after($user->Options->money, '.');
- $dc = \Hyperf\Utils\Str::length($dc);
+ $dc = \Hyperf\Stringable\Str::after($user->Options->money, '.');
+ $dc = \Hyperf\Stringable\Str::length($dc);
$max = intval($user->Options->money * get_options('wealth_how_many_money_to_golds', '1'));
if ($moneyTo_golds_num > $max) {
return Json_Api(403, false, ['msg' => '超出最大兑换限制']);
@@ -90,8 +90,8 @@ public function goldsTo_credit() : array
$proportion = get_options('wealth_how_many_golds_to_credit', 10);
// 最多能兑换的金币数量
$max = intval($user->Options->golds * $proportion);
- $dc = \Hyperf\Utils\Str::after($user->Options->golds, '.');
- $dc = \Hyperf\Utils\Str::length($dc);
+ $dc = \Hyperf\Stringable\Str::after($user->Options->golds, '.');
+ $dc = \Hyperf\Stringable\Str::length($dc);
if ($goldsTo_credit_num > $max) {
return Json_Api(403, false, ['msg' => '超出最大兑换限制']);
}
@@ -134,8 +134,8 @@ public function moneyTo_credit() : array
$proportion = get_options('wealth_how_many_money_to_credit', get_options('wealth_how_many_money_to_golds', '1') * get_options('wealth_how_many_golds_to_credit', 10));
// 最多能兑换的金币数量
$max = intval($user->Options->money * $proportion);
- $dc = \Hyperf\Utils\Str::after($user->Options->money, '.');
- $dc = \Hyperf\Utils\Str::length($dc);
+ $dc = \Hyperf\Stringable\Str::after($user->Options->money, '.');
+ $dc = \Hyperf\Stringable\Str::length($dc);
if ($moneyTo_credit_num > $max) {
return Json_Api(403, false, ['msg' => '超出最大兑换限制']);
}
diff --git a/app/Plugins/User/src/Lib/UserNotice.php b/app/Plugins/User/src/Lib/UserNotice.php
index aba923ab3..99074892c 100644
--- a/app/Plugins/User/src/Lib/UserNotice.php
+++ b/app/Plugins/User/src/Lib/UserNotice.php
@@ -13,7 +13,7 @@
use App\Plugins\User\src\Event\SendMail;
use App\Plugins\User\src\Models\User;
use App\Plugins\User\src\Models\UsersNotice;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Psr\Http\Message\ResponseInterface;
class UserNotice
{
diff --git a/app/Plugins/User/src/Middleware/AuthMiddleware.php b/app/Plugins/User/src/Middleware/AuthMiddleware.php
index 4ed3692ff..4c85dde8a 100755
--- a/app/Plugins/User/src/Middleware/AuthMiddleware.php
+++ b/app/Plugins/User/src/Middleware/AuthMiddleware.php
@@ -10,7 +10,7 @@
*/
namespace App\Plugins\User\src\Middleware;
-use Hyperf\Utils\Str;
+use Hyperf\Stringable\Str;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
diff --git a/app/Server/CodeFecServer.php b/app/Server/CodeFecServer.php
index 508a96c36..17aa1cd27 100755
--- a/app/Server/CodeFecServer.php
+++ b/app/Server/CodeFecServer.php
@@ -10,7 +10,6 @@
*/
namespace App\Server;
-use App\CodeFec\CodeFec;
use FastRoute\Dispatcher;
use Hyperf\Contract\ConfigInterface;
use Hyperf\Contract\MiddlewareInitializerInterface;
diff --git a/app/Themes/CodeFec/resources/views/admin/FriendLinks/index.blade.php b/app/Themes/CodeFec/resources/views/admin/FriendLinks/index.blade.php
index a9b2ca20b..bb8a2f231 100644
--- a/app/Themes/CodeFec/resources/views/admin/FriendLinks/index.blade.php
+++ b/app/Themes/CodeFec/resources/views/admin/FriendLinks/index.blade.php
@@ -22,7 +22,7 @@
{{$data->name}}
- {{\Hyperf\Utils\Str::limit($data->link,80)}}
+ {{\Hyperf\Stringable\Str::limit($data->link,80)}}
diff --git a/app/Themes/CodeFec/resources/views/index/index.blade.php b/app/Themes/CodeFec/resources/views/index/index.blade.php
index c07a8b65c..22633e996 100644
--- a/app/Themes/CodeFec/resources/views/index/index.blade.php
+++ b/app/Themes/CodeFec/resources/views/index/index.blade.php
@@ -28,7 +28,7 @@
@endif
@foreach($topic_menu as $data)
- @if(\Hyperf\Utils\Str::contains(core_http_url(),$data['parameter']))
+ @if(\Hyperf\Stringable\Str::contains(core_http_url(),$data['parameter']))
{!!$data['icon']!!}{{$data['name']}}
diff --git a/app/Themes/CodeFec/resources/views/widget/topic/right_start_1.blade.php b/app/Themes/CodeFec/resources/views/widget/topic/right_start_1.blade.php
index 27f2e6e06..648b02b93 100644
--- a/app/Themes/CodeFec/resources/views/widget/topic/right_start_1.blade.php
+++ b/app/Themes/CodeFec/resources/views/widget/topic/right_start_1.blade.php
@@ -24,7 +24,7 @@
{{$data->tag->name}}
- {{ \Hyperf\Utils\Str::limit(core_default($data->tag->description, __("app.no description")), 32) }}
+ {{ \Hyperf\Stringable\Str::limit(core_default($data->tag->description, __("app.no description")), 32) }}
diff --git a/app/Themes/CodeFec/resources/views/widget/topic/tags/right_start_1.blade.php b/app/Themes/CodeFec/resources/views/widget/topic/tags/right_start_1.blade.php
index 47f5f0787..b4fe97a50 100644
--- a/app/Themes/CodeFec/resources/views/widget/topic/tags/right_start_1.blade.php
+++ b/app/Themes/CodeFec/resources/views/widget/topic/tags/right_start_1.blade.php
@@ -8,7 +8,7 @@
{{$data->name}}
- {{ \Hyperf\Utils\Str::limit(core_default($data->description, __("app.no description")), 32) }}
+ {{ \Hyperf\Stringable\Str::limit(core_default($data->description, __("app.no description")), 32) }}
diff --git a/app/helpers.php b/app/helpers.php
index cadcbeecc..7a0739ffd 100755
--- a/app/helpers.php
+++ b/app/helpers.php
@@ -182,14 +182,14 @@ function path_class()
if (! function_exists('menu')) {
function menu()
{
- return \Hyperf\Utils\ApplicationContext::getContainer()->get(MenuInterface::class);
+ return \Hyperf\Context\ApplicationContext::getContainer()->get(MenuInterface::class);
}
}
if (! function_exists('view')) {
function view(string $view, array $data = [], int $code = 200)
{
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
return $container->get(RenderInterface::class)->render($view, $data, $code);
if (env('APP_ENV') === 'dev') {
return $result;
@@ -256,7 +256,7 @@ function json_api(int $code = 200, bool $success = true, object | array | string
if (! function_exists('session')) {
function session()
{
- return \Hyperf\Utils\ApplicationContext::getContainer()->get(SessionInterface::class);
+ return \Hyperf\Context\ApplicationContext::getContainer()->get(SessionInterface::class);
}
}
@@ -550,7 +550,7 @@ function csrf_token()
session()->set('CSRF_TOKEN', Str::random());
}
if (! cache()->has('CSRF_TOKEN' . session()->get('CSRF_TOKEN'))) {
- $k = \Hyperf\Utils\Str::random(25);
+ $k = \Hyperf\Stringable\Str::random(25);
cache()->set('CSRF_TOKEN' . session()->get('CSRF_TOKEN'), $k);
}
return cache()->get('CSRF_TOKEN' . session()->get('CSRF_TOKEN'));
@@ -563,7 +563,7 @@ function recsrf_token()
if (! session()->has('CSRF_TOKEN')) {
session()->set('CSRF_TOKEN', Str::random());
}
- $k = \Hyperf\Utils\Str::random(25);
+ $k = \Hyperf\Stringable\Str::random(25);
cache()->set('CSRF_TOKEN' . session()->get('CSRF_TOKEN'), $k);
return cache()->get('CSRF_TOKEN' . session()->get('CSRF_TOKEN'));
}
@@ -595,21 +595,21 @@ function modifyEnv(array $data)
if (! function_exists('Itf_Setting')) {
function Itf_Setting()
{
- return \Hyperf\Utils\ApplicationContext::getContainer()->get(SettingInterface::class);
+ return \Hyperf\Context\ApplicationContext::getContainer()->get(SettingInterface::class);
}
}
if (! function_exists('Router')) {
function Router()
{
- return \Hyperf\Utils\ApplicationContext::getContainer()->get(\App\CodeFec\Itf\Route\RouteInterface::class);
+ return \Hyperf\Context\ApplicationContext::getContainer()->get(\App\CodeFec\Itf\Route\RouteInterface::class);
}
}
if (! function_exists('Themes')) {
function Themes()
{
- return \Hyperf\Utils\ApplicationContext::getContainer()->get(\App\CodeFec\Itf\Theme\ThemeInterface::class);
+ return \Hyperf\Context\ApplicationContext::getContainer()->get(\App\CodeFec\Itf\Theme\ThemeInterface::class);
}
}
@@ -630,7 +630,7 @@ function Helpers_Str(): Str
if (! function_exists('Itf')) {
function Itf()
{
- return \Hyperf\Utils\ApplicationContext::getContainer()->get(\App\CodeFec\Itf\Itf\ItfInterface::class);
+ return \Hyperf\Context\ApplicationContext::getContainer()->get(\App\CodeFec\Itf\Itf\ItfInterface::class);
}
}
@@ -864,7 +864,7 @@ function content_brief($content, string | int $len = 100): string
$content = strip_tags($content);
$content = htmlspecialchars($content);
$content = remove_bbCode($content) ?: '';
- $content = \Hyperf\Utils\Str::limit($content, $len);
+ $content = \Hyperf\Stringable\Str::limit($content, $len);
return htmlspecialchars_decode($content, ENT_QUOTES);
}
}
@@ -986,7 +986,7 @@ function _menu_instance(): App\Plugins\Core\Menu
function get_component_view_name($name): string
{
$view = 'customize.component.' . $name;
- $container = \Hyperf\Utils\ApplicationContext::getContainer();
+ $container = \Hyperf\Context\ApplicationContext::getContainer();
$factory = $container->get(FactoryInterface::class);
if (! $factory->exists($view)) {
return 'shared.viewIsNull';
@@ -1030,7 +1030,7 @@ function get_content_brief($content, $len = 200): string
$content = strip_tags($content);
$content = htmlspecialchars($content);
$content = remove_bbCode($content) ?: '';
- $content = \Hyperf\Utils\Str::limit($content, $len);
+ $content = \Hyperf\Stringable\Str::limit($content, $len);
$content = trim(preg_replace('/\s+/', ' ', $content));
return htmlspecialchars_decode($content, ENT_QUOTES);
}
diff --git a/config/autoload/server.php b/config/autoload/server.php
index 5c5251fdd..8995f9f48 100644
--- a/config/autoload/server.php
+++ b/config/autoload/server.php
@@ -8,7 +8,6 @@
* @contact laravel@88.com
* @license https://github.com/zhuchunshu/SForum/blob/master/LICENSE
*/
-use App\Server\CodeFecServer;
use Hyperf\Server\Event;
use Hyperf\Server\ServerInterface;
use Swoole\Constant;
@@ -23,24 +22,9 @@
'port' => (int) env('SERVER_WEB_PORT', 9501),
'sock_type' => SWOOLE_SOCK_TCP,
'callbacks' => [
- Event::ON_REQUEST => [CodeFecServer::class, 'onRequest'],
+ Event::ON_REQUEST => [\Hyperf\HttpServer\Server::class, 'onRequest'],
],
],
- // [
- // 'name' => 'socket-io',
- // 'type' => ServerInterface::SERVER_WEBSOCKET,
- // 'host' => (string) env('SERVER_WEB_DOMAIN', '0.0.0.0'),
- // 'port' => (int) env('SERVER_WS_PORT', 9502),
- // 'sock_type' => SWOOLE_SOCK_TCP,
- // 'callbacks' => [
- // Event::ON_HAND_SHAKE => [Hyperf\WebSocketServer\Server::class, 'onHandShake'],
- // Event::ON_MESSAGE => [Hyperf\WebSocketServer\Server::class, 'onMessage'],
- // Event::ON_CLOSE => [Hyperf\WebSocketServer\Server::class, 'onClose'],
- // ],
- // 'settings' => [
- // 'open_websocket_protocol' => false,
- // ],
- // ],
],
'settings' => [
Constant::OPTION_ENABLE_COROUTINE => true,
@@ -49,7 +33,7 @@
Constant::OPTION_OPEN_TCP_NODELAY => true,
Constant::OPTION_MAX_COROUTINE => 100000,
Constant::OPTION_OPEN_HTTP2_PROTOCOL => true,
- Constant::OPTION_MAX_REQUEST => 100000,
+ Constant::OPTION_MAX_REQUEST => 0,
Constant::OPTION_SOCKET_BUFFER_SIZE => 2 * 1024 * 1024,
Constant::OPTION_BUFFER_OUTPUT_SIZE => 2 * 1024 * 1024,
Constant::OPTION_PACKAGE_MAX_LENGTH => 100 * 1024 * 1024,
diff --git a/config/autoload/view.php b/config/autoload/view.php
index cc979773d..316356d63 100644
--- a/config/autoload/view.php
+++ b/config/autoload/view.php
@@ -2,11 +2,11 @@
declare(strict_types=1);
/**
- * This file is part of Hyperf.
- * @link https://www.hyperf.io
- * @document https://hyperf.wiki
- * @contact group@hyperf.io
- * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
+ * This file is part of zhuchunshu.
+ * @link https://github.com/zhuchunshu
+ * @document https://github.com/zhuchunshu/SForum
+ * @contact laravel@88.com
+ * @license https://github.com/zhuchunshu/SForum/blob/master/LICENSE
*/
use App\View\Component\CsrfToken;
diff --git a/config/container.php b/config/container.php
index 406d7ab09..a9777ef44 100755
--- a/config/container.php
+++ b/config/container.php
@@ -14,7 +14,7 @@
*/
use Hyperf\Di\Container;
use Hyperf\Di\Definition\DefinitionSourceFactory;
-use Hyperf\Utils\ApplicationContext;
+use Hyperf\Context\ApplicationContext;
$container = new Container((new DefinitionSourceFactory(true))());
diff --git a/docker-compose-test.yml b/docker-compose-test.yml
index e1154e667..41f3e5a78 100644
--- a/docker-compose-test.yml
+++ b/docker-compose-test.yml
@@ -1,23 +1,57 @@
-version: '3.1'
-
-networks:
- mysql_networks:
- external: true
-
+version: '3'
services:
web:
- #zhuchunshu/sforum:v2 or ghcr.io/zhuchunshu/sforum:v2
- build: .
+ image: zhuchunshu/sforum:dev
ports:
- "9501:9501"
+
environment:
- DB_HOST=db
- REDIS_HOST=redis
- DB_DATABASE=sforum
- DB_USERNAME=sforum
- - DB_PASSWORD=123456
+ - DB_PASSWORD=sforum
+
+ depends_on:
+ - db
+ - redis
+ networks:
+ - sf
+ volumes:
+ - sforum:/data
+ restart: always
+ redis:
+ image: redis:7.0
+ restart: always
networks:
- - mysql_networks
+ - sf
volumes:
- - ./:/data/www
\ No newline at end of file
+ - redis:/data
+ - redis:/usr/local/etc/redis/redis.conf
+ - redis:/logs
+
+ db:
+ image: mariadb:10.5.18
+ restart: always
+ environment:
+ MARIADB_ROOT_PASSWORD: sforum
+ MARIADB_DATABASE: sforum
+ MARIADB_USER: sforum
+ MARIADB_PASSWORD: sforum
+ networks:
+ - sf
+ volumes:
+ - db:/var/lib/mysql
+
+networks:
+ sf:
+ external: false
+
+volumes:
+ sforum:
+ driver: local
+ db:
+ driver: local
+ redis:
+ driver: local
diff --git a/docker-compose.yml b/docker-compose.yml
index 5f841ba1e..20e3cf34a 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -11,6 +11,7 @@ services:
- DB_DATABASE=sforum
- DB_USERNAME=sforum
- DB_PASSWORD=sforum
+ - SCAN_CACHEABLE=true
depends_on:
- db
diff --git a/migrations/2023_02_20_232723_optimize_index_all_table.php b/migrations/2023_02_20_232723_optimize_index_all_table.php
index c838e017b..11cfacb4d 100644
--- a/migrations/2023_02_20_232723_optimize_index_all_table.php
+++ b/migrations/2023_02_20_232723_optimize_index_all_table.php
@@ -12,7 +12,7 @@
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Schema\Schema;
use Hyperf\DB\DB;
-use Hyperf\Utils\ApplicationContext;
+use Hyperf\Context\ApplicationContext;
class OptimizeIndexAllTable extends Migration
{
diff --git a/resources/views/admin/setting/menu/index.blade.php b/resources/views/admin/setting/menu/index.blade.php
index 5a7f98dab..14c70787f 100644
--- a/resources/views/admin/setting/menu/index.blade.php
+++ b/resources/views/admin/setting/menu/index.blade.php
@@ -39,7 +39,7 @@ class="table table-vcenter table-nowrap">
{{$menu['id']}} |
{{__($menu['name'])}} |
- {{\Hyperf\Utils\Str::limit($menu['url'],50)}} |
+ {{\Hyperf\Stringable\Str::limit($menu['url'],50)}} |
{!! $menu['icon'] !!}
|
diff --git a/resources/views/layouts/header.blade.php b/resources/views/layouts/header.blade.php
index c3cb0503c..7c35e0d21 100755
--- a/resources/views/layouts/header.blade.php
+++ b/resources/views/layouts/header.blade.php
@@ -27,7 +27,7 @@
@foreach (menu()->get() as $key => $value)
@if (!arr_has($value, 'parent_id'))
@if (!menu_pd($key))
- @if (\Hyperf\Utils\Str::is("*".$value['url']."*",'/' . request()->path()) && $value['url']!=='/admin')
+ @if (\Hyperf\Stringable\Str::is("*".$value['url']."*",'/' . request()->path()) && $value['url']!=='/admin')
@else
|