mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-23 16:45:35 +08:00
cs fix
This commit is contained in:
@@ -391,7 +391,7 @@ class CQ
|
|||||||
{
|
{
|
||||||
$cqs = [];
|
$cqs = [];
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
while (($head = mb_strpos(($submsg = mb_substr($msg, $offset)), '[CQ:')) !== false) {
|
while (($head = mb_strpos($submsg = mb_substr($msg, $offset), '[CQ:')) !== false) {
|
||||||
$key_offset = mb_substr($submsg, $head);
|
$key_offset = mb_substr($submsg, $head);
|
||||||
$tmpmsg = mb_strpos($key_offset, ']');
|
$tmpmsg = mb_strpos($key_offset, ']');
|
||||||
if ($tmpmsg === false) {
|
if ($tmpmsg === false) {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ use ZM\Event\EventManager;
|
|||||||
use ZM\Exception\AnnotationException;
|
use ZM\Exception\AnnotationException;
|
||||||
use ZM\Utils\Manager\RouteManager;
|
use ZM\Utils\Manager\RouteManager;
|
||||||
use ZM\Utils\ZMUtil;
|
use ZM\Utils\ZMUtil;
|
||||||
|
|
||||||
use function server;
|
use function server;
|
||||||
|
|
||||||
class AnnotationParser
|
class AnnotationParser
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class BuildCommand extends Command
|
|||||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
$this->output = $output;
|
$this->output = $output;
|
||||||
$target_dir = $input->getOption('target') ?? (WORKING_DIR);
|
$target_dir = $input->getOption('target') ?? WORKING_DIR;
|
||||||
if (mb_strpos($target_dir, '../')) {
|
if (mb_strpos($target_dir, '../')) {
|
||||||
$target_dir = realpath($target_dir);
|
$target_dir = realpath($target_dir);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class InitCommand extends Command
|
|||||||
$info = pathinfo($file);
|
$info = pathinfo($file);
|
||||||
@mkdir($base_path . $info['dirname'], 0777, true);
|
@mkdir($base_path . $info['dirname'], 0777, true);
|
||||||
echo 'Copying ' . $file . PHP_EOL;
|
echo 'Copying ' . $file . PHP_EOL;
|
||||||
$package_name = (json_decode(file_get_contents(__DIR__ . '/../../../composer.json'), true)['name']);
|
$package_name = json_decode(file_get_contents(__DIR__ . '/../../../composer.json'), true)['name'];
|
||||||
copy($base_path . '/vendor/' . $package_name . $file, $base_path . $file);
|
copy($base_path . '/vendor/' . $package_name . $file, $base_path . $file);
|
||||||
} else {
|
} else {
|
||||||
echo 'Skipping ' . $file . ' , file exists.' . PHP_EOL;
|
echo 'Skipping ' . $file . ' , file exists.' . PHP_EOL;
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ trait ContainerTrait
|
|||||||
$this->log(sprintf(
|
$this->log(sprintf(
|
||||||
'[%s] resolved (shared)%s',
|
'[%s] resolved (shared)%s',
|
||||||
$abstract,
|
$abstract,
|
||||||
($needs_contextual_build ? ' with ' . implode(', ', $parameters) : '')
|
$needs_contextual_build ? ' with ' . implode(', ', $parameters) : ''
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
return $this->shared[$abstract];
|
return $this->shared[$abstract];
|
||||||
@@ -307,7 +307,7 @@ trait ContainerTrait
|
|||||||
$this->log(sprintf(
|
$this->log(sprintf(
|
||||||
'[%s] resolved%s',
|
'[%s] resolved%s',
|
||||||
$abstract,
|
$abstract,
|
||||||
($needs_contextual_build ? ' with ' . implode(', ', $parameters) : '')
|
$needs_contextual_build ? ' with ' . implode(', ', $parameters) : ''
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,7 +383,7 @@ trait ContainerTrait
|
|||||||
$this->log(sprintf(
|
$this->log(sprintf(
|
||||||
'Called %s%s(%s)',
|
'Called %s%s(%s)',
|
||||||
ReflectionUtil::variableToString($callback),
|
ReflectionUtil::variableToString($callback),
|
||||||
($default_method ? '@' . $default_method : ''),
|
$default_method ? '@' . $default_method : '',
|
||||||
$str_parameters
|
$str_parameters
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class EventManager
|
|||||||
if ($event_obj->method instanceof Closure) {
|
if ($event_obj->method instanceof Closure) {
|
||||||
Console::debug("Adding event {$event_name} at @Anonymous");
|
Console::debug("Adding event {$event_name} at @Anonymous");
|
||||||
} else {
|
} else {
|
||||||
Console::debug("Adding event {$event_name} at " . ($event_obj->class) . ':' . ($event_obj->method));
|
Console::debug("Adding event {$event_name} at " . $event_obj->class . ':' . $event_obj->method);
|
||||||
self::$event_map[$event_obj->class][$event_obj->method][] = $event_obj;
|
self::$event_map[$event_obj->class][$event_obj->method][] = $event_obj;
|
||||||
}
|
}
|
||||||
self::$events[$event_name][] = $event_obj;
|
self::$events[$event_name][] = $event_obj;
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class OnManagerStart implements SwooleEvent
|
|||||||
}
|
}
|
||||||
if (Framework::$argv['polling-watch']) {
|
if (Framework::$argv['polling-watch']) {
|
||||||
self::$watch_tick_id = swoole_timer_tick(3000, function () use ($server) {
|
self::$watch_tick_id = swoole_timer_tick(3000, function () use ($server) {
|
||||||
$data = (DataProvider::scanDirFiles(DataProvider::getSourceRootDir() . '/src/'));
|
$data = DataProvider::scanDirFiles(DataProvider::getSourceRootDir() . '/src/');
|
||||||
$hash = md5('');
|
$hash = md5('');
|
||||||
foreach ($data as $file) {
|
foreach ($data as $file) {
|
||||||
$hash = md5($hash . md5_file($file));
|
$hash = md5($hash . md5_file($file));
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ class Framework
|
|||||||
|
|
||||||
// 预览模式则直接提出
|
// 预览模式则直接提出
|
||||||
if ($args['preview'] ?? false) {
|
if ($args['preview'] ?? false) {
|
||||||
exit();
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化服务器
|
// 初始化服务器
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ use ZM\Framework;
|
|||||||
use ZM\Store\Lock\SpinLock;
|
use ZM\Store\Lock\SpinLock;
|
||||||
use ZM\Store\ZMAtomic;
|
use ZM\Store\ZMAtomic;
|
||||||
use ZM\Store\ZMBuf;
|
use ZM\Store\ZMBuf;
|
||||||
|
|
||||||
use function file_get_contents;
|
use function file_get_contents;
|
||||||
use function get_included_files;
|
use function get_included_files;
|
||||||
use function is_callable;
|
use function is_callable;
|
||||||
@@ -124,7 +125,7 @@ class ZMUtil
|
|||||||
continue 2;
|
continue 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif (is_callable($rule) && !($rule($dir, $pathinfo))) {
|
} elseif (is_callable($rule) && !$rule($dir, $pathinfo)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$dirname = $pathinfo['dirname'] == '.' ? '' : (str_replace('/', '\\', $pathinfo['dirname']) . '\\');
|
$dirname = $pathinfo['dirname'] == '.' ? '' : (str_replace('/', '\\', $pathinfo['dirname']) . '\\');
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ function _zm_env_check()
|
|||||||
}
|
}
|
||||||
if (version_compare(SWOOLE_VERSION, '4.6.7') < 0 && !extension_loaded('pcntl')) {
|
if (version_compare(SWOOLE_VERSION, '4.6.7') < 0 && !extension_loaded('pcntl')) {
|
||||||
Console::error(zm_internal_errcode('E00004') . 'Swoole 版本必须不低于 4.6.7 或 PHP 安装加载了 pcntl 扩展!');
|
Console::error(zm_internal_errcode('E00004') . 'Swoole 版本必须不低于 4.6.7 或 PHP 安装加载了 pcntl 扩展!');
|
||||||
exit();
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user