Opened 10 years ago
Closed 7 years ago
#17340 closed enhancement (wontfix)
Mark up script-loader.php versions for programmatic updating
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
Whenever we update one of our dev CSS or JS files, we have to use YUI to re-minify them, and bump their version number in script-loader.php. The YUI part can be done programmatically, but it's not quite possible to bump the script-loader.php version numbers without manual intervention. If the number strings (yyyymmdd{optional-abcd suffix}) were marked up with PHP comments in a standardized way, we could automate that step as well.
Since any script would have the file name in hand, I propose the following:
/*#wp-admin/css/wp-admin.dev.css#wp-includes/css/fake.dev.css*/'20110203b'
That is, a PHP comment block that immediately starts with a hash (#) and is followed by one or more dev URLs that the version number applies to (multiple ones separated by another hash), and immediately followed by a version string enclosed in single quotes, in the format:
/'([0-9]{4})([0-9]{2})([0-9]{2})([a-z]?)'/
Change History (6)
#2
@
10 years ago
I don't get it.
It's a syntax to allow programmatic updating of the date strings, Ie. A script can update a CSS/JS resorce file, minify it, and update any version strings which the modified files apply to.
#3
@
10 years ago
Thanks, I guess I don't get the "version strings which the modified files apply to" bit.
#4
@
10 years ago
I guess I don't get the "version strings which the modified files apply to" bit.
Ah, Rather than processing the entire line to work out what file(s) it is, by relying upon the comment we gain a simpler processing script.. not only that, but I believe a few tinyMCE files rely on a few files to be built together to form the finalised package, so one change can affect a different "file"..
Ultimately, this will all depend on the scripts that utilise it, and given I don't know of any "in the wild", I know a few commitors do have similar scripts (And I'd say Mark has a SuperScript :))
I don't get it. :|