RSS   Twitter   Copiny   Copiny
Нашел ошибку? 

Выдели фрагмент текста с ошибкой или неточностью и нажми Ctrl+Enter!

Почему нельзя использовать функцию die()?

Использовать для отладки функцию die() нельзя! Это может вызвать ряд ошибок в работе сайта. Joomla некоторые данные о пользователях и их сессиях хранит в базе данных MySQL, при самостоятельном завершении работы сайта, закрываются все соединения с базой данных, коректно завершается работа Framework'а. При использовании  функции die() вы сильно рискуете получить ошибки такого рода. 

 Warning: mysqli_query() [function.mysqli-query]:
 Couldn't fetch mysqli in C:\Apache2\htdocs\www_site\libraries\joomla\database\database\mysqli.php on line 147 

Либо

 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]:
 Access denied for user 'root'@'localhost' (using password: NO) in /var/www/html/libraries/joomla/database/database/mysql.php on line 105 

Для этого лучше использовать готовый метод close() глобального объекта $mainframe.

echo 'Тест';
$mainframe->close();
/*
    Или используйте:
    jexit();
*/
 

При разработке собственных компонентов, можете объявить собственный предварительный обработчик перед завершением работы фреймворка. Например так:

function stop($msg = '') {
    global $mainframe;
    echo $msg;
    $mainframe->close();
    /*
      Альтернатива:
      jexit($msg);
    */
}

Смотрите также:
Комментарии (7) Добавить комментарий
  • tinyurl.com
    tinyurl.com
    23 Ноября 2019, 16:46
     ↑  0  ↓     ответ

    I think that is one of the so much vital information for me.

    And i am satisfied studying your article. But wanna observation on some general

    things, The web site style is great, the articles is really excellent : D.

    Just right process, cheers

  • http://tinyurl.com/
    http://tinyurl.com/
    24 Ноября 2019, 22:33
     ↑  0  ↓     ответ

    Wow, that's what I was searching for, what a information! present here at this website, thanks admin of this

    site.

  • plenty of fish dating site
    plenty of fish dating site
    27 Ноября 2019, 01:55
     ↑  0  ↓     ответ

    Hi there! Quick question that's totally off topic. Do you know how to make

    your site mobile friendly? My website looks weird when browsing from my apple iphone.

    I'm trying to find a theme or plugin that might be able

    to correct this issue. If you have any recommendations, please share.

    With thanks!

  • g
    g
    15 Июня 2020, 19:45
     ↑  0  ↓     ответ

    Thanks for ones marvelous posting! I genuinely enjoyed reading it,

    you happen to be a great author. I will make certain to bookmark your blog and will eventually

    come back later on. I want to encourage one to continue your

    great writing, have a nice morning!

  • g
    g
    16 Июня 2020, 12:38
     ↑  0  ↓     ответ

    If you are going for finest contents like I do, just pay a quick visit this web site daily as it presents quality contents, thanks

  • g
    g
    17 Июня 2020, 03:27
     ↑  0  ↓     ответ

    If you wish for to improve your familiarity only keep visiting this site and be updated with the hottest news update posted here.

  • meilleur casino en ligne
    meilleur casino en ligne
    25 Мая 2025, 15:15
     ↑  0  ↓     ответ

    Hey! Do you know if they make any plugins to protect against hackers?

    I'm kinda paranoid about losing everything I've worked hard on.

    Any recommendations?

    meilleur casino en ligne

    You are so awesome! I don't suppose I've truly

    read a single thing like this before. So nice

    to discover another person with a few unique thoughts on this subject matter.

    Really.. many thanks for starting this up.

    This web site is one thing that's needed on the internet, someone with some originality!

    casino en ligne France

    Hey there! This post could not be written any better!

    Reading this post reminds me of my previous room mate! He always kept talking about this.

    I will forward this article to him. Fairly certain he will have a good

    read. Many thanks for sharing!

    casino en ligne francais

    I needed to thank you for this excellent read!! I certainly enjoyed every little

    bit of it. I have you bookmarked to look at new stuff you post…

    casino en ligne

    You've made some decent points there. I checked on the internet for

    more info about the issue and found most people will go along with your views on this website.

    casino en ligne

    Really when someone doesn't be aware of then its up to other visitors that they will

    assist, so here it happens.

    casino en ligne

    It's a pity you don't have a donate button! I'd definitely donate to this excellent blog!

    I guess for now i'll settle for book-marking and adding your RSS feed to

    my Google account. I look forward to fresh updates and

    will talk about this website with my Facebook group. Talk soon!

    casino en ligne

    These are in fact wonderful ideas in about blogging. You have touched some

    pleasant factors here. Any way keep up wrinting.

    casino en ligne

    Hi there! Someone in my Facebook group shared this website with

    us so I came to check it out. I'm definitely enjoying the information. I'm

    bookmarking and will be tweeting this to my followers!

    Great blog and fantastic style and design.

    casino en ligne

    Excellent post. I used to be checking constantly this blog and

    I'm inspired! Extremely helpful info specifically the last

    part :) I care for such info a lot. I used to be looking for this certain information for a long time.

    Thanks and good luck.

    casino en ligne France

Оставить комментарий




* обязательно для заполнения

1 введенный почтовый адрес используется только для обратной связи при ответах в комментариях и сервиса gravatar.com
.