There is no reason(or bug) to respect TEMP on Linux or vice versa.

And I remember there is a bit different between tmp and tmpdir?my
On Apr 30, 2014 3:30 PM, "Michael Härtl" <notifications@github.com> wrote:

> In WkHtmlToPdf.php:
>
> > @@ -252,7 +252,16 @@ public function getError()
> >      public function getTmpDir()
> >      {
> >          if ($this->tmp===null) {
> > -            $this->tmp = sys_get_temp_dir();
> > +            if(function_exists('sys_get_temp_dir')){
> > +                $this->tmp = sys_get_temp_dir();
> > +            }else{
> > +                if($this->getIsWindows()){
> > +                    $this->tmp = getenv('TEMP');
> > +                }else{
> > +                    $this->tmp = getenv('TMPDIR') or $this->tmp='/tmp';
> > +                }
> > +                $this->tmp = realpath($this->tmp);
>
> Could we rewrite this a little?
>
> if (function_exists('sys_get_temp_dir')) {
>     $this->tmp = sys_get_temp_dir();} elseif ( ($tmp = getenv('TMP')) || ($tmp = getenv('TEMP')) || ($tmp = getenv('TMPDIR')) ) {
>     $this->tmp = realpath($tmp);} else {
>     $this->tmp = '/tmp';}
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mikehaertl/phpwkhtmltopdf/pull/45/files#r12131462>
> .
>