@@ -44,17 +44,23 @@ discard block |
||
| 44 | 44 | * Initialize Document Parsing |
| 45 | 45 | * ----------------------------- |
| 46 | 46 | */ |
| 47 | -if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
|
| 47 | +if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) { |
|
| 48 | + $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
|
| 49 | +} |
|
| 48 | 50 | |
| 49 | 51 | $base_path = str_replace('\\','/',dirname(__FILE__)) . '/'; |
| 50 | -if(is_file($base_path . 'assets/cache/siteManager.php')) |
|
| 52 | +if(is_file($base_path . 'assets/cache/siteManager.php')) { |
|
| 51 | 53 | include_once($base_path . 'assets/cache/siteManager.php'); |
| 52 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) |
|
| 54 | +} |
|
| 55 | +if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
| 53 | 56 | define('MGR_DIR', 'manager'); |
| 54 | -if(is_file($base_path . 'assets/cache/siteHostnames.php')) |
|
| 57 | +} |
|
| 58 | +if(is_file($base_path . 'assets/cache/siteHostnames.php')) { |
|
| 55 | 59 | include_once($base_path . 'assets/cache/siteHostnames.php'); |
| 56 | -if(!defined('MODX_SITE_HOSTNAMES')) |
|
| 60 | +} |
|
| 61 | +if(!defined('MODX_SITE_HOSTNAMES')) { |
|
| 57 | 62 | define('MODX_SITE_HOSTNAMES', ''); |
| 63 | +} |
|
| 58 | 64 | |
| 59 | 65 | // get start time |
| 60 | 66 | $mstart = memory_get_usage(); |
@@ -126,7 +132,7 @@ discard block |
||
| 126 | 132 | @ini_set("display_errors","0"); |
| 127 | 133 | } |
| 128 | 134 | |
| 129 | -if(MODX_CLI){ |
|
| 135 | +if(MODX_CLI) { |
|
| 130 | 136 | @set_time_limit(0); |
| 131 | 137 | @ini_set('max_execution_time',0); |
| 132 | 138 | } |
@@ -199,7 +199,8 @@ discard block |
||
| 199 | 199 | $c = substr($modifiers, 0, 1); |
| 200 | 200 | $modifiers = substr($modifiers, 1); |
| 201 | 201 | |
| 202 | - if ($c === ':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>= |
|
| 202 | + if ($c === ':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { |
|
| 203 | +// :=, :!=, :<=, :>=, :!<=, :!>= |
|
| 203 | 204 | $c = substr($modifiers, strlen($match[1]), 1); |
| 204 | 205 | $debuginfo = "#i=0 #c=[{$c}] #m=[{$modifiers}]"; |
| 205 | 206 | if ($c === '(') { |
@@ -215,7 +216,8 @@ discard block |
||
| 215 | 216 | $result[] = array('cmd' => trim($match[1]), 'opt' => $opt, 'debuginfo' => $debuginfo); |
| 216 | 217 | $cmd = ''; |
| 217 | 218 | } elseif (in_array($c, array('+', '-', '*', '/')) && preg_match('@^[0-9]+@', $modifiers, |
| 218 | - $match)) { // :+3, :-3, :*3 ... |
|
| 219 | + $match)) { |
|
| 220 | +// :+3, :-3, :*3 ... |
|
| 219 | 221 | $modifiers = substr($modifiers, strlen($match[0])); |
| 220 | 222 | $result[] = array('cmd' => 'math', 'opt' => '%s' . $c . $match[0]); |
| 221 | 223 | $cmd = ''; |