Skip to content

Commit

Permalink
Output error and skip adding nodes in error cases.
Browse files Browse the repository at this point in the history
When methods cannot be reflected from a class no nodes should be
created. This avoids warnings and notice errors.

Fixes #24
  • Loading branch information
markstory committed Mar 20, 2013
1 parent 2b18f72 commit f0c9a6d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/AclExtras.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ protected function _checkNode($path, $alias, $parentId = null) {
protected function _checkMethods($className, $controllerName, $node, $pluginPath = false) {
$baseMethods = get_class_methods('Controller');
$actions = get_class_methods($className);
if ($actions == null) {
$this->err(__('Unable to get methods for "%s"', $className));
return false;
}
$methods = array_diff($actions, $baseMethods);
foreach ($methods as $action) {
if (strpos($action, '_', 0) === 0) {
Expand Down

0 comments on commit f0c9a6d

Please sign in to comment.