idea: add wrapper support to mysqli_connect
| From: | Thomas Anderson | Date: | Wed, 13 Mar 2013 19:08:00 +0000 |
| Subject: | idea: add wrapper support to mysqli_connect | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-66601@lists.php.net to get a copy of this message | ||
Instead of passing localhost to mysqli_connect as the $host parameter
I think it'd be useful if you could pass something like
ssh2.tunnel://user:pass@example.com:22/192.168.0.1:14 to it as well.
The main advantage I see of doing that is that you could tunnel
through SSH2, through SOCKS, through HTTP CONNECT, etc, a lot more
easily than you currently can. Like you could have an SSH connection
re-created every time a PHP script is called and a tunnel dynamically
made instead of having a persistent tunnel created with autossh or
whatever.
And even if SSH2 / SOCKS / CONNECT don't exist as built-in wrappers
custom stream wrappers could be made. This would additionally make it
easy for people to examine the underpinnings of MySQL. Instead of
intercepting the packets the MySQL client sends out and placing them
into an SSH tunnel or whatever one could just dump them to a log file
to better understand how MySQL clients work internally.