Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66603 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21673 invoked from network); 13 Mar 2013 21:09:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Mar 2013 21:09:44 -0000 Authentication-Results: pb1.pair.com header.from=zelnaga@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=zelnaga@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.50 as permitted sender) X-PHP-List-Original-Sender: zelnaga@gmail.com X-Host-Fingerprint: 74.125.82.50 mail-wg0-f50.google.com Received: from [74.125.82.50] ([74.125.82.50:42097] helo=mail-wg0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 79/D9-05197-61BE0415 for ; Wed, 13 Mar 2013 16:09:43 -0500 Received: by mail-wg0-f50.google.com with SMTP id es5so1437691wgb.29 for ; Wed, 13 Mar 2013 14:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=6hUbUD2XvjkAdVQ7HuB/yYVutSwI+DfaQPAdu7v2K50=; b=hpFtp1/jINlLJ0/WWaFZvQ8o5yRhqQRXvoh5kwSylZcjknc5ntsH2opHMSWzW/woaY a2krXLwqJG3aa4mM7KZUf0dumYQsLrWNulgceKQpPbPwFxhmJ6sFsmX7DXBbB+JgQuG9 vkHwEJhnQfp8FV3DcdjgLNxuj6kQ3xygbpaJXqOv5xM2SHurkSb4DzEDye4QWGBxUH81 Plqtn3nOQFaYx/gtuEMxC5mXrSljSmzUAj3tStHXyZjvdHFzwACFAWWks+Gj4ATOYunK bGpYWHL4qLst1pwItn1+fm3mN/ZE8YDvSHErH41o6V7miDbMI6w6e2Wm7F2g/kupcyMp hL+Q== MIME-Version: 1.0 X-Received: by 10.180.101.41 with SMTP id fd9mr29473647wib.20.1363208980505; Wed, 13 Mar 2013 14:09:40 -0700 (PDT) Received: by 10.194.216.10 with HTTP; Wed, 13 Mar 2013 14:09:40 -0700 (PDT) In-Reply-To: <5140E399.905@lerdorf.com> References: <5140E399.905@lerdorf.com> Date: Wed, 13 Mar 2013 16:09:40 -0500 Message-ID: To: Rasmus Lerdorf Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] idea: add wrapper support to mysqli_connect From: zelnaga@gmail.com (Thomas Anderson) On Wed, Mar 13, 2013 at 3:37 PM, Rasmus Lerdorf wrote: > On 03/13/2013 12:08 PM, Thomas Anderson wrote: >> 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. > > Instead of adding all that gear to PHP itself, wouldn't it make more > sense to just use something like autossh to maintain your ssh tunnel and > have PHP connect to your tunnel endpoint? mysqli_connect() in PHP is > just a thin wrapper on top of the underlying library. Oh - I didn't know that. I thought (hoped) it might have been like a two second code change lol.