cURL to bypass allow_url_fopen off

One of the requested features for NinjaLinks was to allow users to specify a link button that will be used to link back to a site instead of / as well as normal text. As the button will be hosted on a remote server, I was thinking of using cURL to bypass allow_url_fopen restrictions. (Yes, button WILL be ran through as many security/validity checks as is humanely possible.)

However, I then wondered which is faster, and whether I should in fact use cURL as standard and only fall back on the various fopen/etc functions if cURL is off? Mat/Rich/Dee etc.. looking at you guys here :P

I’ve no idea why I left this specific part until nearly the very end of the script, I guess it seemed a good idea at the time.

7 Comments

  1. Is it bad that I have no idea what you’re talking about? :/

  2. It depends which version of PHP this is aimed at. If it’s 4 then personally I’d use cURL first, fopen second. If you are walking in php5 land then I’d use fopen + the stream functions, as the control you have over your streams now is superb, and the enhanced HTTP/HTTPS protocol wrappers are wonderful to play with. Note the IIS HTTPS warnings on php < 4.3.7 however.

  3. Woot NinjaLinks!

  4. It is my goal to be able to understand what you just wrote.

  5. Jem

    28 Aug at 8:01 am

    @Rich: NinjaLinks will be public so I’m hoping for compatibility with PHP 4.4.4 as a minimum really (or thereabouts; that’s the earliest I have for testing ;) )

    Thanks for your input! Much appreciated.

  6. Hehe. I was about to ask about NinjaLinks’ progress.

    I’m in a PHP class this semester! :)

  7. Yes well you need the thing with the thing and the other one with a function here and a function there pver and under turn around touch your nose and press the red one. Curl, curl curly wurly!