You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simon Sprankel provided [a screenshot of the PHPStorm settings](https://github.com/davidalger/warden/issues/258#issuecomment-723576699) on how the command can be run automatically.
25
25
26
26
However, there are a couple of common issues that can arrise when working
27
-
with a virtualized environment in regards to the `cache-clean.js` watcher.
27
+
with a virtualized environment in regard to the `cache-clean.js` watcher.
28
28
29
29
For example, when the node based watcher is run in a different container than
30
30
PHP based Magento, the file system path to the Magento directory might be
@@ -85,9 +85,9 @@ The script assumes it is run in a Magento base directory, or the Magento
@@ -22,7 +22,7 @@ First, the file with the exported functions needs to be included.
22
22
Assuming the package is installed as a Magento development composer dependency, and the current working directory is that Magento base dir, the functions can be imported into the global namespace via:
The tool is commonly installed globally using `composer global require ...`.
@@ -50,13 +48,12 @@ For example:
50
48
```shell
51
49
vendor/bin/cache-clean.js config full_page
52
50
```
53
-
(It's quicker because the startup time of `bin/magento` is so slow.)
51
+
(It's quicker because the start-up time of `bin/magento` is so slow.)
54
52
55
53
There are several options to customize the behavior:
56
54
57
55
```
58
56
vendor/bin/cache-clean.js --help
59
-
Sponsored by https://www.mage2.tv
60
57
61
58
Usage: cache-clean.js [options and flags] [cache-types...]
62
59
Clean the given cache types. If none are given, clean all cache types.
@@ -73,9 +70,8 @@ Clean the given cache types. If none are given, clean all cache types.
73
70
--help|-h This help message
74
71
```
75
72
76
-
Usually I run the command once with the `--watch` switch when I start
77
-
development, and when I make a change that isn't automatically detected (yet),
78
-
I run `vendor/bin/cache-clean.js` with the given cache types as a drop in
73
+
Usually I run the command once with the `--watch` switch (or `-w`) when I start development, and when I make a change
74
+
that isn't automatically detected (yet), I run `vendor/bin/cache-clean.js` with the given cache types as a drop in
79
75
replacement for `bin/magento cache:clean`.
80
76
81
77
### Hotkeys
@@ -104,17 +100,16 @@ Use the `--keep-generated` switch if you want files in `generated/code` to remai
104
100
105
101
### Prerequisites:
106
102
107
-
*`node.js` (built on 10, but should work with older 8.x versions, too).
108
-
* It probably is a good idea to turn on all Magento caches
109
-
`bin/magento cache:enable` to get the full benefit.
103
+
*`node.js` (built on 18, but should work with older 10.x versions, too).
104
+
* It's a good idea to turn on all Magento caches `bin/magento cache:enable` to get the full benefit.
110
105
111
106
112
107
## Known issues
113
108
114
109
* Currently, the watcher has to be restarted after a new theme is added, so it
115
110
is added to the watchlist.
116
111
117
-
* Changes to files on NFS mounts (e.g. in vagrant) do not trigger the watches.
112
+
* Changes to files on NFS mounts (e.g. in vagrant) do **not** trigger the watches.
118
113
Depending on a given setup, it might be possible to run the watcher on the
119
114
host system instead.
120
115
@@ -141,31 +136,29 @@ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo s
141
136
142
137
## More information
143
138
144
-
* Some words on using the watcher with [Docker & VMs](https://github.com/mage2tv/magento-cache-clean/blob/master/doc/docker-and-vm.md).
139
+
* Some words on using the watcher with [Docker & VMs](https://github.com/mage-os/magento-cache-clean/blob/main/doc/docker-and-vm.md).
145
140
146
-
*[Running the watcher from code](https://github.com/mage2tv/magento-cache-clean/blob/master/doc/using-via-code.md).
141
+
*[Running the watcher from code](https://github.com/mage-os/magento-cache-clean/blob/main/doc/using-via-code.md).
147
142
148
-
* The [rationale](https://github.com/mage2tv/magento-cache-clean/blob/master/doc/rationale.md) explains the reasons I wrote the utility.
143
+
* The [rationale](https://github.com/mage-os/magento-cache-clean/blob/main/doc/rationale.md) explains the reasons I wrote the utility.
149
144
150
-
* How to [build](https://github.com/mage2tv/magento-cache-clean/blob/master/doc/building.md) the tool from source.
145
+
* How to [build](https://github.com/mage-os/magento-cache-clean/blob/main/doc/building.md) the tool from source.
151
146
152
-
*Integrating the watcher with PHPStorm:
153
-
*[Mage2 TV][How to set up the watcher as a PHPStorm startup task](https://www.mage2.tv/content/fundamentals/magento-cli-tool/configuring-the-magento-cache-clean.js-utility-phpstorm-startup-task/).
154
-
*[Mage2 TV][How to enable the hotkeys in PHPStorm](https://www.mage2.tv/content/fundamentals/magento-cli-tool/enabling-the-hotkeys-for-the-cache-clean.js-utility-in-phpstorm/).
147
+
*This package used to be called `mage2tv/magento-cache-clean`, but now it is part of Mage-OS, and thus the package name
148
+
is `mage-os/magento-cache-clean`. The original package still works as it now is an empty wrapper that requires this
149
+
package. Existing installations should continue to work.
155
150
156
151
## Thanks
157
152
158
153
This script was inspired by [Timon de Groot](https://twitter.com/TimonGreat)'s
159
-
[blog post](https://blog.timpack.org/speed-up-magento-development) where he
160
-
describes the idea to use a file watcher in PHPStorm to call `redis-cli` to
161
-
clear the complete cache whenever a XML file is modified.
162
-
The only downside of that solution is that it always flushes the full cache and
163
-
only works with redis.
154
+
[blog post](https://blog.timpack.org/speed-up-magento-development) where he describes the idea to use a file watcher in
155
+
PHPStorm to call `redis-cli` to clear the complete cache whenever a XML file is modified.
156
+
The only downside of that solution is that it always flushes the full cache and only works with redis.
164
157
165
-
Thank you also to everybody who gave feedback, shared ideas and helped test new
166
-
features! This tool would be impossible without you!
158
+
Thank you also to everybody who gave feedback, shared ideas and helped test new features! This tool would be impossible
159
+
without you!
167
160
168
161
## Copyright & License
169
162
170
163
Copyright 2019 - present by Vinai Kopp, distributed under the BSD-3-Clause license (see
171
-
the [LICENSE](https://github.com/mage2tv/magento-cache-clean/blob/master/LICENSE) file).
164
+
the [LICENSE](https://github.com/mage-os/magento-cache-clean/blob/main/LICENSE) file).
0 commit comments