@@ 82-91 (lines=10) @@ | ||
79 | */ |
|
80 | public function add($command, $parameters) { |
|
81 | ||
82 | if ( empty($parameters["class"]) ) { |
|
83 | ||
84 | $this->logger->error("Skipping command ".$command.": invalid command definition", array( |
|
85 | "NAME" => $command, |
|
86 | "PARAMETERS" => $parameters |
|
87 | )); |
|
88 | ||
89 | return false; |
|
90 | ||
91 | } |
|
92 | ||
93 | // replace double backslashes from classname (if any!) |
|
94 | $class = str_replace('\\\\', '\\', $parameters["class"]); |
|
@@ 96-105 (lines=10) @@ | ||
93 | // replace double backslashes from classname (if any!) |
|
94 | $class = str_replace('\\\\', '\\', $parameters["class"]); |
|
95 | ||
96 | if ( !class_exists($class) ) { |
|
97 | ||
98 | $this->logger->error("Skipping command ".$command.": missing class", array( |
|
99 | "NAME" => $command, |
|
100 | "CLASS" => $class |
|
101 | )); |
|
102 | ||
103 | return false; |
|
104 | ||
105 | } |
|
106 | ||
107 | $this->command_classes[$command] = $class; |
|
108 |