PHP Watch files and directories recursively
HTML-код
- Опубликовано: 10 сен 2024
- I have created small but useful script using PHP which watches file and directory changes.
Project Link - (Give it a ★)
github.com/the...
Check my Github:
github.com/the...
Follow me on social media:
/ thecodeholic
/ thecodeholic
That script should be run as a separate process, maybe in background to watch file changes and do some actions.
I have also tested on folder which has several thousands of files and it detects changes pretty fast.
It can be optimized in terms of how it can be used.
Any optimization ideas will be gladly accepted.
@Fames Id You need to run the following script in your terminal `php index.php FILE_OR_FOLDER_PATH` ans specify you `localhost/somefoldertocheck` folder path
@Fames Id I removed that $previousDate variable. It was not used anymore.
@@TheCodeholic test
really nice, gave me a great idea to make one myself, some composer some sass compilers and stuff and I don't need to install node js anymore, love the channel man and keep up the good work
I made a script in php for the integrity of my system, the script iterate through under all directores and files specified of my system but that doesnt work how I need, the integrity files is equal in my database but when the hashes send to my database, the files path send without / and the results is different. I need help you
This is cool
Tuyệt vời
clearstatcache(clear_realpath_cache:false, $path); this is giving me an error
Anything on date time functions ? As I have searched on the internet for this particular topic and have not found much .
What do you mean on date time functions?
Loved it! Won't it have bottlenecks, because of the sleep call though? Any optimization ways?
That script should be run as a separate process, maybe in background to watch file changes and do some actions.
I don't think it needs any optimization right now. I have also tested on folder which has several thousands of files and it detects changes pretty fast.
It can be optimized in terms of usability. Maybe create a separate class with possible arguments, maximum number of files to keep track, watching interval and some other stuff.
Any optimization ideas will be gladly accepted.
@@TheCodeholic Can you go for hash comparisons?
Can you make a video on how to make a
file manager using php.
how i can create console script ,
You can run any php file from console, by running php filename.php
@@TheCodeholic sorry but where this console