PHRETS icon indicating copy to clipboard operation
PHRETS copied to clipboard

ErrorException tempnam(): file created in the system's temporary directory

Open Jujunol opened this issue 7 years ago • 2 comments

Brief

Tried to fire up a small lumen server with this library but crashed on this error

Problem

The issue seems to be: tempnam('/tmp', 'phrets') in Session.php (line 484)

Why this is occurring

  • In PHP 7 they introduced a warning for when you call tempnam and it falls back to the system's temporary directory. More info here
  • In Lumen and Laravel, I believe that all notices/warnings are treated like errors to enforce better coding practices.

Stats

PHP: 7.1.1 Lumen: 5.5 OS: Windows 10 PHRETS: 2.4

Jujunol avatar Sep 30 '17 15:09 Jujunol

Is there any updates or progress on this?

zablockijj avatar Jun 21 '18 12:06 zablockijj

I agree that hard-coded paths do not belong in the library.

Replacing /tmp with a function call makes more sense, doesn't it?

'curl' => [ CURLOPT_COOKIEFILE => tempnam(sys_get_temp_dir(), 'phrets') ]

ConnectGrid avatar Aug 11 '20 00:08 ConnectGrid