I have two processes running in different scripts indepdent of each other.
- PHP #1 script reads the filename of a file and writes it to a DB
- PHP #2 script uploads the file
I would like to create a third script (also independent) that only executes once script #2 has fully completed uploading the file.
I'm thinking of using PHP's flock function to determine if the file is locked. I imagine script #3 would need to contain some sort of flock check function that was set on a timer to check to see if the file was unlocked, and if so to proceed.
Note: script #3 would know the filename to perfom the check
Any ideas? It would be a lot easier if the files could be chained, but they execute indepently.