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 6453cb7e
authored
Dec 09, 2013
by
sn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
D::printClassesforFunction
1 parent
fd4337ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
D/class_D.inc.php
D/class_D.inc.php
View file @
6453cb7
...
...
@@ -341,6 +341,53 @@ class D {
}
}
/**
*
* @param object|classname $param_class
* @param string $param_fncname
* @param bool $param_onlyReturn
* @return array
*/
public
static
function
printClassesforFunction
(
$param_class
,
$param_fncname
,
$param_onlyReturn
,
$param_print
=
true
,
$param_force
=
false
,
$param_htmlentities
=
false
)
{
if
(
is_object
(
$param_class
))
{
$classname
=
get_class
(
$param_class
);
}
else
if
(
class_exists
(
$param_class
))
{
$classname
=
$param_class
;
}
$result
=
array
();
do
{
$methods
=
get_class_methods
(
$classname
);
// D::show($methods, $classname);
if
(
array_search
(
$param_fncname
,
$methods
))
{
$result
[]
=
array
(
$classname
=>
$param_fncname
);
}
}
while
(
$classname
=
get_parent_class
(
$classname
));
if
(
empty
(
$result
))
{
return
D
::
printClassesforFunction
(
$param_class
,
'__call'
,
$param_onlyReturn
);
}
if
(
$param_onlyReturn
)
{
return
$result
;
}
else
{
// D::show($result, $param_fncname);
self
::
printCurrentFunction
(
$param_print
,
"<br>______________________<br>"
);
$string_show
=
"<br /><b>printClassesforFunction("
.
$param_fncname
.
")</b><br />"
;
$string_show
.=
"<pre>"
;
if
(
$param_htmlentities
){
$param_val
=
self
::
htmlencode_arrayvalues
(
$result
);
}
self
::
new_echo
(
$string_show
.
print_r
(
$result
,
true
)
.
'"</pre>"'
,
$param_print
,
$param_force
);
return
$result
;
}
}
public
static
function
backtrace
(
$class
=
null
,
$param_print
=
true
,
$param_force
=
false
)
{
self
::
printCurrentFunction
(
$param_print
);
//echo '<h1>backtrace('.$class.')</h1>';
...
...
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