Yes, you can use curl inside cake console, but you need to make sure
you have it enabled - on some systems php cli has a different php.ini
file from the one that apache uses.

Cheers,
Adam

On Nov 10, 4:41 am, jjh <[EMAIL PROTECTED]> wrote:
> I tried to do the following inside my extended shell class. When I
> execute the script in cake console, it tells me "Fatal Error: Call to
> undefined function curl_init()". Anyone know if we can do curl inside
> shell? Thanks in advance.
>
> public function main() {
>       $ch = curl_init();
>       curl_setopt($ch, CURLOPT_URL, 'http://www.google.com');
>       curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
>       curl_setopt($ch, CURLOPT_TIMEOUT, 10);
>       curl_setopt($ch, CURLOPT_FAILONERROR, true);
>       $results = curl_exec($ch);
>       if (curl_errno($ch) != 0) {
>          $this->out("bad");
>       } else {
>          $this->out("good");
>       }
>       exit;
>
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to