Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53237 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15078 invoked from network); 10 Jun 2011 12:12:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jun 2011 12:12:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=doctorrock83@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=doctorrock83@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: doctorrock83@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:64652] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/47-54720-F1A02FD4 for ; Fri, 10 Jun 2011 08:12:15 -0400 Received: by vxb40 with SMTP id 40so2404955vxb.29 for ; Fri, 10 Jun 2011 05:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=M7YswAEpnnzjclVcpu0DEsSvFrH5Tv5VzkYPJNpt5qQ=; b=oQsToQJcpWEcv19vj1AFR3KYPaUpb2K2dAZScky7nDDyinNCvc0NqtcQY5Gas11gp2 NaYUd5FEr2bPYPgUSDg65ikU8K2onGiKGxxe+rQr1IwO1NBiz7KkWtb7TCVu7tjw4y7/ +HJqD7xLVooOOaFk2jqP04bQC4VCQUcgWnpuk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=sIi0PdBlBABDgOPhGLypN1ZxA5BNNAoQrERJE3/tSJ/gJJl+JoMCcgGVJjxOUAG/0x mYpiL+cw0+M2EsEwgqmK9bLuv46mQkJ8bDR5ws1koyR2nS5BoXbozTvpnYcwrUunPkLG 1vsjM58qbFKmRR83FH8DFycaH8IqVwQ5hd1So= Received: by 10.220.195.77 with SMTP id eb13mr722286vcb.251.1307707933076; Fri, 10 Jun 2011 05:12:13 -0700 (PDT) MIME-Version: 1.0 Sender: doctorrock83@gmail.com Received: by 10.220.190.194 with HTTP; Fri, 10 Jun 2011 05:11:33 -0700 (PDT) Date: Fri, 10 Jun 2011 14:11:33 +0200 X-Google-Sender-Auth: X9nXu71w-1qAqhyj2RpFniBdwzo Message-ID: To: PHP internals list Content-Type: text/plain; charset=ISO-8859-1 Subject: set_http_response_code() to PHP5.4 ? From: jpauli@php.net (Julien Pauli) Hey, I've seen Kalle's patch for http://bugs.php.net/bug.php?id=52555. It actually implements a http_response_code() function to export the current HTTP response code from SAPI layer to PHP user land. I'm suggesting to rename that function to get_http_response_code(), and implement its sister : set_http_response_code(). Something like that should make it : PHP_FUNCTION(set_http_response_code) { long code; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code) == FAILURE) return; sapi_header_op(SAPI_HEADER_SET_STATUS, &code TSRMLS_CC); RETURN_TRUE; } That would help changing the http response code. Actually, that can only be done in weird ways, like Julien