Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Curl class exec multi

edited December 2016 in Share
I'm interested in trying out a multi session curl call, but I'm not clear how to do this with the Fuel curl class.

Can you provide an example?

Thanks!

Comments

  • edited 7:15PM
    If you add multiple sessions before executing, it will run it as a multi_session CURL:
    $this->load->library('curl'): $this->curl->add_session('http://www.getfuelcms.com'); $this->curl->add_session('http://docs.getfuelcms.com'); $results = $this->curl->exec();
    By default, the block_size is set to 5 which means it will run 5 CURL requests at a time.
    The $results will be an array of info from the CURL requests.
  • edited 7:15PM
    But these could be POSTs too?
  • edited 7:15PM
    There are second and third options that can be passed to add_session. The second parameter is where you can specify the type of CURL request and there is a shortcut of "post" you can use:
    $this->curl->add_session('http://www.getfuelcms.com', 'post');
  • edited 7:15PM
    I'm thinking of using POSTS to see if these can be used as "asynchronous" calls using exec_multi.
Sign In or Register to comment.