PHP

CURL_PROGRESSFUNCTION patch

The patch has been merged into PHP > 5.3.0 RC2.

A patch against the PHP_5_3 sources from CVS that adds the possibility to define a callback function to display CURL up/download progress: php_curl_progress_callback.patch (Updated 2009-04-28, thanks to Tobias Kemmer and Renato Braga for the comments).

php_curl.dll with the libcurl.dll, libeay32.dll and libss32.dll dependencies; linked against php5ts.dll, php_curl_nts.dll linked against php5.dll 5.2.6 (It also works with PHP 5.2.9). Includes libcurl 7.19.4 binaries: php_curl_progress-5.2.9.zip

php_curl.dll with the libcurl.dll, libeay32.dll and libss32.dll dependencies; linked against php5ts.dll, php_curl_nts.dll linked against php5.dll 5.2.6 (It also works with PHP 5.2.7): php_curl_progress-5.2.6.zip

php_curl.dll with the libcurl.dll, libeay32.dll and libss32.dll dependencies; linked against php5ts.dll 5.2.5: php_curl_progress-5.2.5.zip

php_curl.dll with the libcurl.dll, libeay32.dll and libssl32.dll dependencies; linked against php5ts.dll 5.2.4: php_curl_progress-5.2.4.zip

php_curl.dll with the libcurl.dll, libeay32.dll and libssl32.dll dependencies; linked against php5ts.dll 5.2.2: php_curl_progress-5.2.2.zip (Note: No upload progress!)

php_curl.dll with the libcurl.dll, libeay32.dll and libssl32.dll dependencies; linked against php5ts.dll 5.1.6: php_curl_progress-5.1.6.zip (Note: No upload progress!)

PHP Bug #41712 tracks if/when the patch will be integrated in the main PHP sources.

PHP example code that illustrates how to use the patched extension:

$ch = curl_init("http://www.php.net");
$fp = fopen("index.html", "w");

/**
 * If this function is executed, the patch was successfully applied.
 * Note that this test script is just using $b.
 */
function curl_progress_callback($a=0, $b=0, $c=0, $d=0) {
	echo "curl_progress_callback($a,$b,$c,$d)\n";
}

curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_NOPROGRESS, false);
curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, 'curl_progress_callback');
curl_exec($ch);
echo curl_close($ch);
fclose($fp);

Arabic PDF generation in PHP

This is a small example that illustrates how to generate Arabic PDF documents using PHP, Zend Framework 1.5 or higher and PostArabic.

I'm planning to further simplify the Arabic PDF generation using a PHP extension or PHP code that provides the shaping functionality.

To start experimenting yourself, just download arabic_pdf_zend_postarabic.zip and follow the instructions in the README file.

Foto von Leif K-Brooks

Tags