Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ncphp
/
mcClasses
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7deb33ed
authored
May 07, 2012
by
Frederick d. Maus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
local - not interesting
1 parent
45813a0c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
10 deletions
D/class_D.inc.php
ReportHandling/class_mcPDOLogger.inc.php
class_mcCsv.inc.php
class_mcException.inc.php
doOnTheEnd.php
D/class_D.inc.php
View file @
7deb33e
...
...
@@ -17,6 +17,8 @@
*/
class
D
{
const
ALL
=
'ALL'
;
private
static
$echo_count
=
0
;
public
static
$echo_lines
=
array
();
...
...
@@ -54,7 +56,7 @@ class D {
$file_content
=
''
;
foreach
(
self
::
$echo_lines
as
$line_nr
=>
$line
)
{
if
(
$__mc_D_LOGFILE_ONLY_USER
===
$line
[
'print'
])
{
if
(
$__mc_D_LOGFILE_ONLY_USER
===
$line
[
'print'
]
||
D
::
ALL
===
$line
[
'print'
]
)
{
$file_content
.=
$line_nr
.
':'
.
mcCONST
::
TAB
.
self
::
html2text
(
$line
[
'line'
])
.
mcCONST
::
LINEBREAK
;
}
}
...
...
ReportHandling/class_mcPDOLogger.inc.php
View file @
7deb33e
...
...
@@ -12,18 +12,28 @@
*/
class
mcPDOLogger
{
private
static
$Messages
=
array
();
public
static
function
add
(
$param_order
,
array
$param_bindValueArray
=
null
,
$param_optional
=
''
)
{
public
static
function
add
(
$param_order
,
array
$param_bindValueArray
=
null
,
$param_
count_result
=
false
,
$param_
optional
=
''
)
{
mcPDOLogger
::
$Messages
[]
=
array
(
'order'
=>
$param_order
,
'bindValue'
=>
$param_bindValueArray
,
'optional'
=>
$param_optional
'optional'
=>
$param_optional
,
'count_result'
=>
$param_count_result
,
);
}
public
static
function
getMessagesAsText
()
{
$MessageAsText
=
''
;
foreach
(
mcPDOLogger
::
$Messages
as
$message
)
{
$MessageAsText
.=
"
\n
"
.
$message
[
'order'
]
.
"
\n
"
;
foreach
(
mcPDOLogger
::
$Messages
as
$index
=>
$message
)
{
arsort
(
$message
[
'bindValue'
]);
foreach
(
$message
[
'bindValue'
]
as
$string
=>
$value
)
{
if
(
is_string
(
$value
))
{
$value
=
"'"
.
$value
.
"'"
;
}
$message
[
'order'
]
=
str_replace
(
$string
,
$value
,
$message
[
'order'
]);
}
$MessageAsText
.=
"
\n
"
.
$index
.
":
\t
"
.
trim
(
$message
[
'order'
])
.
"
\n\t\t
count:
\t
"
.
$message
[
'count_result'
]
.
"
\n
"
;
}
mcPDOLogger
::
$Messages
=
array
();
...
...
class_mcCsv.inc.php
View file @
7deb33e
...
...
@@ -77,6 +77,21 @@ class mcCsv {
mcTableHtml
::
showTable
(
array
(
$cvs_import_header
),
mcLanguage
::
getWord
(
'rowformat'
)
.
': '
.
$csv_header
);
}
}
public
static
function
exportXmlToCsv
(
$param_xml
,
$param_name
,
$param_charset
=
'utf-8'
,
$param_filename
=
'download.csv'
){
$csv_value
=
explode
(
'CUT_VALUE_FOR_NOT_THE_HEADER'
,
$param_xml
);
// Header senden
header
(
"Content-type: text/csv; charset='.
$param_charset
"
);
header
(
'Expires: '
.
gmdate
(
'D, d M Y H:i:s'
)
.
' GMT'
);
header
(
"Content-Disposition: attachment; filename ="
.
$param_filename
);
header
(
'Pragma: no-cache'
);
// Datei ausgeben
echo
strip_tags
(
htmlspecialchars_decode
(
trim
(
$csv_value
[
1
])));
}
}
?>
\ No newline at end of file
class_mcException.inc.php
View file @
7deb33e
...
...
@@ -9,7 +9,7 @@ class mcException extends mcEvent {
// if($e->getPrevious()) {
// D::e('there is a previous exception');
// }
D
::
cf
(
'ERROR'
,
D
::
ALL
);
if
(
get_class
(
$e
)
==
'PDOException'
)
{
foreach
(
$e
->
getTrace
()
as
$i
=>
$array
)
{
// D::li($i);
...
...
@@ -37,6 +37,7 @@ class mcException extends mcEvent {
public
static
$count
=
0
;
private
static
function
handle
(
$param_errno
,
$param_errstr
,
$param_errfile
,
$param_errline
,
$param_errcontext
)
{
self
::
add
(
new
mcException
(
$param_errno
,
$param_errstr
,
$param_errfile
,
$param_errline
,
$param_errcontext
));
self
::
$count
++
;
}
}
...
...
doOnTheEnd.php
View file @
7deb33e
...
...
@@ -13,19 +13,23 @@ mcReport::distribute($__mc_Report);
* developer things
*/
if
(
$_LOSP_DEV
)
{
if
(
$__mc_PDO_LOGFILE
)
{
$PDOLog
=
mcPDOLogger
::
getMessagesAsText
();
mcFile
::
write
(
$__mc_PDO_LOGFILE
,
$PDOLog
,
'a'
);
}
mcPerformance
::
showStats
(
$__mc_D_LOGFILE_ONLY_USER
);
D
::
showStats
(
$__mc_Report
,
$__BASEPATH_EX
,
$__mc_D_LOGFILE
);
if
(
$__mc_D_SCREENOUTPUT
)
{
D
::
printToScreen
();
}
if
(
$__mc_D_LOGFILE
)
{
// D::li($__mc_D_LOGFILE);
D
::
printToFile
(
$__mc_D_LOGFILE
,
'a'
);
}
if
(
$__mc_PDO_LOGFILE
)
{
$PDOLog
=
mcPDOLogger
::
getMessagesAsText
();
mcFile
::
write
(
$__mc_PDO_LOGFILE
,
$PDOLog
,
'a'
);
}
}
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment