Permalink
Browse files

Make parent method check explicit to Shell.

This makes only methods on Shell inaccessible on the command line.
Parent methods in AppShell or other parent classes can now be called directly.
Fixes #2193
  • Loading branch information...
1 parent db41a7d commit d87f9f060bc2b3c981b81b7a706779626eca69a9 @markstory markstory committed Nov 6, 2011
Showing with 2 additions and 5 deletions.
  1. +2 −5 lib/Cake/Console/Shell.php
@@ -273,15 +273,12 @@ public function hasTask($task) {
* @return boolean
*/
public function hasMethod($name) {
- if (empty($this->_reflection)) {
- $this->_reflection = new ReflectionClass($this);
- }
try {
- $method = $this->_reflection->getMethod($name);
+ $method = new ReflectionMethod($this, $name);
if (!$method->isPublic() || substr($name, 0, 1) === '_') {
return false;
}
- if ($method->getDeclaringClass() != $this->_reflection) {
+ if ($method->getDeclaringClass()->name == 'Shell') {
return false;
}
return true;

0 comments on commit d87f9f0

Please sign in to comment.