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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
Imldeployment
Commits
04637992
Commit
04637992
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
actionlog class: fix linebraek; reformat code
parent
9f45eeb3
No related branches found
No related tags found
1 merge request
!62
V2.0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
public_html/deployment/classes/actionlog.class.php
+114
-106
114 additions, 106 deletions
public_html/deployment/classes/actionlog.class.php
with
114 additions
and
106 deletions
public_html/deployment/classes/actionlog.class.php
+
114
−
106
View file @
04637992
...
...
@@ -6,7 +6,8 @@ require_once 'user.class.php';
*
* @author hahn
*/
class
Actionlog
{
class
Actionlog
{
private
$_dbfile
=
''
;
private
$_aLoglevels
=
array
(
"info"
,
"warning"
,
"error"
,
"success"
);
// array of valid loglevels
...
...
@@ -44,7 +45,8 @@ class Actionlog {
* @global array $aConfig settings
* @param string $sProject project ID
*/
public
function
__construct
(
$sProject
=
false
)
{
public
function
__construct
(
$sProject
=
false
)
{
global
$aConfig
;
if
(
!
isset
(
$aConfig
[
"appRootDir"
]))
{
die
(
__CLASS__
.
"::"
.
__FUNCTION__
.
" ERROR: configuration with
\$
aConfig was not loaded."
);
...
...
@@ -71,7 +73,8 @@ class Actionlog {
/**
* create sqlite database - called in constructor if the file does not exist
*/
private
function
_createDb
()
{
private
function
_createDb
()
{
echo
"try to create file
$this->_dbfile
...<br>
\n
"
;
return
$this
->
_makeQuery
(
$this
->
_sCreate
);
}
...
...
@@ -81,7 +84,8 @@ class Actionlog {
* @param string $sSql sql statement
* @return database object
*/
private
function
_makeQuery
(
$sSql
)
{
private
function
_makeQuery
(
$sSql
)
{
// $this->_log(__FUNCTION__."($sSql)");
// echo "<pre>".htmlentities($sSql)."</pre>";
$db
=
new
PDO
(
"sqlite:"
.
$this
->
_dbfile
);
...
...
@@ -102,7 +106,8 @@ class Actionlog {
* @param string $sLoglevel loglevel
* @return type
*/
public
function
add
(
$sMessage
,
$sAction
=
""
,
$sLoglevel
=
"info"
,
$sTimeStart
=
false
)
{
public
function
add
(
$sMessage
,
$sAction
=
""
,
$sLoglevel
=
"info"
,
$sTimeStart
=
false
)
{
if
(
array_search
(
$sLoglevel
,
$this
->
_aLoglevels
)
===
false
)
{
die
(
__class__
.
": loglevel
$sLoglevel
is invalid"
);
}
...
...
@@ -143,7 +148,8 @@ class Actionlog {
* @param string $sOKChars good chars to keep
* @return string
*/
private
function
_filterAllowedChars
(
$sVal
,
$sOKChars
){
private
function
_filterAllowedChars
(
$sVal
,
$sOKChars
)
{
return
preg_replace
(
'/[^'
.
$sOKChars
.
']/i'
,
''
,
$sVal
);
}
...
...
@@ -157,7 +163,8 @@ class Actionlog {
* 'limit' - limit clausel - part behind "LIMIT "
* @return array
*/
public
function
getLogs
(
$aFilter
=
array
())
{
public
function
getLogs
(
$aFilter
=
array
())
{
// var_dump(R::findAll( 'log' ));
$aReturn
=
array
();
...
...
@@ -203,7 +210,8 @@ class Actionlog {
* 'limit' - limit clausel - part behind "LIMIT "
* @return string
*/
public
function
renderLogs
(
$aFilter
=
array
(),
$bIsFullsearch
=
false
)
{
public
function
renderLogs
(
$aFilter
=
array
(),
$bIsFullsearch
=
false
)
{
$sReturn
=
''
;
static
$bWasShown
;
...
...
@@ -239,7 +247,8 @@ class Actionlog {
),
'validate'
=>
array
(),
'form'
=>
array
(),
));
)
);
// generate filter for log table
// $bIsFullsearch: true = show all inputs; false: no interactive search
...
...
@@ -280,12 +289,12 @@ class Actionlog {
'options'
=>
$aLimits
,
'inline'
=>
true
,
);
// force a line break
$aForms
[
"filter"
][
"form"
][
'line'
]
=
array
(
'type'
=>
'markup'
,
'value'
=>
''
,
'value'
=>
'
<div class="col-sm-12"></div>
'
,
);
}
else
{
// write filters as hidden fields
...
...
@@ -310,7 +319,7 @@ class Actionlog {
'onkeyup'
=>
'filterLogTable();'
,
'onkeypress'
=>
'filterLogTable();'
,
'onchange'
=>
'filterLogTable();'
,
'size'
=>
20
,
//
'size' => 20,
);
if
(
!
$bIsFullsearch
)
{
$aForms
[
"filter"
][
"form"
][
'btnalllogs'
]
=
array
(
...
...
@@ -386,5 +395,4 @@ class Actionlog {
}
return
$sReturn
;
}
}
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