Your project should use dedicated PHP string functions

More information: https://insight.symfony.com/what-we-analyse/php.use_string_function

  1. // Also clear old embedding cache files from root cache directory (excluding embedding_search)
  2. $oldEmbeddingFiles = glob($generalCacheDir . 'embedding_*.cache');
  3. if ($oldEmbeddingFiles) {
  4. // Filter out embedding_search files
  5. $oldEmbeddingFiles = array_filter($oldEmbeddingFiles, function($file) {
  6. return strpos(basename($file), 'embedding_search_') !== 0;
    Consider replacing strpos() with str_starts_with() for improved readability.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by clicshopping
  7. });
  8. $cleared = 0;
  9. foreach ($oldEmbeddingFiles as $file) {
  10. if (unlink($file)) {
  • gyakutsuki

    not included