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 6516bdeb
authored
Mar 10, 2012
by
Frederick d. Maus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
D::cf
1 parent
612ea079
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
29 deletions
D/class_D.inc.php
class_mcArray.inc.php
config.php
doOnTheEnd.php
doOnTheStart.php
D/class_D.inc.php
View file @
6516bde
...
...
@@ -138,13 +138,17 @@ class D {
}
public
static
function
cf
(
$param_string
,
$param_print
=
true
,
$param_force
=
false
)
{
D
::
printCurrentFunction
(
$param_print
,
$param_string
,
true
);
}
/**
* Funktion zeigt html liste
* <li>$param_string</li>
*/
public
static
function
li
(
$param_string
,
$param_print
=
true
,
$param_force
=
false
)
{
self
::
printCurrentFunction
(
$param_print
);
self
::
new_echo
(
"<li>"
.
$param_string
.
"</li>"
,
$param_print
,
$param_force
);
D
::
printCurrentFunction
(
$param_print
);
D
::
new_echo
(
"<li>"
.
$param_string
.
"</li>"
,
$param_print
,
$param_force
);
}
public
static
function
kindof
(
$param_kindof
,
$param_string
=
""
,
$param_print
=
true
,
$param_force
=
false
)
{
self
::
printCurrentFunction
(
$param_print
);
...
...
@@ -229,31 +233,35 @@ class D {
* @static
*/
private
static
function
printCurrentFunction
(
$param_print
,
$param_string
=
''
)
{
private
static
function
printCurrentFunction
(
$param_print
,
$param_string
=
''
,
$param_onlyFunction
=
false
)
{
if
(
$param_print
)
{
$array
=
debug_backtrace
();
$i
=
2
;
if
(
is_array
(
$array
)
&&
array_key_exists
(
$i
,
$array
)){
// echo 'hello<br><pre>';
// print_r($array[1]);
// echo '</pre>';
$var_depth
=
0
;
for
(
$v
=
0
;
$v
<
count
(
$array
);
$v
++
){
if
(
array_key_exists
(
'class'
,
$array
[
$v
])
&&
array_key_exists
(
'class'
,
$array
[
$i
])
&&
$array
[
$v
][
'class'
]
.
$array
[
$v
][
'type'
]
.
$array
[
$v
][
'function'
]
==
$array
[
$i
][
'class'
]
.
$array
[
$i
][
'type'
]
.
$array
[
$i
][
'function'
]
){
$var_depth
++
;
if
(
$param_onlyFunction
)
{
self
::
new_echo
(
''
.
$array
[
$i
-
1
][
"line"
]
.
':'
.
$array
[
$i
][
"class"
]
.
$array
[
$i
][
"type"
]
.
$array
[
$i
][
"function"
]
.
'(): '
.
$param_string
);
}
else
{
if
(
is_array
(
$array
)
&&
array_key_exists
(
$i
,
$array
)){
// echo 'hello<br><pre>';
// print_r($array[1]);
// echo '</pre>';
$var_depth
=
0
;
for
(
$v
=
0
;
$v
<
count
(
$array
);
$v
++
){
if
(
array_key_exists
(
'class'
,
$array
[
$v
])
&&
array_key_exists
(
'class'
,
$array
[
$i
])
&&
$array
[
$v
][
'class'
]
.
$array
[
$v
][
'type'
]
.
$array
[
$v
][
'function'
]
==
$array
[
$i
][
'class'
]
.
$array
[
$i
][
'type'
]
.
$array
[
$i
][
'function'
]
){
$var_depth
++
;
}
// D::ulli($v.': '.$array[$v]['class'].$array[$v]['type'].$array[$v]['function']);
}
// D::ulli($v.': '.$array[$v]['class'].$array[$v]['type'].$array[$v]['function']);
}
self
::
new_echo
(
$param_string
.
"<p><i style=
\"
font-size:10;color:gray;
\"
><b>"
.
$array
[
$i
][
"class"
]
.
$array
[
$i
][
"type"
]
.
$array
[
$i
][
"function"
]
.
"(...)</b> <span title='Rekursionstiefe'>(RT:
$var_depth
)</span> aufgerufen in Zeile "
.
$array
[
$i
][
"line"
]
.
" in Datei <a href=
\"
"
.
substr
(
$array
[
$i
][
"file"
],
strpos
(
$array
[
$i
][
"file"
],
"httpdocs"
)
+
8
)
.
"
\"
>"
.
basename
(
$array
[
$i
][
"file"
])
.
"</a></i> .... [<i style=
\"
font-size:10;color:gray;
\"
>"
.
$array
[
$i
-
1
][
'class'
]
.
$array
[
$i
-
1
][
'type'
]
.
$array
[
$i
-
1
][
'function'
]
.
"(...) aufgerufen in "
.
basename
(
$array
[
$i
-
1
][
"file"
])
.
" Zeile: "
.
$array
[
$i
-
1
][
"line"
]
.
" </i>]</p>"
);
//echo '___________<pre>';
//echo print_r($array[$i], true);
//echo '</pre>';
self
::
new_echo
(
$param_string
.
" <i style=
\"
font-size:10;color:gray;
\"
><b>"
.
$array
[
$i
][
"class"
]
.
$array
[
$i
][
"type"
]
.
$array
[
$i
][
"function"
]
.
"()</b> <span title='Rekursionstiefe'>(RT:
$var_depth
)</span> call in row "
.
$array
[
$i
][
"line"
]
.
" in <a href=
\"
"
.
substr
(
$array
[
$i
][
"file"
],
strpos
(
$array
[
$i
][
"file"
],
"httpdocs"
)
+
8
)
.
"
\"
>"
.
basename
(
$array
[
$i
][
"file"
])
.
"</a></i> => [<i style=
\"
font-size:10;color:gray;
\"
>"
.
$array
[
$i
-
1
][
'class'
]
.
$array
[
$i
-
1
][
'type'
]
.
$array
[
$i
-
1
][
'function'
]
.
"() call in "
.
basename
(
$array
[
$i
-
1
][
"file"
])
.
" Zeile: "
.
$array
[
$i
-
1
][
"line"
]
.
" </i>]"
);
//echo '___________<pre>';
//echo print_r($array[$i], true);
//echo '</pre>';
}
}
}
}
...
...
class_mcArray.inc.php
View file @
6516bde
...
...
@@ -5,6 +5,40 @@
* SEOLinkCache eingesetzt werden
*/
class
mcArray
{
/**
* check if key path is in array and value is not emtpy array
*
* @param array $param_Array
* @param string $param_key -- $param_Array[$param_key]
* @param string $param_key2 -- $param_Array[$param_key][$param_key2]
* @param string $param_key3 -- $param_Array[$param_key][$param_key2][$param_key3]
* @param string $param_key4 -- $param_Array[$param_key][$param_key2][$param_key3][$param_key4]
* @param string $param_key5 -- $param_Array[$param_key][$param_key2][$param_key3][$param_key4][$param_key5]
* @param string $param_key6 -- $param_Array[$param_key][$param_key2][$param_key3][$param_key4][$param_key5][$param_key6]
* @return bool
*/
public
static
function
checkKeyHasFullArray
(
$param_Array
,
$param_key
,
$param_key2
=
null
,
$param_key3
=
null
,
$param_key4
=
null
,
$param_key5
=
null
,
$param_key6
=
null
)
{
if
(
is_array
(
$param_Array
))
{
if
(
array_key_exists
(
$param_key
,
$param_Array
)
&&
is_array
(
$param_Array
[
$param_key
])
&&
!
empty
(
$param_Array
[
$param_key
])
)
{
if
(
is_null
(
$param_key2
))
{
return
true
;
}
else
{
return
mcArray
::
checkKeyHasFullArray
(
$param_Array
[
$param_key
],
$param_key2
,
$param_key3
,
$param_key4
,
$param_key5
);
}
}
else
{
return
false
;
}
}
else
{
return
false
;
}
}
public
static
function
returnValueFromKeyPath
(
array
$param_PathAsArray
,
array
$param_Array
)
{
$searcharray
=
$param_Array
;
foreach
(
$param_PathAsArray
as
$key
)
{
...
...
config.php
View file @
6516bde
...
...
@@ -26,6 +26,7 @@ if(!isset($__mc_D_LOGFILE)) {
* @var string -- file for the D Output
*/
$__mc_D_LOGFILE
=
$__BASEPATH_EX
.
'log/mc.'
.
$string
.
'.DEV_D.log'
;
//
}
if
(
!
isset
(
$__mc_D_SCREENOUTPUT
))
{
...
...
doOnTheEnd.php
View file @
6516bde
...
...
@@ -19,7 +19,7 @@ if($_LOSP_DEV) {
D
::
printToScreen
();
}
if
(
$__mc_D_LOGFILE
)
{
D
::
li
(
$__mc_D_LOGFILE
);
//
D::li($__mc_D_LOGFILE);
D
::
printToFile
(
$__mc_D_LOGFILE
,
'a'
);
}
}
...
...
doOnTheStart.php
View file @
6516bde
...
...
@@ -36,17 +36,20 @@ if($_LOSP_DEV) {
}
}
//mcFile::write('log/tmp.bla', date('d.m.Y G:i:s').': '.$_SERVER['SCRIPT_NAME'].' -- '.$_SERVER['REQUEST_URI'].mcCONST::TAB.($_SERVER['SCRIPT_NAME']==$_SERVER['REQUEST_URI']).mcCONST::LINEBREAK, 'a');
foreach
(
$__mc_Report
as
$Report
)
{
foreach
(
$Report
as
$kindofDistribute
=>
$params
)
{
if
(
$kindofDistribute
==
'toFile'
)
{
if
(
$params
[
'reset'
])
{
unlink
(
$params
[
'file'
]
);
mcFile
::
write
(
$params
[
'file'
],
$var_message
,
'w'
);
if
(
is_array
(
$__mc_Report
))
{
foreach
(
$__mc_Report
as
$Report
)
{
foreach
(
$Report
as
$kindofDistribute
=>
$params
)
{
if
(
$kindofDistribute
==
'toFile'
)
{
if
(
array_key_exists
(
'reset'
,
$params
)
&&
$params
[
'reset'
])
{
unlink
(
$params
[
'file'
]
);
mcFile
::
write
(
$params
[
'file'
],
$var_message
,
'w'
);
}
}
}
}
}
}
D
::
start
();
}
...
...
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