2

The class I wish to use is: https://github.com/philsturgeon/codeigniter-curl/blob/master/libraries/Curl.php

How can I use this in a Wordpress project? Do I just take out the code igniter specific snippets out?

2 Answers 2

2

Also you need remove log_message() function calls and codeIgniter get_instance() call

Summary.. remove lines 233-238

    // If no a protocol in URL, assume its a CI link
    if ( ! preg_match('!^\w+://! i', $url))
    {
        $this->_ci->load->helper('url');
        $url = site_url($url);
    }

line 31-32

$this->_ci =& get_instance();
log_message('debug', 'cURL Class Initialized');

and line 36

log_message('error', 'cURL Class - PHP was not built with cURL enabled. Rebuild PHP with --with-curl to use cURL.') ;
Sign up to request clarification or add additional context in comments.

Comments

1

It looks like the class uses codeigniter's url helper. So, you would have to take a look at this:

http://codeigniter.com/user_guide/helpers/url_helper.html

And re-factor the class in the places where those functions are used. For instance, line 237 of your class uses the codeigniter site_url function.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.