PHPDocumentParser icon indicating copy to clipboard operation
PHPDocumentParser copied to clipboard

[Fix] parseFromString now use sys temp dir for temp file

Open vladdnepr opened this issue 6 years ago • 3 comments

vladdnepr avatar Oct 24 '19 08:10 vladdnepr

@vladdnepr Hi - thanks for the update. It looks simple enough, but I'm concerned about the inconsistencies with tmp directories across distros and PHP versions.

What platforms and PHP versions have you tested this on? and then I'll test on other versions

LukeMadhanga avatar Oct 24 '19 09:10 LukeMadhanga

Hi. I think it os-independent.

https://www.php.net/manual/en/function.sys-get-temp-dir.php

Old variant was worse, because its write to "temp/*.tmp" and it doesnt cool. In my case your library throw error "Warning: file_put_contents(temp/157190871333e658512ba2c1aba0afe0a6c1dff20c550eca93.tmp): failed to open stream: No such file or directory".

$ uname -a Linux 4.15.0-62-generic #69-Ubuntu SMP Wed Sep 4 20:55:53 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux $ php -v PHP 7.2.19-0ubuntu0.18.04.2 (cli) (built: Aug 12 2019 19:34:28) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.19-0ubuntu0.18.04.2, Copyright (c) 1999-2018, by Zend Technologies with Xdebug v2.7.2, Copyright (c) 2002-2019, by Derick Rethans with blackfire v1.27.0~linux-x64-non_zts72, https://blackfire.io, by Blackfire

vladdnepr avatar Oct 24 '19 09:10 vladdnepr

Ok - I'll test and then I'll merge in. Thanks

LukeMadhanga avatar Oct 24 '19 10:10 LukeMadhanga