Skip to content
/ purl Public
forked from azayarni/purl

Simple cUrl PHP replacement library for hostings, which are not supporting native cUrl like Google App Engine

Notifications You must be signed in to change notification settings

cammytown/purl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

pUrl | PHP cUrl lib replacement

Some hosting providers such as Google App Engine (for security reasons) do not support PHP cUrl lib. So here is very simple replacement for the subset of cUrl base functionality written using PHP built in file stream handlers (file_get_contents, fopen). The library defines all the CURL constants and functions, but it does not support by far all the native cUrl features (e.g. curl_multi). However it is enough to use with Facebook SDK, Hybrid Auth and banch of other third party libraries, just try out if it works for you and let me know, if not:)

Supported Functions

  • curl_init
  • curl_copy_handle
  • curl_setopt (not supported options will be just ignored)
  • curl_setopt_array (same thing)
  • curl_errno (very little subset of native codes)
  • curl_error (u know...)
  • curl_close
  • curl_exec

** plans **

curl_getinfo() - at least some parameters could be returned cookie file handling should be implemented as well what else?

Using

  • Copy the library code to your project directory
  • Include the library main class, if curl is not supported
  • Make use of curl methods
    <?php
        if (!function_exists('curl_init')) {
            require_once 'path/to/Purl.php';
        }
        
        $ch = curl_init('http://www.example.com');

        // etc ...
    ?>

Not well tested yet, so please do not use for production;)

Have fun:)

About

Simple cUrl PHP replacement library for hostings, which are not supporting native cUrl like Google App Engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%