| @@ 82-104 (lines=23) @@ | ||
| 79 | ||
| 80 | $arguments = isset($actions["arguments"]) && is_array($actions["arguments"]) ? $actions["arguments"] : array(); |
|
| 81 | ||
| 82 | switch ($action) { |
|
| 83 | ||
| 84 | case 'install': |
|
| 85 | ||
| 86 | $this->getPackageInstaller() |
|
| 87 | ->commands() |
|
| 88 | ->add($package_name, $command, $class, $description, $aliases, $options, $arguments); |
|
| 89 | ||
| 90 | $io->write(" <info>+</info> enabled command ".$command); |
|
| 91 | ||
| 92 | break; |
|
| 93 | ||
| 94 | case 'uninstall': |
|
| 95 | ||
| 96 | $id = $this->getPackageInstaller()->commands()->getByName($name)->getId(); |
|
| 97 | ||
| 98 | $this->getPackageInstaller()->commands()->delete($id); |
|
| 99 | ||
| 100 | $io->write(" <comment>-</comment> disabled command ".$command); |
|
| 101 | ||
| 102 | break; |
|
| 103 | ||
| 104 | } |
|
| 105 | ||
| 106 | } catch (Exception $e) { |
|
| 107 | ||
| @@ 80-102 (lines=23) @@ | ||
| 77 | ||
| 78 | $signatures = isset($rpc["signatures"]) && is_array($rpc["signatures"]) ? $rpc["signatures"] : array(); |
|
| 79 | ||
| 80 | switch ($action) { |
|
| 81 | ||
| 82 | case 'install': |
|
| 83 | ||
| 84 | $this->getPackageInstaller() |
|
| 85 | ->rpc() |
|
| 86 | ->add($package_name, $rpc_method, $callback, $method, $description, $signatures); |
|
| 87 | ||
| 88 | $io->write(" <info>+</info> added rpc service ".$rpc['name']); |
|
| 89 | ||
| 90 | break; |
|
| 91 | ||
| 92 | case 'uninstall': |
|
| 93 | ||
| 94 | $id = $this->getPackageInstaller()->rpc()->getByName($rpc_method)->getId(); |
|
| 95 | ||
| 96 | $this->getPackageInstaller()->rpc()->delete($id); |
|
| 97 | ||
| 98 | $io->write(" <comment>-</comment> removed rpc service ".$rpc['name']); |
|
| 99 | ||
| 100 | break; |
|
| 101 | ||
| 102 | } |
|
| 103 | ||
| 104 | } catch (Exception $e) { |
|
| 105 | ||