Jump to content

Recommended Posts

В старой simpla 1.4 на шаблоне default в коде страницы в конце выводится какой то лог.

Как можно убрать эти данные (тестер ругается на sql запрос в теле страницы)?

 

view-source:http://detsad-yar.ru/   со строчки 327

 

 

 

<!--   1.    3.71932983398E-5 sec   SET NAMES utf8       2.    0.000168085098267 sec   SELECT name, value FROM settings       3.    0.000118970870972 sec   SELECT currency_id, name, sign, code, rate_from, rate_to, main, def FROM currencies ORDER BY currency_id       4.    0.000454902648926 sec   SELECT * FROM categories WHERE enabled=1 ORDER BY parent, order_num       5.    0.000257968902588 sec   SELECT * FROM sections WHERE enabled=1 AND menu_id=2 ORDER BY order_num       6.    0.000224113464355 sec   SELECT *, DATE_FORMAT(date, '%d.%m.%Y') as date FROM news WHERE enabled=1 ORDER BY news.date DESC LIMIT 5       7.    0.000123977661133 sec   SELECT * FROM articles WHERE enabled=1 ORDER BY order_num DESC LIMIT 5       8.    8.08238983154E-5 sec   SELECT * FROM brands ORDER BY name       9.    0.000200986862183 sec   SELECT sections.section_id as section_id, modules.module_id, modules.class, sections.url, sections.body, sections.header, sections.module_id, sections.meta_title, sections.meta_description, sections.meta_keywords FROM sections LEFT JOIN modules ON sections.module_id=modules.module_id WHERE sections.url='cat' limit 1       10.    0.000868082046509 sec   SELECT                   products.product_id, products.url, products.category_id, products.brand_id, products.model, products.description, products.body, products.hit, products.order_num, products.small_image, products.large_image, DATE_FORMAT(products.created, '%Y-%m-%d') as created, DATE_FORMAT(products.modified, '%Y-%m-%d') as modified, products.enabled,                   brands.name as brand, brands.url as brand_url,                   categories.single_name as category, categories.url as category_url, categories.image as category_image                   FROM products LEFT JOIN categories ON categories.category_id = products.category_id                   LEFT JOIN brands ON products.brand_id = brands.brand_id                   LEFT JOIN products_categories ON products.product_id = products_categories.product_id                   WHERE                   categories.enabled=1                   and products.enabled=1                                        AND products.hit = 1                   GROUP BY products.product_id                   ORDER BY products.order_num desc                          memory peak usage: 1709080 bytes   page generation time: 0.0186619758606 seconds   sql queries time: 0.00253510475159 seconds   php run time: 0.016126871109 seconds   -->

 

 

 

 

 

Link to post
Share on other sites

Noxter спасибо за ответ! 

 

Что бы удалить отладочную информацию необходимо удалить из /index.php следующий код.

 

if($site->config->debug)
{
    print "<!--\r\n";
    $i = 0;
    $sql_time = 0;
    foreach($site->db->queries as $q)
    {
        $i++;
        print "$i.\t$q->exec_time sec\r\n$q->sql\r\n\r\n";
        $sql_time += $q->exec_time;
    }
  
    $time_end = microtime(true);
    $exec_time = $time_end-$time_start;
  
      if(function_exists('memory_get_peak_usage'))
        print "memory peak usage: ".memory_get_peak_usage()." bytes\r\n";  
    print "page generation time: ".$exec_time." seconds\r\n";  
    print "sql queries time: ".$sql_time." seconds\r\n";  
    print "php run time: ".($exec_time-$sql_time)." seconds\r\n";  
    print "-->";
}
Link to post
Share on other sites

Очень полезная возможность за наблюдением выполнения запросов к БД  в версии 1.4. Напрасно убрали в следующих версиях. Сейчас на главной странице сайта Simpla сказано "на большинстве страниц магазина используется не более десяти SQL-запросов", что совершенно не соответствует действительности на версии 2. Если бы чаще явно бросались в глаза нерациональности работы с БД, глядишь, быстрее бы и исправили ляпы...

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...