This repository was archived by the owner on Aug 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed
Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -60,14 +60,33 @@ public function clearAllCachesCommand() {
6060 }
6161
6262 /**
63- * Clear system cache
63+ * Clear system cache.
6464 *
6565 * @return void
6666 */
6767 public function clearSystemCacheCommand () {
6868 $ this ->cacheApiService ->clearSystemCache ();
6969 $ this ->outputLine ('System cache has been cleared ' );
7070 }
71+
72+ /**
73+ * Clears the opcode cache.
74+ *
75+ * @param string|NULL $fileAbsPath The file as absolute path to be cleared
76+ * or NULL to clear completely.
77+ *
78+ * @return void
79+ */
80+ public function clearAllActiveOpcodeCacheCommand ($ fileAbsPath = NULL ) {
81+ $ this ->cacheApiService ->clearAllActiveOpcodeCache ($ fileAbsPath );
82+
83+ if ($ fileAbsPath !== NULL ) {
84+ $ this ->outputLine (sprintf ('The opcode cache for the file %s has been cleared ' , $ fileAbsPath ));
85+ } else {
86+ $ this ->outputLine ('The complete opcode cache has been cleared ' );
87+ }
88+ }
89+
7190 /**
7291 * Clear configuration cache (temp_CACHED_..).
7392 *
Original file line number Diff line number Diff line change @@ -117,6 +117,18 @@ public function clearSystemCache() {
117117 $ this ->dataHandler ->clear_cacheCmd ('system ' );
118118 }
119119
120+ /**
121+ * Clears the opcode cache.
122+ *
123+ * @param string|NULL $fileAbsPath The file as absolute path to be cleared
124+ * or NULL to clear completely.
125+ *
126+ * @return void
127+ */
128+ public function clearAllActiveOpcodeCache ($ fileAbsPath = NULL ) {
129+ $ this ->clearAllActiveOpcodeCacheWrapper ($ fileAbsPath );
130+ }
131+
120132 /**
121133 * Clear all caches except the page cache.
122134 * This is especially useful on big sites when you can't
@@ -143,4 +155,16 @@ public function clearAllExceptPageCache() {
143155
144156 return $ toBeFlushed ;
145157 }
158+
159+ /**
160+ * Clears the opcode cache. This just wraps the static call for testing purposes.
161+ *
162+ * @param string|NULL $fileAbsPath The file as absolute path to be cleared
163+ * or NULL to clear completely.
164+ *
165+ * @return void
166+ */
167+ protected function clearAllActiveOpcodeCacheWrapper ($ fileAbsPath ) {
168+ \TYPO3 \CMS \Core \Utility \OpcodeCacheUtility::clearAllActive ($ fileAbsPath );
169+ }
146170}
You can’t perform that action at this time.
0 commit comments