VisualAppeal/PHP-Auto-Update

Could not update `\update/../files/file1.php`, not writeable!

Closed this issue · 2 comments

Hello @VisualAppeal

First of all simple and great script.

While we were testing, we notice that if (!is_writable($this->installDir.$filename)) is called to check if the file is writable or not.

What is there is a case where a new files needs to be added, since the file is new then the check would fail and stop the script execution as it returns false.

Hope you are getting me...

Sorry for the late reply, something was wrong with my notifications...

Best practice would be to roll back all previous changes, but this class was made in one or two days to test some concepts. I don't think that I will implement something in this direction. Nevertheless pull requests are always welcomed.

Hello, I've got similar problem:

  • when the file needs to be overwritten it works fine
  • if it is a new file which not exists your script fails.

I've changed your code and have added a function to create missing files.
If it is ok please accept a Pull Request