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

Комментарии • 18

  • @TheCodeholic
    @TheCodeholic  4 года назад +5

    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.

    • @TheCodeholic
      @TheCodeholic  4 года назад

      @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

    • @TheCodeholic
      @TheCodeholic  4 года назад

      @Fames Id I removed that $previousDate variable. It was not used anymore.

    • @sekhniashvili
      @sekhniashvili 4 года назад

      @@TheCodeholic test

  • @danutz0501
    @danutz0501 4 года назад +1

    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

  • @thepentesterdiariestv5988
    @thepentesterdiariestv5988 3 года назад +1

    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

  • @naresh2232463
    @naresh2232463 4 года назад +2

    This is cool

  • @codedaophp
    @codedaophp Год назад

    Tuyệt vời

  • @Coznix_
    @Coznix_ Год назад

    clearstatcache(clear_realpath_cache:false, $path); this is giving me an error

  • @naresh2232463
    @naresh2232463 4 года назад

    Anything on date time functions ? As I have searched on the internet for this particular topic and have not found much .

    • @TheCodeholic
      @TheCodeholic  4 года назад

      What do you mean on date time functions?

  • @lashalomidze964
    @lashalomidze964 4 года назад

    Loved it! Won't it have bottlenecks, because of the sleep call though? Any optimization ways?

    • @TheCodeholic
      @TheCodeholic  4 года назад +4

      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.

    • @Amilakasun1
      @Amilakasun1 3 года назад

      @@TheCodeholic Can you go for hash comparisons?

  • @winnergain578
    @winnergain578 2 года назад

    Can you make a video on how to make a
    file manager using php.

  • @ahmedatya6226
    @ahmedatya6226 4 года назад

    how i can create console script ,

    • @TheCodeholic
      @TheCodeholic  4 года назад +1

      You can run any php file from console, by running php filename.php

    • @ahmedatya6226
      @ahmedatya6226 4 года назад

      @@TheCodeholic sorry but where this console