CURLOPT_GET is not a PHP constant
Sooner or later someone's going run into this notice error:
Use of undefined constant CURLOPT_GET - assumed 'CURLOPT_GET'. Probably you downloaded a PHP class or a function written by someone else from the Web. Right?
Well, no matter how you ended up with that notice, let's try to analyze the problem and the solution.
Take a look at the example code:
curl_setopt($ch, CURLOPT_GET, true);
We can safely assume that it's trying to set the HTTP request type to GET. I have no idea if PHP once used to support it or not but CURLOPT_GET is indeed a non-existent PHP constant. Confirm it yourself here. So the probability is that the constant is a result of PHP code from the stone age or a customized PHP environment or from a coder who assumed there would be CURLOPT_GET, just as there is CURLOPT_POST, but did not care to debug the code properly. None of which we are interested in as long as we have a solution to the notice error.
The solution is you just comment out that code. Because CURL request by default is GET, you don't have to set any options to make a GET CURL request.
The nearest CURL option which looks like is CURLOPT_GET is CURLOPT_HTTPGET, which you might not need to use at all in the first place. CURLOPT_HTTPGET is used to reset the HTTP request method if you had set it to anything but GET.
In my opinion this mysterious CURL option was created by a PHP developer who assumed the existence of CURLOPT_GET based on CURLOPT_POST - and had the error reporting level set to hide notice errors. Always keep you error reporting level to E_ALL | E_STRICT - especially in your development environment.