$fh = tmpfile(); if (! $fh ) { $tmp = tempnam( HABARI_PATH . '/user/cache', 'RR' ); if ( ! $tmp ) { return Error::raise( _t( ' %s: CURL Error. Unable to create temporary file name.', array( __CLASS__ ) ), E_USER_WARNING ); } $fh = fopen( $tmp, 'wb' ); if ( ! $fh ) { return Error::raise( _t( ' %s: CURL Error. Unable to open temporary file.', array( __CLASS__ ) ), E_USER_WARNING ); } }