$Title = $LangName . ' measurements'; $bannerUrl = CORE_SITE; $faqUrl = CORE_SITE . 'help.php'; // DATA //////////////////////////////////////////////// $Body->set('Data', LanguageData(DATA_PATH . 'ndata.csv', $Langs, $Incl, $Excl, $L)); $timeUsed = 'Elapsed secs'; if (SITE_NAME == 'gp4' || SITE_NAME == 'debian' || SITE_NAME == 'demo') { $timeUsed = 'CPU secs'; } // ABOUT //////////////////////////////////////////////// $About =& new Template(ABOUT_PATH); $AboutTemplateName = $L . SEPARATOR . 'about.tpl.php'; if (!file_exists(ABOUT_PATH . $AboutTemplateName)) { $AboutTemplateName = 'blank-about.tpl.php'; } $About->set('Version', HtmlFragment(VERSION_PATH . $L . SEPARATOR . 'version.php')); // META //////////////////////////////////////////////// $MetaKeywords = '<meta name="description" content="Performance measurements for all the ' . $LangName . ' programs implementing ~12 flawed benchmarks (' . PLATFORM_NAME . ')." />'; $metaRobots = '<meta name="robots" content="index,follow,noarchive" />'; if (SITE_NAME == 'gp4' || SITE_NAME == 'debian') { $metaRobots = '<meta name="robots" content="noindex,nofollow,noarchive" />'; } // TEMPLATE VARS //////////////////////////////////////////////// $Page->set('PageTitle', $Title . BAR . 'Computer Language Benchmarks Game'); $Page->set('BannerTitle', BANNER_TITLE); $Page->set('BannerUrl', $bannerUrl); $Page->set('FaqTitle', FAQ_TITLE); $Page->set('FaqUrl', $faqUrl); $Body->set('Tests', $Tests); $Body->set('Langs', $Langs); $Body->set('SelectedLang', $L);
if ($F == 'input') { $Title = $TestName . ' input file'; } elseif ($F == 'output') { $Title = $TestName . ' output file'; } elseif ($F == 'extra') { $Title = $TestName . ' file'; } else { $Title = $TestName; } $faqUrl = CORE_SITE . 'play.html'; $bannerUrl = CORE_SITE; // TEMPLATE VARS //////////////////////////////////////////////// $Page =& new Template(LIB_PATH); $Page->set('PageTitle', $Title . BAR . 'Computer Language Benchmarks Game'); $Page->set('BannerTitle', BANNER_TITLE); $Page->set('FaqTitle', FAQ_TITLE); $Page->set('BannerUrl', $bannerUrl); $Page->set('FaqUrl', $faqUrl); $Page->set('PageBody', BLANK); $Body =& new Template(LIB_PATH); $Body->set('Title', $Title); $Body->set('Download', DOWNLOAD_PATH . $T . SEPARATOR . $F . '.' . $E); $Body->set('Text', HtmlFragment(DOWNLOAD_PATH . $T . SEPARATOR . $F . '.' . $E)); $Page->set('PageBody', $Body->fetch('iofile.tpl.php')); $Page->set('Robots', '<meta name="robots" content="noindex,nofollow,noarchive" />'); $Page->set('MetaKeywords', ''); $Page->set('PageId', 'iofile'); echo $Page->fetch('page.tpl.php'); ?>
$Body =& new Template(LIB_PATH); $TemplateName = 'description.tpl.php'; // HEADER //////////////////////////////////////////////// $TestName = $Tests[$T][TEST_NAME]; $Title = $TestName . ' description (' . PLATFORM_NAME . ')'; // META //////////////////////////////////////////////// $keywords = '<meta name="description" content="What the ' . $TestName . ' benchmarks game programs should do (' . PLATFORM_NAME . ')." />'; $robots = '<meta name="robots" content="noindex,nofollow,noarchive">'; if (SITE_NAME != 'u64q') { $LinkRelCanonical = '<link rel="canonical" href="../u64q/' . $T . '-description.html">'; } $style = '<style><!-- a{color:black;text-decoration:none}article{padding: 0 0 2.9em}article,div,header{margin:auto;max-width:31em;width:92%}body{font:100% Droid Sans,Ubuntu,Verdana,sans-serif;margin:0;-webkit-text-size-adjust:100%}h1,h2,h3,nav li a{font-family:Ubuntu Mono,Consolas,Menlo,monospace}h1{font-size:1.4em;font-weight:bold;margin:0;padding:.4em}h1,h1 a{color:white}h2,h3{margin:1.5em 0 0}h2{font-size:1.4em;font-weight:normal}h3{font-size:1.2em}nav li{list-style-type:none;vertical-align:top}nav li a{display:block;font-size:1.2em;margin:.5em .5em 0;padding:.5em .5em .3em}nav p{margin:0 .5em}nav ul{clear:left;margin:-0.3em 0 1.5em;text-align:center}p{color:#333;line-height:1.4;margin:.3em 0 0}p a{border-bottom:.15em dotted #aaa}#u64,#u64q{background-color:#c90016}#u32{background-color:#ffb515}#u32q{background-color:#ff6309}@media only screen and (min-width:33em){nav li{display:inline-block}nav p{text-align:left;width:17em}}@media only screen and (min-width:60em){article,div,header{font-size:1.25em}} --></style>'; // TEMPLATE VARS //////////////////////////////////////////////// $Body->set('Description', HtmlFragment(DESC_PATH . $T . '-description.html')); $Body->set('SelectedTest', $T); $Body->set('Tests', $Tests); $Body->set('Title', $Title); $Page->set('Keywords', $keywords); if (isset($LinkRelCanonical)) { $Page->set('LinkCanonical', $LinkRelCanonical); } $Page->set('PageBody', $Body->fetch($TemplateName)); $Page->set('PageTitle', $Title . ' | Computer Language Benchmarks Game'); $Page->set('Robots', $robots); $Page->set('Style', $style); echo $Page->fetch('pageHTML5.tpl.php'); // 404 Not Found //////////////////////////////////////////////// } else { echo $Page->fetch('page404HTML5.tpl.php');
if ($Available) { $Body =& new Template(LIB_PATH); $TemplateName = 'program.tpl.php'; // HEADER //////////////////////////////////////////////// $TestName = $Tests[$T][TEST_NAME]; $LangName = $Langs[$L][LANG_FULL]; $IdName = $I > 1 ? ' #' . $I : ''; $Title = $TestName . ' ' . $LangName . $IdName . ' program'; $DescriptionURL = './' . $T . '-description.html#' . $T; // META //////////////////////////////////////////////// $keywords = ''; $robots = '<meta name="robots" content="noindex,follow,noarchive">'; $style = '<style><!-- a{color:black;text-decoration:none}article{padding: 0 0 2.9em}article,div,footer,header{margin:auto;width:92%}body{font:100% Droid Sans,Ubuntu,Verdana,sans-serif;margin:0;-webkit-text-size-adjust:100%}h1,h2,h3,li a{font-family:Ubuntu Mono,Consolas,Menlo,monospace}div,footer,header{max-width:31em}footer{padding:2.6em 0 0}h1{font-size:1.4em;font-weight:bold;margin:0;padding:.4em}h1,h1 a{color:white}h2,h3{margin:1.5em 0 0}h2{font-size:1.4em;font-weight:normal}h3{font-size:1.2em}li{list-style-type:none;vertical-align:top}li a{display:block;font-size:1.2em;margin:.5em .5em 0;padding:.5em .5em .3em}ul{clear:left;margin:-0.3em 0 1.5em;padding-left:0;text-align:center}p{color:#333;line-height:1.4;margin:.3em 0 0}p a,a span{border-bottom:.1em solid #333;padding-bottom:.1em}#u64,#u64q{background-color:#c90016}#u32{background-color:#ffb515}#u32q{background-color:#ff6309}.com,.slc{color:#888}.kwa{color:#066}.kwb{color:#900}.kwc{color:#050}.kwa,.kwb,.kwc{font-weight:bold}.dstr,.str,.sym,.num{color:#930}pre{color:#222;font-size:1em;overflow-wrap:break-word;white-space:pre-wrap;word-wrap:break-word}@media only screen and (min-width:60em){article,footer,header{font-size:1.25em}} --></style>'; // TEMPLATE VARS //////////////////////////////////////////////// $Page->set('PageTitle', $Title . ' | Computer Language Benchmarks Game'); $Body->set('Code', HtmlFragment(CODE_PATH . $T . '.' . $I . '.' . $L . '.code')); $Body->set('DescriptionURL', $DescriptionURL); $Body->set('Log', htmlspecialchars(HtmlFragment(CODE_PATH . $T . '.' . $I . '.' . $L . '.log'))); $Body->set('Title', $Title); $Body->set('Version', strip_tags(HtmlFragment(VERSION_PATH . $L . '-version.php'))); $Page->set('Keywords', $keywords); $Page->set('PageBody', $Body->fetch($TemplateName)); $Page->set('Robots', $robots); $Page->set('Style', $style); echo $Page->fetch('pageHTML5.tpl.php'); // 404 Not Found //////////////////////////////////////////////// } else { echo $Page->fetch('page404HTML5.tpl.php'); }
} else { // assume LANG_COMPARE is always available in every data set $L2 = $Langs[$L][LANG_COMPARE]; } // 200 OK //////////////////////////////////////////////// if ($Available) { $Body =& new Template(LIB_PATH); $TemplateName = 'compare.tpl.php'; // HEADER //////////////////////////////////////////////// $LangName = $Langs[$L][LANG_FULL]; $LangName2 = $Langs[$L2][LANG_FULL]; $Title = $LangName . ' vs ' . $LangName2 . ' (' . PLATFORM_NAME . ')'; // DATA //////////////////////////////////////////////// $Data = HeadToHeadData(DATA_PATH . 'ndata.csv', $Tests, $Langs, $Incl, $Excl, $L, $L2); $v = HtmlFragment(VERSION_PATH . $L . '-version.php'); $v2 = HtmlFragment(VERSION_PATH . $L2 . '-version.php'); // META //////////////////////////////////////////////// $keywords = '<meta name="description" content="' . $LangName . ' programs vs ' . $LangName2 . ' programs (performance on ' . PLATFORM_NAME . ')." />'; $canonicalPage = !(isset($LinkRelCanonical) && !empty($LinkRelCanonical)); if ($canonicalPage) { $robots = '<meta name="robots" content="index,follow,archive" />'; } else { $robots = '<meta name="robots" content="index,nofollow,noarchive">'; } $style = '<style><!-- a{color:black;text-decoration:none}article{padding: 0 0 2.9em}article,div,header{margin:auto;width:92%}body{font:100% Droid Sans,Ubuntu,Verdana,sans-serif;margin:0;-webkit-text-size-adjust:100%}h1,h2,h3,nav li a{font-family:Ubuntu Mono,Consolas,Menlo,monospace}div,header{max-width:31em}h1{font-size:1.4em;font-weight:bold;margin:0;padding:.4em}h1,h1 a{color:white}h2,h3{margin:1.5em 0 0}h2{font-size:1.4em;font-weight:normal}h3{font-size:1.2em}li{display:inline-block}nav li{list-style-type:none}nav li a{display:block;font-size:1.2em;margin:.5em .5em 0;padding:.5em .5em .3em}nav ul{clear:left;margin:-0.3em 0 1.5em;padding-left:0;text-align:center}p{color:#333;line-height:1.4;margin:.3em 0 0}p a,span{border-bottom:.1em solid #333;padding-bottom:.1em} #u64,#u64q{background-color:#c90016}#u32{background-color:#ffb515}#u32q{background-color:#ff6309}.best{font-weight:bold}.message{font-size:.8em}table{color:#333;margin:1.3em auto 0;text-align:right}tbody:after{content:"-";display:block;line-height:2.6em;visibility:hidden}tbody:last-child{text-align:left}td{border-bottom:.15em dotted #eee;padding:.7em 0 0 1em}td a,th a{display:block}td:first-child,th:first-child{text-align:left;padding-left:0}td:nth-child(6),th:nth-child(6){display:table-cell}th{font-weight:normal;padding:.7em 0 0 1em} @media only screen{th:nth-child(3),td:nth-child(3),th:nth-child(4),td:nth-child(4),th:nth-child(5),td:nth-child(5),th:nth-child(6),td:nth-child(6){display:none}}@media only screen and (min-width:28em){th:nth-child(3),td:nth-child(3),th:nth-child(4),td:nth-child(4),th:nth-child(5),td:nth-child(5){display:table-cell}}@media only screen and (min-width:41em){th:nth-child(6),td:nth-child(6){display:table-cell}}@media only screen and (min-width:60em){article,footer,header{font-size:1.25em}} --></style>'; // TEMPLATE VARS //////////////////////////////////////////////// $Body->set('Data', $Data);
} } } } // HEADER //////////////////////////////////////////////// $LangName = $Langs[$L][LANG_FULL]; $LangName2 = $Langs[$L2][LANG_FULL]; $Title = $LangName . ' vs ' . $LangName2; $bannerUrl = CORE_SITE; $faqUrl = CORE_SITE . 'play.php'; // DATA //////////////////////////////////////////////// $Data = HeadToHeadData(DATA_PATH . 'ndata.csv', $Tests, $Langs, $Incl, $Excl, $L, $L2); $timeUsed = 'Elapsed secs'; // ABOUT //////////////////////////////////////////////// $V = HtmlFragment(VERSION_PATH . $L . SEPARATOR . 'version.php'); $V2 = HtmlFragment(VERSION_PATH . $L2 . SEPARATOR . 'version.php'); // META //////////////////////////////////////////////// $MetaKeywords = '<meta name="description" content="' . $LangName . ' programs vs ' . $LangName2 . ' programs (' . PLATFORM_NAME . ')." />'; $metaRobots = '<meta name="robots" content="noindex,nofollow,noarchive" />'; // TEMPLATE VARS //////////////////////////////////////////////// $Page->set('PageTitle', $Title . BAR . 'Python Interpreters Benchmarks Game'); $Page->set('BannerTitle', BANNER_TITLE); $Page->set('BannerUrl', $bannerUrl); $Page->set('FaqTitle', FAQ_TITLE); $Page->set('FaqUrl', $faqUrl); $Body->set('Tests', $Tests); $Body->set('Langs', $Langs); $Body->set('SelectedLang', $L); $Body->set('SelectedLang2', $L2); $Body->set('Excl', $Excl); $Body->set('TimeUsed', $timeUsed);
$A .= $About->fetch($AboutTemplateName); } // META //////////////////////////////////////////////// $MetaKeywords = ''; $metaRobots = '<meta name="robots" content="noindex,nofollow,noarchive" />'; // TEMPLATE VARS //////////////////////////////////////////////// $Page->set('PageTitle', $Title . BAR . 'Computer Language Benchmarks Game'); $Page->set('BannerTitle', BANNER_TITLE); $Page->set('BannerUrl', $bannerUrl); $Page->set('FaqTitle', FAQ_TITLE); $Page->set('FaqUrl', $faqUrl); $Body->set('Tests', $Tests); $Body->set('SelectedTest', $T); $Body->set('Langs', $Langs); $Body->set('SelectedLang', $L); $Body->set('Excl', $Excl); $Body->set('Mark', $mark); $Body->set('TimeUsed', $timeUsed); $Body->set('Data', $Data); $Body->set('Code', HtmlFragment(CODE_PATH . $T . '.' . $I . '.' . $L . '.code')); $Body->set('Log', htmlspecialchars(HtmlFragment(LOG_PATH . $T . '.' . $I . '.' . $L . '.log'))); $Body->set('Id', $I); $Body->set('Title', $Title); $About->set('SelectedTest', $T); $About->set('SelectedLang', $L); $Body->set('About', $A); $Page->set('PageBody', $Body->fetch($TemplateName)); $Page->set('Robots', $metaRobots); $Page->set('MetaKeywords', $MetaKeywords); $Page->set('PageId', $PageId); echo $Page->fetch('page.tpl.php');