Currently bootstrap_js_alter() calls file_scan_directory() on each page load. Granted if JS/page caching is enabled, this is less of deal. However, it would be better to create a helper function named _bootstrap_file_scan_directory(). This helper function will wrap file_scan_directory() and cache the results in {cache} with the cid of theme_registry:bootstrap:files.

Comments

markhalliwell’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Assigned: Unassigned » ryan.armstrong

Committed bf2d372 to 7.x-3.x:

Issue #2216767 by Mark Carver: Create _bootstrap_file_scan_directory() helper function to cache results.

This will need to be refactored for 8.x APIs.

markhalliwell’s picture

Category: Bug report » Feature request
Status: Active » Needs review

  • Commit bf2d372 on 7.x-3.x, 8.x-3.x by Mark Carver:
    Issue #2216767 by Mark Carver: Create _bootstrap_file_scan_directory()...

  • Mark Carver committed bf2d372 on 8.x-3.x.x
    Issue #2216767 by Mark Carver: Create _bootstrap_file_scan_directory()...
markhalliwell’s picture

Version: 8.x-3.x-dev » 7.x-3.x-dev
Assigned: ryan.armstrong » Unassigned
Status: Needs review » Closed (fixed)

I'm just moving this back to 7.x. If this needs re-evaluation in 8.x, create a new issue.