Empty Block

CatMice Query Dialect

  • Query Dialect QuickInfo

    $ DOLLAR - is chain reaction (all files within `chain.name`). % PERCENT - is for pot (all or few within `pot.name`) ` BACKTICK - is for trademarks ~ TILDA - is file/request delimiter | BAR - will become directory separator found within. . DOT - is for files in $dirlevel1 (catmice) - when default - no punctuation found at beginning, it means files in $dirlevel2 (catmice/script or catmice/style). - when ~~ DOUBLE TILDA found at beginning, it means Template Call. - one never puts extension at the end.


  • Query Dialect Verbose

    Before reading this section further, it is advisable to at least take a look at the test/run section, so that things below could make some sense. -- - You may want to open element inspector of Your choice and take a look at generated source code within <head> tag on the inspector tab for this very page. - Look for <link> tags with id attribute and <script> tags with async|defer attribute. Those have their href/src expressed in Catmice Query Dialect fashion. After ?cat= .. or ?mice= .. there's usually one special punctuation character before the rest of the query string .. and if no punctuation character is found, but simple extensionless basename of the file, (eg: /mc/?mice=highlight) file lookup is performed directly within script or style directory, meaning /cm/script/highlight.js.

    '$' for "chain reaction" ¯¯¯ $ is replacement for chain.something within /cm/script (or style), and it is called chain because it is meant to collect ALL files found within, via single request and it is literally - ALL - or none. It does not matter how many files are sitting inside the directory. What matters is that You have proper extension for each file and that You have clearly distinguished which one will be sorted first by prefixing Your files with (most logical) numbers, followed by the descriptive name. Example: query > /cm/?cat=$myTheme .. and /cm/style/chain.myTheme contents something like this .. . .. 0-0-fonts.css 0-1-theme.css 1-0-navigation.css 200-0-effects.css 1000-0-print.css ... ... and all files will be packed into one fat string. 100 files ? 100 files will be collected and concatenated one after another. Those that should go first, should have lower numbers. This function > natsort < is responsible for the ordered picking.

    '%' for "pile, stash or pot" ¯¯¯ It is a replacement for pot.something within /cm/script (or style). % or percent has almost the same purpose as chain does, with the exception of picking just one instead of collecting all files found within. Meaning, You can get entire collection of files in one shot, or simply just pick one (or two, using ~) from the pot. Example picking one file: query > /cm/?mice=%jsthing.fly will pick > /cm/script/pot.jsthing/fly.js Example picking one file in a pot subdirectory named sub: query > /cm/?mice=%jsthing.sub|fly will pick > /cm/script/pot.jsthing/sub/fly.js And if we need ALL files from particular jsthings pot, pretty much like with $chain .. .. the following query > /cm/?mice=%jsthings < will do that.

    '`' for "trademark" ¯¯¯ Backtick character is a replacement for trademark directory within sciprt or style directories. Its purpose is to clearly distinguish other well known free or paid libraries from Your own. Here is an example of pulling ace.js from trademark sub-directory: .. this > /cm/?mice=`ace|ace .. will pick this > /cm/script/™/ace/ace.js

    '~' as "request concatenator" ¯¯¯ Tilda or Tilde character purpose is to concatenate several folders (with a lots of files in each of them) into a single request or collection. Let's imagine that we have /style/chain.myTheme folder with 10 .css files inside, and one more /style/chain.someOtherGroup with 10 or more .css files inside. So instead of writing 20+ <link> tags in Your document head, this will do: /cm/?cat=$myTheme~$someOtherGroup Logically, one would want to employ _GET['sq'] .. even _GET['ex'] alongside sq perhaps ? .. so that outcome becomes ONE BIG FAT and exceptionally ugly pile of working css rules .. cached, offcourse. Something like this: /cm/?cat=$myTheme~$someOtherGroup&sq=1&ex=1&hrs=654321 That one single request will pull, lets say 20+ css files and concat them and before that will remove all block comments, will turn all continuous white-space characters into a single white-space character, will base64_encode all image and font paths found within url(..) and will cache that request for 654321 hours.

    '|' as "directory separator" ¯¯¯ Horizontal bar found within cat or mice request will be transformed into / character. Let's imagine that there is sub-sub-sub directory inside script directory and some important .js file inside. This is how it would look like: /cm/?mice=my|dir|within|dir|jsfile Or within trademark: /cm/?mice=`brokoli|pepper|tuna|shphagetti|jsfile Note that You can use original separator / instead of horizontal bar |. The thing is .. request looks prettier with | within query value. :)

    '.' for "root files" ¯¯¯ In many use case scenarios, one might need particular .css or .js file right from within catmice root directory. As mentioend already here and there the /cm directory it self, right beside main CatMice (index.php) file. So, in order to fetch some, lets say .js file from the root catmice directory, this should do: /cm/?mice=.highslide -> /cm/highslide.js .. as for few of them: /cm/?mice=.jquery~.highslide;

Empty Block
Empty Block
Empty Block
Empty Block