|
The ssh2 library and the local process library have significantly different approaches to managing processes.
- In SSH2, you first open the session (
ssh2_connect()) to get a session-resource, and then you send commands (ssh2_exec()) via that resource.
- You can also open a shell (
ssh2_shell()) for further commands, though it's unclear what the difference is.
- In proc, a process starts with a command. The command can then be left running to receive additional data, which will be interpreted by the initial command.
|
|
Action: Proc |
Action: SSH2
|
| Model Action |
Starter |
Session |
Starter |
Session
|
| Open |
NO OP |
|
create Session object |
ssh2_connect()
|
| Command |
proc_open() |
send to stdin |
forward to Session object |
ssh2_exec()
|
| Shut |
NO OP |
|
zap Session object |
ssh2_disconnect()
|
|