Aug 27 2008

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.

Warning

This post is over 6 months old. This means that, despite my best intentions, it may no longer be accurate. Age, motherhood, experience, loss... these things have all changed me from when this blog was started back in the heady (ha) days of my youth.

As much as I would like to go back and edit 10 years of archives to provide an insight into the 'me' of now — to update coding snippets and revise website advice — it would probably take years to do so (by which point I'd have to start again!) This would defeat the point of keeping these archives anyway.

Please take these posts for what they are: a brief look into my past, my history, my journey.

7 Responses so far
  1. Emsz says: August 27, 2008 at 9:53 pm # ·

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

  2. Rich says: August 27, 2008 at 10:26 pm # ·

    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. Nyx says: August 27, 2008 at 11:18 pm # ·

    Woot NinjaLinks!

  4. Aisling says: August 28, 2008 at 12:53 am # ·

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

  5. Jem says: August 28, 2008 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. Louise says: August 28, 2008 at 9:22 am # ·

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

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

  7. Carly says: August 28, 2008 at 5:33 pm # ·

    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!