Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Imldeployment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
Imldeployment
Commits
b001777c
Commit
b001777c
authored
2 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Plain Diff
Merge branch '5591-remove-warnings' into 'master'
fix shooker warnings See merge request
!40
parents
58f91bc3
e1cd9021
No related branches found
No related tags found
1 merge request
!40
fix shooker warnings
Pipeline
#1086
passed
2 years ago
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public_html/deployment/classes/messenger.class.php
+10
-8
10 additions, 8 deletions
public_html/deployment/classes/messenger.class.php
with
10 additions
and
8 deletions
public_html/deployment/classes/messenger.class.php
+
10
−
8
View file @
b001777c
...
...
@@ -42,14 +42,16 @@ class messenger {
}
/**
* send an email if _aCfg['email'] exists
* send an email if _aCfg['email']
['to']
exists
*/
private
function
_sendEmail
(){
if
(
array_key_exists
(
'email'
,
$this
->
_aCfg
)
&&
array_key_exists
(
'to'
,
$this
->
_aCfg
[
'email'
])
)
{
if
(
isset
(
$this
->
_aCfg
[
'email'
][
'to'
])
&&
$this
->
_aCfg
[
'email'
][
'to'
])
{
preg_match
(
'/^(.*)\n/'
,
$this
->
_sMessage
,
$aTmp
);
$sSubject
=
$aTmp
[
0
];
return
mail
(
$this
->
_aCfg
[
'email'
][
'to'
],
$sSubject
,
$this
->
_sMessage
,
"From: "
.
$this
->
_aCfg
[
'email'
][
'from'
]
.
"
\r\n
"
.
return
mail
(
$this
->
_aCfg
[
'email'
][
'to'
],
$sSubject
,
$this
->
_sMessage
,
"From: "
.
$this
->
_aCfg
[
'email'
][
'from'
]
.
"
\r\n
"
.
"Reply-To: "
.
$this
->
_aCfg
[
'email'
][
'from'
]
.
"
\r\n
"
);
}
...
...
@@ -57,15 +59,15 @@ class messenger {
}
/**
* send a message to slack if _aCfg['slack'] exists
* send a message to slack if _aCfg['slack']
['incomingurl']
exists
*/
private
function
_sendToSlack
(){
if
(
array_key_exists
(
'slack'
,
$this
->
_aCfg
)
)
{
if
(
isset
(
$this
->
_aCfg
[
'slack'
][
'incomingurl'
])
&&
$this
->
_aCfg
[
'slack'
][
'incomingurl'
]
)
{
require_once
(
__DIR__
.
'/../../vendor/shooker/shooker.php'
);
$shkr
=
new
Shooker
();
$shkr
->
setupIncoming
(
$this
->
_aCfg
[
'slack'
][
'incomingurl'
]);
$sUser
=
(
array_key_exists
(
'user'
,
$this
->
_aCfg
[
'slack'
])
?
$this
->
_aCfg
[
'slack'
][
'user'
]
:
false
);
$sIcon
=
(
array_key_exists
(
'icon'
,
$this
->
_aCfg
[
'slack'
])
?
$this
->
_aCfg
[
'slack'
][
'icon'
]
:
false
);
$sUser
=
(
isset
(
$this
->
_aCfg
[
'slack'
]
[
'user'
]
)
?
$this
->
_aCfg
[
'slack'
][
'user'
]
:
false
);
$sIcon
=
(
isset
(
$this
->
_aCfg
[
'slack'
]
[
'icon'
]
)
?
$this
->
_aCfg
[
'slack'
][
'icon'
]
:
false
);
return
$shkr
->
sendMessage
(
$this
->
_sMessage
,
$sUser
,
$sIcon
);
}
return
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment