gboudreau / nest-api

Unofficial Nest Learning Thermostat API
GNU Lesser General Public License v3.0
299 stars 92 forks source link

cache file permissions #48

Closed rossking closed 7 years ago

rossking commented 9 years ago

This API has a Quirk

When I use on web based pages and they run under www-data it works

When I run a PHP script from command line it fails with the error below

PHP Warning: file_put_contents(/tmp/nest_php_cache_09255254939caa89971804d1bd030996): failed to open stream: Permission denied in /var/www/Support/class/nest.class.php on line 637

If I sudo rm the files in that dir then the script works fine as local PHp run.

But then the web version breaks

again once I delete temp files it works again.

The files are being created and access permssions on files is just for the one use they were created under.

Any ideas how to make these files less restrictive, or another idea preface them with user name and it just creates a set for each user it runs under.

I found a workaround abd forked and set pull request look at and comment if you think best way to fix or is there a better way.

My fork does solve issue for me