Fix PHP backward compatibility for version <5.2.1

The function sys_get_temp_dir() did not exists before PHP 5.2.1, as this project should work for PHP>=5.0.0.