Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96915 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15643 invoked from network); 16 Nov 2016 11:08:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2016 11:08:32 -0000 Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 74.125.82.50 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 74.125.82.50 mail-wm0-f50.google.com Received: from [74.125.82.50] ([74.125.82.50:38843] helo=mail-wm0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/6D-05303-E2E3C285 for ; Wed, 16 Nov 2016 06:08:30 -0500 Received: by mail-wm0-f50.google.com with SMTP id f82so65186358wmf.1 for ; Wed, 16 Nov 2016 03:08:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pthreads-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=KhQ+m3QKQk3lhfJY3NVn8DkdQK5gYQkeSJ87Bc/hsgc=; b=yn2WjDMEclqTNnlqW+F6M9IAKO7ZKt2zaYQ+bui03uLZbz+Me3aQpz9n+AdmLNAtcD QW8ImtVSCNR3heV+HAGWz3t5LWLlUfJyL+Zhh6B+Rzs8SwVi0ami5l/kkgVPntWnJqxE E4/zUB3zMdbCGwS5ORRpmn8+5CVDN2PQ6oswMyILW1OZmDbkKAQ3pM6LbSSTG5PEFzQJ OVuDXo8R8TrD0j90cJ0G3WZdSe7ki9fvRhczC6JWqBcqi2wL7hw/cSOr9bk0n1qHo4Ag CgYyxzFteQ19f/aPh5sPW7RjfWFKuim9/J/zOiZrlMrx1vagkwTaAkrhRlkbhKlZMjZb 0/JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KhQ+m3QKQk3lhfJY3NVn8DkdQK5gYQkeSJ87Bc/hsgc=; b=Y43Y/JwWk4XCKxzcrugL/tvs+GlnEAUgEBMuaX0peH4ga/c6SW7fMeLLQwOtkghc3y wlgEeS9rYzmW+7hDeMjZa8LSM93FXqx5gMOQK4B7g73mz/IzcvmpOrXCfenKjFkHJNZM G8faeBE2QAFQrQGus0n96iuJ0uDbIkOueMCH+KWKeRqw+jTZJfaeOiGu8hY0EBZwSixJ UG5KlsZqv4ZKqmACyCnMbCPlyfDav7cpt8J4Ojz56Go4Tb33Zzcjj9W3pDqiobCezKXb Iec8pmCJ8ZyH27Pas0RScbBwYEi4cUyqx55WzATBSroGeAzQlK6ErTgffWP9G9c4/GZE XLcg== X-Gm-Message-State: ABUngvfEkywmVTAbHC5sROXQxNj4+hxbLRfYPrdPbqP+Tic6o8eYsCP+lQQKa1EjoLgvlkkePtNLicY7wQf2Xw== X-Received: by 10.28.13.9 with SMTP id 9mr8473409wmn.50.1479294507055; Wed, 16 Nov 2016 03:08:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.142.81 with HTTP; Wed, 16 Nov 2016 03:08:26 -0800 (PST) X-Originating-IP: [109.157.245.230] In-Reply-To: References: Date: Wed, 16 Nov 2016 11:08:26 +0000 Message-ID: To: Aaron Lewis Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11444d449c91890541691796 Subject: Re: [PHP-DEV] Ask php cli to parse HTTP request From: pthreads@pthreads.org (Joe Watkins) --001a11444d449c91890541691796 Content-Type: text/plain; charset=UTF-8 Morning, Ordinarily, we don't parse that stuff, because the server communicates via CGI/FCGI or some other server specific interface (apache). The CLI server does though, I'd look there for inspiration ... there's also an HTTP parser included in there ... Cheers Joe On Wed, Nov 16, 2016 at 10:50 AM, Aaron Lewis wrote: > I have a file that contains a HTTP request, > > ``` > GET /xxx.php > Host: xxx > Content-Type: xxx > ... > ``` > > I would like to ask PHP cli to parse the HTTP request from a file, and > setup $_FILES, $_POST, $_SERVER etc. > What should I do? I'm familiar with PHP extensions, so I'm capable of > modifying SAPI myself. > > So far I've found sapi_post_entry, but I couldn't get the whole > picture. Where's the entry point of request parsing? > > > -- > Best Regards, > Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ > Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11444d449c91890541691796--