Phew... Finally done rewriting the logic for replace-type skins.
I added a dummy skin with just two files (index.member.css and sections.css), and here's how it was included:
Array
(
- => /Themes/default/skins/index.css
[1] => /Themes/default/skins/index.opera.css
[2] => /Themes/default/skins/index.member.css
[3] => /Themes/default/skins/Wutherings/index.member.css
[4] => /Themes/default/skins/Wutherings/sections.css
[5] => /Themes/default/skins/custom.css
[6] => /Themes/default/skins/custom.admin.css
)
The absolute perfect order.
Meaning you can easily manipulate ordering just by removing files in your replace skin or adding empty files, or choosing adequate suffixes.
Meanwhile, I've switched to makinge use of scandir(), and caching the results in a static array, although I'm disappointed by the lack of performance improvements with the caching... (Well, it probably works better on external files like editor.css, so I won't be removing it.)