Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-micro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-micro
Commits
5d7f10d5
Commit
5d7f10d5
authored
Mar 02, 2023
by
chentianyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/v2.2.33-branch' into 2.2
parents
5a6750fe
b1eb5c08
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
14 deletions
+33
-14
composer.json
composer.json
+12
-12
RegisterServiceListener.php
src/Listener/RegisterServiceListener.php
+19
-1
Drawer.php
src/Tools/Drawer.php
+2
-1
No files found.
composer.json
View file @
5d7f10d5
...
@@ -15,21 +15,21 @@
...
@@ -15,21 +15,21 @@
"ext-gd"
:
"*"
,
"ext-gd"
:
"*"
,
"ext-curl"
:
"*"
,
"ext-curl"
:
"*"
,
"ext-mbstring"
:
"*"
,
"ext-mbstring"
:
"*"
,
"
hyperf/cache
"
:
"
~2.1.0
"
,
"
hyperf/cache
"
:
"
~2.1.0
|~2.2.0
"
,
"
hyperf/framework
"
:
"
~2.1.0
"
,
"
hyperf/framework
"
:
"
~2.1.0
|~2.2.0
"
,
"
hyperf/db-connection
"
:
"
~2.1.0
"
,
"
hyperf/db-connection
"
:
"
~2.1.0
|~2.2.0
"
,
"
hyperf/validation
"
:
"
~2.1.0
"
,
"
hyperf/validation
"
:
"
~2.1.0
|~2.2.0
"
,
"
hyperf/command
"
:
"
~2.1.0
"
,
"
hyperf/command
"
:
"
~2.1.0
|~2.2.0
"
,
"
hyperf/redis
"
:
"
~2.1.0
"
,
"
hyperf/redis
"
:
"
~2.1.0
|~2.2.0
"
,
"
hyperf/guzzle
"
:
"
~2.1.0
"
,
"
hyperf/guzzle
"
:
"
~2.1.0
|~2.2.0
"
,
"
hyperf/config
"
:
"
~2.1.0
"
,
"
hyperf/config
"
:
"
~2.1.0
|~2.2.0
"
,
"
hyperf/logger
"
:
"
~2.1.0
"
,
"
hyperf/logger
"
:
"
~2.1.0
|~2.2.0
"
,
"
hyperf/service-governance
"
:
"
~2.1.0
"
,
"
hyperf/service-governance
"
:
"
~2.1.0
|~2.2.0
"
,
"
fzaninotto/faker
"
:
"
^1.9
"
,
"
fzaninotto/faker
"
:
"
^1.9
"
,
"
phpoffice/phpspreadsheet
"
:
"
^1.18
"
,
"
phpoffice/phpspreadsheet
"
:
"
^1.18
"
,
"
dimsav/unix-zipper
"
:
"
1.*
"
,
"
dimsav/unix-zipper
"
:
"
1.*
"
,
"
hyperf/amqp
"
:
"
~2.1.0
"
,
"
hyperf/amqp
"
:
"
~2.1.0
|~2.2.0
"
,
"
hyperf/paginator
"
:
"
~2.1.0
"
"
hyperf/paginator
"
:
"
~2.1.0
|~2.2.0
"
},
},
"autoload"
:
{
"autoload"
:
{
"psr-4"
:
{
"psr-4"
:
{
...
...
src/Listener/RegisterServiceListener.php
View file @
5d7f10d5
...
@@ -30,7 +30,7 @@ class RegisterServiceListener extends BaseRegisterServiceListener
...
@@ -30,7 +30,7 @@ class RegisterServiceListener extends BaseRegisterServiceListener
*/
*/
$host
=
isset
(
$server
[
'local_ip'
])
?
$server
[
'local_ip'
]
:
$server
[
'host'
];
$host
=
isset
(
$server
[
'local_ip'
])
?
$server
[
'local_ip'
]
:
$server
[
'host'
];
if
(
in_array
(
$host
,
[
'0.0.0.0'
,
'localhost'
]))
{
if
(
in_array
(
$host
,
[
'0.0.0.0'
,
'localhost'
]))
{
$host
=
$this
->
getInternalIp
();
$host
=
$this
->
get
Real
InternalIp
();
}
}
if
(
!
filter_var
(
$host
,
FILTER_VALIDATE_IP
))
{
if
(
!
filter_var
(
$host
,
FILTER_VALIDATE_IP
))
{
throw
new
\InvalidArgumentException
(
sprintf
(
'Invalid host %s'
,
$host
));
throw
new
\InvalidArgumentException
(
sprintf
(
'Invalid host %s'
,
$host
));
...
@@ -45,4 +45,22 @@ class RegisterServiceListener extends BaseRegisterServiceListener
...
@@ -45,4 +45,22 @@ class RegisterServiceListener extends BaseRegisterServiceListener
return
$result
;
return
$result
;
}
}
protected
function
getRealInternalIp
()
{
if
(
method_exists
(
self
::
class
,
'getInternalIp'
))
{
return
$this
->
getInternalIp
();
}
$ips
=
swoole_get_local_ip
();
if
(
is_array
(
$ips
)
&&
!
empty
(
$ips
))
{
return
current
(
$ips
);
}
/** @var mixed|string $ip */
$ip
=
gethostbyname
(
gethostname
());
if
(
is_string
(
$ip
))
{
return
$ip
;
}
throw
new
\RuntimeException
(
'Can not get the internal IP.'
);
}
}
}
\ No newline at end of file
src/Tools/Drawer.php
View file @
5d7f10d5
...
@@ -132,8 +132,9 @@ class Drawer
...
@@ -132,8 +132,9 @@ class Drawer
{
{
$originUrl
=
$url
;
$originUrl
=
$url
;
//如果shopify 去掉版本号
//如果shopify 去掉版本号
if
(
strpos
(
$url
,
'shopify'
)
!==
false
)
{
if
(
strpos
(
$url
,
'shopify'
)
!==
false
&&
strpos
(
$url
,
'?v='
)
!==
false
)
{
$url
=
substr
(
$url
,
0
,
strpos
(
$url
,
'?v='
));
$url
=
substr
(
$url
,
0
,
strpos
(
$url
,
'?v='
));
var_dump
(
$url
);
}
}
$savePath
=
$this
->
rootPath
.
'/download/images/'
.
(
$path
?
$path
.
'/'
:
$this
->
savePath
);
$savePath
=
$this
->
rootPath
.
'/download/images/'
.
(
$path
?
$path
.
'/'
:
$this
->
savePath
);
create_file_dir
(
$savePath
);
create_file_dir
(
$savePath
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment