You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The flag LOCK_EX can only be used if the file is within local filesystem (the file wrapper must start with file://). Other than that, PHP will throw a warning message Exclusive locks may only be set for regular files as defined in its source code file.c.
So if anyone tries to save the models to other file wrappers such as http:// or ftp://, it will not success too.
The text was updated successfully, but these errors were encountered:
The reason for the LOCK_EX i.e. exclusive lock is to prevent another process from writing to the file at the same time a model is being saved for example. This is an edge case for many people, but may come into play for some.
What if we made locking an argument of the constructor instead of hardcoding it to on? Would that solve the problem in your case?
Hi there. First of all I'd like to thank you for this library as I have been playing with it to learn Machine Learning for quite some time.
So today I wanted to save the models to a PHAR file, I tried this:
Then I got the Exception message Could not write to the filesystem. The reason is because of this line in the file
Persisters/Filesystem.php
:$success = file_put_contents($this->path, $encoding->data(), LOCK_EX);
The flag LOCK_EX can only be used if the file is within local filesystem (the file wrapper must start with
file://
). Other than that, PHP will throw a warning message Exclusive locks may only be set for regular files as defined in its source code file.c.So if anyone tries to save the models to other file wrappers such as
http://
orftp://
, it will not success too.The text was updated successfully, but these errors were encountered: