case 'ID': $variant['id'] = $xml->value; break; case 'KOD': // $variant[] = "['rozmiar'] = $this->sizes[$xml->value]; break; case 'EAN': $variant['ean'] = $xml->value; break; case 'KOLOR': $variant[] = ["name" => "kolor", "value" => "zielony"]; break; case 'ROZMIAR': $variant[] = ["name" => "rozmiar", "value" => "xxl"]; break; case 'ILOSC': $variant['quantity'] = $xml->value; break; } } if ($xml->nodeType == XMLReader::END_ELEMENT && $xml->name == 'WARIANT') { $variants[] = $variant; } if ($xml->nodeType == XMLReader::END_ELEMENT && $xml->name == 'WARIANTY') { return $variants; } } } } $start = new bench(); $start->run();
public static function clear() { self::$markers = array(); }
function getDebugInfo() { $out = "<div style='clear:both;border:1px solid blue;margin:5px;background:#d4d4d4;padding:3px;margin-left:10px;mergin-right:10px;color:#000;'>\n\t\t\t<div style='background:white;padding:3px;'>\n\t\t\t\t<div>\n\t\t\t\t\t<b>benchmarks:</b>\n\t\t\t\t\t<div style='margin:5px;background:#D9FFCE;'>"; foreach (bench::get_marks() as $m) { $out .= "<div>{$m}: " . bench::elapsed_ms($m) . " ms</div>"; } $out .= "<hr/>\n\t\t\t\t\t\t<div>peak memory: " . (int) (memory_get_peak_usage() / 1024) . " kb</div>\n\t\t\t\t\t\t<div>database reads: " . db::$query_count . " </div>\n\t\t\t\t\t\t<div>database writes: " . db::$query_count_w . " </div>\n\t\t\t\t\t\t<div>database read time: " . sprintf('%0.5f', db::$query_time * 1000) . " ms</div>\n\t\t\t\t\t\t<div>database write time: " . sprintf('%0.5f', db::$query_time_w * 1000) . " ms</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<b>database queries:</b>" . (QUERY_LIST ? '[query list enabled]' : '[query list DISABLED]') . "\n\t\t\t\t\t<div style='margin:5px;background:#D9FFCE;'>\n\t\t\t\t\t\t<pre>" . db::$query_list . "</pre>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<b>session data:</b>\n\t\t\t\t\t<div style='margin:5px;background:#D9FFCE;'>"; foreach (sessionCookie::$session as $k => $v) { $out .= "<div>{$k}: {$v}</div>"; } $out .= "</div>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<b>data log:</b>\n\t\t\t\t\t<div style='margin:5px;background:#D9FFCE;'>\n\t\t\t\t\t\t<pre>" . Data::getDataLog() . "</pre>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<b>view log:</b>\n\t\t\t\t\t<div style='margin:5px;background:#D9FFCE;'>\n\t\t\t\t\t\t<pre>" . solumView::getViewLog() . "</pre>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>"; return $out; }
<?php $t = microtime(true); require "solumConstants.php"; require "../config.php"; require "php/framework/kickstart.php"; bench::mark('core_time', $t); bench::end('core_time'); //------------------------------- bench::mark('app_time'); sessionCookie::init(); ///EXECUTE APPLICATION FRONT CONTROLLER/ROUTER HERE $default_vars = array('authenticated' => sessionCookie::$session['logged_in'], 'user' => sessionCookie::getUser()); $view = new solumView('master', $default_vars); $view->view(); bench::end('app_time'); //------------------------------- if (request::readConfig('debug')) { echo getDebugInfo(); }