File Flags.php

     1: <?php
     2: /*
     3:
     4: MIT License
     5: Copyright 2013-2019 Zordius Chen. All Rights Reserved.
     6: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
     7: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
     8: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     9:
    10: Origin: https://github.com/zordius/lightncandy
    11: */
    12:
    13: /**
    14:  * file to keep LightnCandy flags
    15:  *
    16:  * @package    LightnCandy
    17:  * @author     Zordius <zordius@gmail.com>
    18:  */
    19:
    20: namespace LightnCandy;
    21:
    22: /**
    23:  * LightnCandy class to keep flag consts
    24:  */
    25: class Flags
    26: {
    27:     // Compile time error handling flags
    28:     const FLAG_ERROR_LOG = 1;
    29:     const FLAG_ERROR_EXCEPTION = 2;
    30:
    31:     // JavaScript compatibility
    32:     const FLAG_JSTRUE = 8;
    33:     const FLAG_JSOBJECT = 16;
    34:     const FLAG_JSLENGTH = 33554432;
    35:
    36:     // Handlebars.js compatibility
    37:     const FLAG_THIS = 32;
    38:     const FLAG_PARENT = 128;
    39:     const FLAG_HBESCAPE = 256;
    40:     const FLAG_ADVARNAME = 512;
    41:     const FLAG_NAMEDARG = 2048;
    42:     const FLAG_SPVARS = 4096;
    43:     const FLAG_PREVENTINDENT = 131072;
    44:     const FLAG_SLASH = 8388608;
    45:     const FLAG_ELSE = 16777216;
    46:     const FLAG_RAWBLOCK = 134217728;
    47:     const FLAG_HANDLEBARSLAMBDA = 268435456;
    48:     const FLAG_PARTIALNEWCONTEXT = 536870912;
    49:     const FLAG_IGNORESTANDALONE = 1073741824;
    50:     const FLAG_STRINGPARAMS = 2147483648;
    51:     const FLAG_KNOWNHELPERSONLY = 4294967296;
    52:
    53:     // PHP behavior flags
    54:     const FLAG_STANDALONEPHP = 4;
    55:     const FLAG_EXTHELPER = 8192;
    56:     const FLAG_ECHO = 16384;
    57:     const FLAG_PROPERTY = 32768;
    58:     const FLAG_METHOD = 65536;
    59:     const FLAG_RUNTIMEPARTIAL = 1048576;
    60:     const FLAG_NOESCAPE = 67108864;
    61:
    62:     // Mustache compatibility
    63:     const FLAG_MUSTACHELOOKUP = 262144;
    64:     const FLAG_ERROR_SKIPPARTIAL = 4194304;
    65:     const FLAG_MUSTACHELAMBDA = 2097152;
    66:     const FLAG_NOHBHELPERS = 64;
    67:     const FLAG_MUSTACHESECTION = 8589934592;
    68:
    69:     // Template rendering time debug flags
    70:     const FLAG_RENDER_DEBUG = 524288;
    71:
    72:     // alias flags
    73:     const FLAG_BESTPERFORMANCE = 16388; // FLAG_ECHO + FLAG_STANDALONEPHP
    74:     const FLAG_JS = 33554456; // FLAG_JSTRUE + FLAG_JSOBJECT + FLAG_JSLENGTH
    75:     const FLAG_INSTANCE = 98304; // FLAG_PROPERTY + FLAG_METHOD
    76:     const FLAG_MUSTACHE = 8597536856; // FLAG_ERROR_SKIPPARTIAL + FLAG_MUSTACHELOOKUP + FLAG_MUSTACHELAMBDA + FLAG_NOHBHELPERS + FLAG_MUSTACHESECTION + FLAG_RUNTIMEPARTIAL + FLAG_JSTRUE + FLAG_JSOBJECT
    77:     const FLAG_HANDLEBARS = 159390624; // FLAG_THIS + FLAG_PARENT + FLAG_HBESCAPE + FLAG_ADVARNAME + FLAG_SPACECTL + FLAG_NAMEDARG + FLAG_SPVARS + FLAG_SLASH + FLAG_ELSE + FLAG_RAWBLOCK
    78:     const FLAG_HANDLEBARSJS = 192945080; // FLAG_JS + FLAG_HANDLEBARS
    79:     const FLAG_HANDLEBARSJS_FULL = 429235128; // FLAG_HANDLEBARSJS + FLAG_INSTANCE + FLAG_RUNTIMEPARTIAL + FLAG_MUSTACHELOOKUP
    80: }
    81: