Is there a possibility to periodically check a directory for changes (file added) in CakePHP?
If a new file appears in this directory I would like to get its name.
Is there a possibility to periodically check a directory for changes (file added) in CakePHP?
If a new file appears in this directory I would like to get its name.
There's no built in function in cakephp to archive this.
periodically: php scripts are usually fired by request and not cyclic - to do so you can use a simple cron or some advanced jobserver like gearman(https://github.com/davidsteinsland/cakephp-gearman)
check a directory for changes:Php is not the perfect language to do stuff like this but if you really want to you can do so, by using a solution proposed here: Is there a way to detect changes in a folder using php on both windows and linux?
The better option would be to take a more suited language and only post the findings to some php script(if at all). A cyclic execution for other languages can also be scheduled via some cronjob, a more powerful job server, or dependent on the language on build in scheduling functions.