[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/administrator/includes/pcl/ -> pclerror.lib.php (source)

   1  <?php
   2  /**
   3  * @version $Id: pclerror.lib.php 49 2005-09-15 02:55:27Z rhuk $
   4  * @package Joomla
   5  */
   6  
   7  // no direct access
   8  defined( '_VALID_MOS' ) or die( 'Restricted access' );
   9  
  10  // --------------------------------------------------------------------------------
  11  // PhpConcept Library (PCL) Error 1.0
  12  // --------------------------------------------------------------------------------
  13  // License GNU/GPL - Vincent Blavet - Mars 2001
  14  // http://www.phpconcept.net & http://phpconcept.free.fr
  15  // --------------------------------------------------------------------------------
  16  // Fran�ais :
  17  //    La description de l'usage de la librairie PCL Error 1.0 n'est pas encore
  18  //    disponible. Celle-ci n'est pour le moment distribu�e qu'avec les
  19  //    d�veloppements applicatifs de PhpConcept.
  20  //    Une version ind�pendante sera bientot disponible sur http://www.phpconcept.net
  21  //
  22  // English :
  23  //    The PCL Error 1.0 library description is not available yet. This library is
  24  //    released only with PhpConcept application and libraries.
  25  //    An independant release will be soon available on http://www.phpconcept.net
  26  //
  27  // --------------------------------------------------------------------------------
  28  //
  29  //    * Avertissement :
  30  //
  31  //    Cette librairie a �t� cr��e de fa�on non professionnelle.
  32  //    Son usage est au risque et p�ril de celui qui l'utilise, en aucun cas l'auteur
  33  //    de ce code ne pourra �tre tenu pour responsable des �ventuels d�gats qu'il pourrait
  34  //    engendrer.
  35  //    Il est entendu cependant que l'auteur a r�alis� ce code par plaisir et n'y a
  36  //    cach� aucun virus, ni malveillance.
  37  //    Cette libairie est distribu�e sous la license GNU/GPL (http://www.gnu.org)
  38  //
  39  //    * Auteur :
  40  //
  41  //    Ce code a �t� �crit par Vincent Blavet (vincent@blavet.net) sur son temps
  42  //    de loisir.
  43  //
  44  // --------------------------------------------------------------------------------
  45  
  46  // ----- Look for double include
  47  if (!defined("PCLERROR_LIB"))
  48  {
  49    define( "PCLERROR_LIB", 1 );
  50  
  51    // ----- Version
  52    $g_pcl_error_version = "1.0";
  53  
  54    // ----- Internal variables
  55    // These values must only be change by PclError library functions
  56    $g_pcl_error_string = "";
  57    $g_pcl_error_code = 1;
  58  
  59  
  60    // --------------------------------------------------------------------------------
  61    // Function : PclErrorLog()
  62    // Description :
  63    // Parameters :
  64    // --------------------------------------------------------------------------------
  65    function PclErrorLog($p_error_code=0, $p_error_string="")
  66    {
  67      global $g_pcl_error_string;
  68      global $g_pcl_error_code;
  69  
  70      $g_pcl_error_code = $p_error_code;
  71      $g_pcl_error_string = $p_error_string;
  72  
  73    }
  74    // --------------------------------------------------------------------------------
  75  
  76    // --------------------------------------------------------------------------------
  77    // Function : PclErrorFatal()
  78    // Description :
  79    // Parameters :
  80    // --------------------------------------------------------------------------------
  81    function PclErrorFatal($p_file, $p_line, $p_error_string="")
  82    {
  83      global $g_pcl_error_string;
  84      global $g_pcl_error_code;
  85  
  86      $v_message =  "<html><body>";
  87      $v_message .= "<p align=center><font color=red bgcolor=white><b>PclError Library has detected a fatal error on file '$p_file', line $p_line</b></font></p>";
  88      $v_message .= "<p align=center><font color=red bgcolor=white><b>$p_error_string</b></font></p>";
  89      $v_message .= "</body></html>";
  90      die($v_message);
  91    }
  92    // --------------------------------------------------------------------------------
  93  
  94    // --------------------------------------------------------------------------------
  95    // Function : PclErrorReset()
  96    // Description :
  97    // Parameters :
  98    // --------------------------------------------------------------------------------
  99    function PclErrorReset()
 100    {
 101      global $g_pcl_error_string;
 102      global $g_pcl_error_code;
 103  
 104      $g_pcl_error_code = 1;
 105      $g_pcl_error_string = "";
 106    }
 107    // --------------------------------------------------------------------------------
 108  
 109    // --------------------------------------------------------------------------------
 110    // Function : PclErrorCode()
 111    // Description :
 112    // Parameters :
 113    // --------------------------------------------------------------------------------
 114    function PclErrorCode()
 115    {
 116      global $g_pcl_error_string;
 117      global $g_pcl_error_code;
 118  
 119      return($g_pcl_error_code);
 120    }
 121    // --------------------------------------------------------------------------------
 122  
 123    // --------------------------------------------------------------------------------
 124    // Function : PclErrorString()
 125    // Description :
 126    // Parameters :
 127    // --------------------------------------------------------------------------------
 128    function PclErrorString()
 129    {
 130      global $g_pcl_error_string;
 131      global $g_pcl_error_code;
 132  
 133      return($g_pcl_error_string." [code $g_pcl_error_code]");
 134    }
 135    // --------------------------------------------------------------------------------
 136  
 137  
 138  // ----- End of double include look
 139  }
 140  ?>


Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics