Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcard paths not working properly for file watcher #962

Open
binaryfire opened this issue Nov 14, 2024 · 4 comments
Open

Wildcard paths not working properly for file watcher #962

binaryfire opened this issue Nov 14, 2024 · 4 comments

Comments

@binaryfire
Copy link

binaryfire commented Nov 14, 2024

Octane Version

2.5.9

Laravel Version

11

PHP Version

8.3

What server type are you using?

Swoole

Server Version

8.3

Database Driver & Version

No response

Description

Wildcard paths like config/**/*.php in the watch array of config/octane.php aren't working properly.

Steps To Reproduce

  1. Install chokidar
  2. Run octane:start --watch (I'm using Swoole)
  3. Modify a file in the config directory. Octane won't restart
  4. Change config/**/*.php to config in the watch array of config/octane.php
  5. Restart Octane server
  6. Modify a file in the config directory. Octane will now correctly restart

Same problem with anything else using wildcards eg. database (try modifying a seeder to test).

@crynobone
Copy link
Member

Shouldn't it be config/*.php?

@binaryfire
Copy link
Author

binaryfire commented Nov 18, 2024

@crynobone config/**/*.php is what's in the default config file:

'config/**/*.php',

But it should work either way. The ** pattern is supposed to match files in the root dir and all subdirs. It's probably more important for things like the public folder (public/**/*.php'). But as a side note, I seem to remember reading that config subdirectories are supported by the framework using dot notation.

The problem is reproducible with the default Octane config - you can test using any other directory in the array which uses ** in the path.

@binaryfire
Copy link
Author

@crynobone Yeah looks config subdirs are supported, so config/**/*.php is the correct expression: https://laracasts.com/discuss/channels/laravel/laravel-8-put-config-files-in-a-subdirectory-of-config

Copy link

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants