require_once $_SERVER["DOCUMENT_ROOT"] . "/scriptacid/core/application.php"; SetTitle('Проект "ScriptACID CMF"'); App::page(function (&$arPageParams) { ?> <?php App::USER()->Authorize('1'); ?> <?php Bench::startTime(":catalog.section"); App::callComponent(":catalog.section", "", array("TYPE" => "orion_locations", "CATALOG_ID" => "3", "CACHE_OFF" => "Y", "COMPONENT_AJAX_MODE" => "N")); ?> <p>Время: <?php echo Bench::stopTime(":catalog.section"); ?> </p> <?php Bench::startTime(":catalog.element.add@_default"); App::callComponent(":catalog.element.add", "_default", array("COMPONENT_AJAX_MODE" => "N", "FIELDS" => array("ID", "ACTIVE", "NAME", "CATALOG_SECTION_ID", "CATALOG_ID", "SORT", "CODE", "PREVIEW_PICTURE", "PREVIEW_TEXT", "PREVIEW_TEXT_TYPE", "DETAIL_PICTURE", "DETAIL_TEXT", "DETAIL_TEXT_TYPE", "TAGS"), "TYPE" => "orion_locations", "CATALOG_ID" => "3", "ID" => '{%_GET[ID]}', "ACTION" => '{%_GET[ACTION]}', "LIST_URL" => "/test/test_ajax_component_call.php", "ELEMENT_URL" => "/test/test_ajax_component_call.php?ID=#ID#")); ?> <p>Время: <?php echo Bench::stopTime(":catalog.element.add@_default"); ?> </p> <?php }); // end makePage
<?php namespace ScriptAcid; require_once $_SERVER['DOCUMENT_ROOT'] . '/scriptacid/core/application.php'; App::page(function () { // Не знаю в чем прикол, но надо обязательно вызвать первый раз, что бы тесты не искажались. startBench('_this_need_for_correct_bench_at_first_call'); stopBench('_this_need_for_correct_bench_at_first_call'); Bench::startTime('_this_need_for_correct_bench_at_first_call'); Bench::stopTime('_this_need_for_correct_bench_at_first_call'); define('IF_DEFINE', true); define('FORCE_DEFINE', true); Bench::startTime('IF_DEFINE'); if (!defined('IF_DEFINE')) { define('IF_DEFINE', true); } d(Bench::stopTime('IF_DEFINE')); Bench::startTime('FORCE_DEFINE'); @define('FORCE_DEFINE', true); d(Bench::stopTime('FORCE_DEFINE')); ?> <?php }); // end of makePage