Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

[resources.invisionpower.com - pliki] Developer Articles > Hidden Gems: IPSDebug::fireBug


Rekomendowane odpowiedzi

  • Manager

Requirements:

FirePHP

Firebug

Firefox

IPB 3.0

A little hidden gem in IPB3 is the FirePHP API. What this does is allow anyone with firebug and FirePHP pluggin installed in their browser to put errors and information straight to their firebug console. This offers endless advantages to users such as outputting information when posting data, getting information when redirects are in use and getting information from ajax requests.

Before you can use this you must fire turn on IN_DEV mode in your config file, follow this article for information on how to accomplish this:

Enabling developer mode

After IN_DEV is enabled you will notice that IPB by default will start sending important information to your console. However surely you will want to add your own, to do this you simple need to call the FirePHP function which can be done via a static call from the IPSDebug class by simply doing:

IPSDebug::fireBug( $method, $output );

This will then send a message to your firebug console. There are four types of messages you can send which will give different priorities in your firebug console, this can help you differentiate what type of errors they are.

The four types of messages are: log, info, warn, error.

These will look like this in your firebug console:

SimpleConsole.png

To set the type of message you wish to output simple put the type in the $method parameter, e.g.

IPSDebug::fireBug( 'info', 'this is my custom message' );

You will find that firebug is a very powerful addition to your development process and has some endless possibilities. Below is a screenshot outlining some of the possibilities:

1213320522Wyświetl pełny artykuł

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.