Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pay
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
bp
pay
Commits
4607ae47
Commit
4607ae47
authored
Jul 15, 2021
by
wanjilong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 调整cli 参数格式
parent
71f1acca
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
12 deletions
+26
-12
ExceptionHandler.php
application/exception/ExceptionHandler.php
+6
-5
PayService.php
application/services/pay/PayService.php
+2
-0
cli.ini
conf/cli.ini
+3
-3
cli.php
public/cli.php
+15
-4
No files found.
application/exception/ExceptionHandler.php
View file @
4607ae47
...
...
@@ -8,6 +8,7 @@ namespace App\Exception;
* 重写Handle的render方法,实现自定义异常消息
*/
use
Api\PhpUtils\Log\FileLog
;
use
Helpers\ApiResponse
;
use
Yaf\Registry
;
...
...
@@ -48,16 +49,16 @@ class ExceptionHandler
*/
private
function
recordErrorLog
(
$e
)
{
if
(
$e
instanceof
\ErrorException
||
$e
instanceof
\Exception
){
if
(
$e
instanceof
\ErrorException
||
$e
instanceof
\Exception
||
$e
instanceof
\Error
){
$message
=
$e
->
getMessage
();
$file_name
=
$e
->
getFile
();
$line_num
=
$e
->
getLine
();
$msg
=
' file_name : '
.
$file_name
.
' line_num : '
.
$line_num
.
' message : '
.
$message
;
// LogUtil::error('exception handler', $msg
);
}
if
(
is_string
(
$e
)
||
is_int
(
$e
)){
// LogUtil
::error('exception handler', $e);
FileLog
::
error
(
get_class
(
$e
)
.
' handler'
,
$msg
,
$e
,
'wanjilong@yidian-inc.com'
);
}
elseif
(
is_string
(
$e
)
||
is_int
(
$e
)){
FileLog
::
error
(
'exception handler'
,
$e
);
}
}
}
\ No newline at end of file
application/services/pay/PayService.php
View file @
4607ae47
...
...
@@ -317,6 +317,7 @@ class PayService
}
PayOrderItem
::
update
([
'notify_account_status'
=>
2
,
'notify_account_times[+]'
=>
1
,
'notify_account_success_time'
=>
date
(
'Y-m-d H:i:s'
)
],
[
'order_item_id'
=>
$order_item_id
,
'can_notify_account'
=>
1
]);
...
...
@@ -325,6 +326,7 @@ class PayService
//补偿处理
PayOrderItem
::
update
([
'notify_account_status'
=>
0
,
'notify_account_times[+]'
=>
1
,
],
[
'order_item_id'
=>
$order_item_id
,
'can_notify_account'
=>
1
]);
}
}
...
...
conf/cli.ini
View file @
4607ae47
[common]
application.directory
=
APP
LICATION_PATH"/application"
application.library
=
APP
LICATION_PATH"/application
/library"
application.bootstrap
=
APP
LICATION_PATH"/application
/BootstrapCli.php"
application.directory
=
APP
_PATH
application.library
=
APP
_PATH"
/library"
application.bootstrap
=
APP
_PATH"
/BootstrapCli.php"
application.dispatcher.catchException
=
true
application.dispatcher.throwException
=
true
daemon.script_dir
=
"
\\
Daemon
\\
"
...
...
public/cli.php
View file @
4607ae47
...
...
@@ -14,23 +14,34 @@ if( !substr(php_sapi_name(), 0, 3) == 'cli' ) {
die
;
}
/* 定义这个常量是为了在cli.ini中引用*/
define
(
'ROOT_PATH'
,
realpath
(
__DIR__
.
'/../'
));
define
(
'APPLICATION_PATH'
,
realpath
(
__DIR__
.
'/../'
));
define
(
'APP_PATH'
,
realpath
(
__DIR__
.
'/../application'
));
define
(
'APP_START'
,
microtime
(
true
));
require
ROOT_PATH
.
'/vendor/autoload.php'
;
$application
=
new
Yaf\Application
(
ROOT_PATH
.
"/conf/cli.ini"
);
/**
* 获取模块/控制器/方法
usage: php cli.php "t=Wallet&n=2&j=sync_wallet"
usage: php cli.php Wallet sync_wallet 2
*
*/
$module
=
"cli"
;
$controller
=
$argv
[
1
]
??
""
;
$method
=
$argv
[
2
]
??
""
;
$controller
=
"daemon"
;
$method
=
"run"
;
$param
=
[];
$param
[
't'
]
=
$argv
[
1
]
??
"Wallet"
;
$param
[
'j'
]
=
$argv
[
2
]
??
"sync_wallet"
;
$param
[
'n'
]
=
$argv
[
3
]
??
2
;
/*
if (!empty($argv[3]))
{
parse_str($argv[3], $param);
}
*/
$application
->
bootstrap
()
->
getDispatcher
()
->
dispatch
(
new
Yaf\Request\Simple
(
""
,
$module
,
$controller
,
$method
,
$param
)
);
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