Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


The network- and cURL class is an independent class library that handles network related things. The cURL library especially, has special features, like parsing data received from the body. For example, calling an URL that returns json strings, you'll get an object back that you could handle immediately, instead of parsing the data yourself.

Instantiation is being done by running a simple $CURL = new \TorneLIB\Tornevall_cURL();

If the curl library is missing (we are checking that curl_init() exists) an exception will be thrown as the instantiation is in progress. In early versions of the library an exception are thrown as soon as the library file gets loaded, which might stop a site completely.

The cURL class

We are with the cURL class in a quite verbose mode, to get the most out of the web request you are doing. The response are separated in an array as follows