Empty Block

Constructor & Overrides


Primary Query Calls

  • Expect some stylesheets.css with: /cm/?cat=$properValue Expect some javascripts.js with: /cm/?mice=%proper.value --- Whitelisted parameters within OPT_ARGUMENT constant are the only ones that can go alongside cat or mice. Other, security and performance related parameters cannot have their values changed via _GET request, as those are responsible for the underlying CatMice behaviour and setup in general.


Default IICE Parameters

  • Immediately Invoked Class Expression

      new class (0, false, true, true, true, false, __DIR__); CatMice::LINE["10"]; 

    Caching Hours

    @1st: &hrs=INT; Predefined 'hrs' falls for $this-> hours 0 = nothing is going to be cached. 128 = One hundred and twenty eight hours for both js and css requests. Hint: Setting ZERO_HOUR_SKEPTIC to true would be a wise decision for the production servers.

    Source Squeeze

    @2nd: &sq=INT 0|1; Squeezing the content, yes or no. After removing all comments, all unnecesary white space will be wiped as well. Response will be a similar to uglified js file, but far more prettier. No vital part of the file will be touched and modified. 1, true -> remove ALL comments and white space bloat. 0, false -> do not modify collected source. ATTENTION! - Template literals. Keep in mind that template literals will get squashed as well. That means You need to reconsider whether You'll want Your .js requests that have multi-line text squeezed. Before You do, and want to have single-line file, You may want to use single/double quoted strings instead, or break the multi-line literals and concat them. That's shit, but it is the way it is. Also note that with sq=1 both `&c` and `&bc` will have no effect.

    Line Comments

    @3rd: &c=INT 0|1; 1, true -> leave single line comments alone 0, false -> removes single line comments WARNING strict rule! - Before You intend to remove js line comments with CatMice, You need to make sure that ALL OF YOUR .. // comment line text ... .. actually begin/look like this .. //~ comment line text ... .. or something like this (which is ugly and ... no. But, yes. Exists as option) .. //\* comment line text ... ~ (tilda) or \ (escape) as suffix character, right after //. Why torture ?!? In Javascript // is used for preg_pattern scope. There's also a scenario where base64 images have several of these ... ///// It is also used for http(s):// .. and finally as a line comment. One preg rule can solve that, however, it comes with a cost. And in systems like this one is, we need as less cost as possible - everywhere. By just placing one tilda character, after //, it is clearly distinguished what is what, therefore native PHP per-line substring can occur, which is, whether You want to believe or not way faster than any preg or pcre lookup. If this was about PHP files, native Tokenizer would work as breeze, but it isn't about PHP files. Be aware, tilda right after C-style line comment is nowadays a default comment line standard in many IDE's and syntax editors, and for a good reason. -- If You have many line comments without mentioned suffix within Your JS files, You still can cache and concat Your files, no problem, but don't try to use other than '&bc' (remove block-comments) runtime override. '&sq=1' (source_squeeze) for instance will cause HAVOC - 1010% guaranteed, unless this particular rule is applied.

    Block Comments

    @4th: &bc=INT 0|1; 1, true -> leave block comments alone 0, false -> remove all block comments This parameter is for both style and script requests, and has no special perks and gotchas. Block comments are awesome!

    Signature @ Bottom

    @5th: &s=INT 0|1; If 1, CatMice will attach block comment with the request signature details at the bottom of the generated source. Zero - prints nothing.

    Expand Externals

    @6th: &ex=INT 0|1; - Converts (suitable only) external resources to base64 string Suitable means any CSS rule that has url() with path to an image or font in it. If url path is not of local type and for some reason process fails but the link to it is valid, provided value will be returned - as is. Encoding will be silently discarded in that case. Read more about that here and here. In any other way, this option saves You from more additional requests, as external resources will be directly embeded into stylesheet as encoded string. Your page will recieve images and fonts directly from memory, but there's automatic trade-off as fetched file with this parameter will/might become INSANELY HUGE. For mobile or desktop applications, this is not a problem. But for public websites it is a completely different story if stylesheets are not cached, which is very rare. Even then, that very first load will be hard one to swallow for older client machines or users with slower connections, so You may want to be aware of that.

    Fallback Directory

    @7th: __DIR__ ; This value should remain __DIR__. It is compared against _SERVER['SCRIPT_FILENAME'] so that both real and `symlinked` catimce can work. If scenario where this parameter is other than __DIR__, CatMice script should not exist as symbolic link. That's one reason why this parameter is not of dynamic type. The second, and more important: this parameter requires absolute path. Slapping backend paths in public _GET variable was never encouraging practice.


File System

  • ™ Directory

      private const string TRADEMARK; CatMice::LINE["23"]; 

    Special "Trademark" directory name This is automatically generated directory name and it should hide behind a single character which is hardly reachable by an ordinary person on the other side. There can be three of them. - One in CatMice root directory with mime.types apache list inside. Serialized mime.types list as file is also, automatically created. - The other two are for scripts and stylesheets from their well known trademark brands. An example: - Source path like this: /cm/script/™/ace/ace.js - is fetched like this: /cm/?mice=`ace|ace -- Production Value: Any other than default `™` Development Value: depends

  • Directory Mask

      private const array DIRECTORY_MASK; CatMice::LINE["26"]; 

    Comment one and comment-out other line. Note that there MUST BE exactly two keys, always. Those are 'script' and 'style' Example: 'script' => 'js', 'style' => 'css', Whichever You put as value, such directory will be created via first run. And those directories will behave like defaults for `?cat=` and `?mice=` PRIMARY _GET variable names within url bar. Something like this: /cm/?mice=%ace.fly, will load (the DEFAULT) following: /cm/script/pot.ace/fly.js. And if default is as in example: /cm/js/pot.ace/fly.js. -- Production Value: Any reasonable for both Development Value: Any reasonable for both

Empty Block
Empty Block
Empty Block
Empty Block