php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #62990 cURL interface is not OOP
Submitted: 2012-09-02 01:42 UTC Modified: 2012-09-02 01:47 UTC
Votes:4
Avg. Score:4.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:2 (50.0%)
From: dicetrash at gmail dot com Assigned:
Status: Wont fix Package: cURL related
PHP Version: 5.4.6 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dicetrash at gmail dot com
New email:
PHP Version: OS:

 

 [2012-09-02 01:42 UTC] dicetrash at gmail dot com
Description:
------------
cURL like most of the php lib should be built with objects
this could be created by stdClass in php but feel as though it should be core.

Expected result:
----------------
Expected Interface
$result = cURL::createNew($url)
    ->setOpt(CURLOPT_RETURNTRANSFER, TRUE)
    ->setOpt(CURLOPT_HEADER, TRUE)
    ->exec();
unset($ch);

Actual result:
--------------
an implementation of curl looks like this
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-02 01:47 UTC] rasmus@php.net
-Status: Open +Status: Wont fix
 [2012-09-02 01:47 UTC] rasmus@php.net
There is already a Curl request object in the http extension. See 
http://php.net/http
 [2012-09-02 01:47 UTC] dicetrash at gmail dot com
I ment something that both exec and de-construct for the last few lines of expected
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 18:01:29 2024 UTC