Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Monday, November 23, 2026

Diff for phpWebLogAnalyzer/phpWebLogAnalyzer.inc.php between version 1.24 and 1.25

version 1.24, 2002/03/19 23:20:39 version 1.25, 2002/03/20 22:10:05
Line 42 
Line 42 
  *            - removed all errors and warnings in code (undefined keys   *            - removed all errors and warnings in code (undefined keys
  *              in arrays, bad eval() processing, etc.)   *              in arrays, bad eval() processing, etc.)
  * 19/03/2002 - use of PHP's substr() instead SQL's substring()   * 19/03/2002 - use of PHP's substr() instead SQL's substring()
    *            - private method _error() removed, PEAR error object is now
    *              returned on error
  */   */
   
 define('WEB_LOG_VALUE_SUBSTR_LENGTH', 255);  define('WEB_LOG_VALUE_SUBSTR_LENGTH',      255);
 define('WEB_LOG_SESSION_TIMEOUT_DEFAULT', 1800);  define('WEB_LOG_SESSION_TIMEOUT_DEFAULT', 1800);
 define('WEB_LOG_RAW_LOG_DEFAULT', 1);  define('WEB_LOG_RAW_LOG_DEFAULT',            1);
   
 /*  /*
  * Ident library   * Ident library
Line 446  class Web_Log {
Line 448  class Web_Log {
          *           *
          * Gets whole properties array.           * Gets whole properties array.
          */           */
         function getPropertyArray()  
           function getPropertiesArray()
         {          {
                 return $this->_props;                  return $this->_props;
         }          }
Line 472  class Web_Log {
Line 475  class Web_Log {
          * _error()           * _error()
          *           *
          * Error handling function. TODO: improve!           * Error handling function. TODO: improve!
          */           *
   
         function _error($message = "Unknown error") {          function _error($message = "Unknown error") {
                 die ("<b>phpWebLogAnalyzer fatal failure</b>: " . $message                  die ("<b>phpWebLogAnalyzer fatal failure</b>: " . $message
Line 481  class Web_Log {
Line 484  class Web_Log {
   
                 return false;                  return false;
         }          }
           */
   
         /*          /*
          * _checkDB()           * _checkDB()
Line 496  class Web_Log {
Line 500  class Web_Log {
                 }                  }
   
                 if (DB::isError($this->_db)) {                  if (DB::isError($this->_db)) {
                         $this->_error($this->_db->getMessage());                          return $this->_db;
                           //$this->_error($this->_db->getMessage());
                 }                  }
   
                 $this->_db->setFetchMode(DB_FETCHMODE_ASSOC);                  $this->_db->setFetchMode(DB_FETCHMODE_ASSOC);
Line 623  class Web_Log {
Line 628  class Web_Log {
                                                                 $this->_props[$prop_name]['table'],                                                                  $this->_props[$prop_name]['table'],
                                                                 $this->_props[$prop_name]['value']);                                                                  $this->_props[$prop_name]['value']);
   
                                                   if (DB::isError($id))
                                                           return $id;
   
                                                 if (intval($id))                                                  if (intval($id))
                                                         $this->_props[$prop_name]['id'] = $id;                                                          $this->_props[$prop_name]['id'] = $id;
                                         }                                          }
Line 642  class Web_Log {
Line 650  class Web_Log {
                 if (! $this->_props['session_id']['disabled']) {                  if (! $this->_props['session_id']['disabled']) {
                         $session_id = $this->_getSessionID();                          $session_id = $this->_getSessionID();
   
                           if (DB::isError($session_id))
                                   return $session_id;
   
                         if (intval($session_id))                          if (intval($session_id))
                                 $this->_props['session_id']['id'] =                                  $this->_props['session_id']['id'] =
                                         $this->_props['session_id']['value'] =                                          $this->_props['session_id']['value'] =
Line 707  class Web_Log {
Line 718  class Web_Log {
                 $result = $this->_db->query($query);                  $result = $this->_db->query($query);
   
                 if (DB::isError($result)) {                  if (DB::isError($result)) {
                         $this->_error($result->getMessage());                          return $result;
                           //$this->_error($result->getMessage());
                 }                  }
   
                 $this->_db->disconnect();                  $this->_db->disconnect();
Line 734  class Web_Log {
Line 746  class Web_Log {
                                 ."' limit 1"; // TODO: 'limit' is  MySQL dependent, or no?                                  ."' limit 1"; // TODO: 'limit' is  MySQL dependent, or no?
                         $id = $this->_db->getOne($query);                          $id = $this->_db->getOne($query);
   
                         if (DB::isError($id))                          if (DB::isError($id)) {
                                 $this->_error($id->getMessage());                                  return $id;
                                   //$this->_error($id->getMessage());
                           }
   
                         if ($id)                          if ($id)
                                 return $id;                                  return $id;
Line 772  class Web_Log {
Line 786  class Web_Log {
                                         /* This is an expected error. If it will be returned                                          /* This is an expected error. If it will be returned
                                            again we will count it seriously. */                                             again we will count it seriously. */
                                 }                                  }
                                 else                                  else {
                                         $this->_error($result->getMessage());                                          return $result;
                                           //$this->_error($result->getMessage());
                                   }
                         }                          }
                         else {                          else {
                                 /* No errors, insert succeed. */                                  /* No errors, insert succeed. */
Line 785  class Web_Log {
Line 801  class Web_Log {
                 $query = "select last_insert_id()";                  $query = "select last_insert_id()";
                 $id = $this->_db->getOne($query);                  $id = $this->_db->getOne($query);
   
                 if (DB::isError($id))                  if (DB::isError($id)) {
                         $this->_error($id->getMessage());                          return $id;
                           //$this->_error($id->getMessage());
                   }
   
                 if ($id)                  if ($id)
                         return $id;                          return $id;
Line 835  class Web_Log {
Line 853  class Web_Log {
                         ." limit 1";                          ." limit 1";
                 $row = $this->_db->getRow($query);                  $row = $this->_db->getRow($query);
   
                 if (DB::isError($row))                  if (DB::isError($row)) {
                         $this->_error($row->getMessage());                          return $row;
                           //$this->_error($row->getMessage());
                   }
   
                 if (is_array($row)                  if (is_array($row)
                                 && ($row['diff_sec'] < $this->_session_timeout)                                  && ($row['diff_sec'] < $this->_session_timeout)
Line 859  class Web_Log {
Line 879  class Web_Log {
                                 ." from $table";                                  ." from $table";
                         $id = $this->_db->getOne($query);                          $id = $this->_db->getOne($query);
   
                         if (DB::isError($id))                          if (DB::isError($id)) {
                                 $this->_error($id->getMessage());                                  return $id;
                                   //$this->_error($id->getMessage());
                           }
   
                         if ($id)                          if ($id)
                                 return $id;                                  return $id;
Line 920  class Web_Log {
Line 942  class Web_Log {
   
                 $count = $this->_db->getOne($query);                  $count = $this->_db->getOne($query);
   
                 if (DB::isError($count))                  if (DB::isError($count)) {
                         $this->_error($count->getMessage());                          return $count;
                           //$this->_error($count->getMessage());
                   }
   
                 if (isset($count))                  if (isset($count))
                         return $count;                          return $count;
Line 961  class Web_Log {
Line 985  class Web_Log {
   
                 $active_sessions = $this->_db->getCol($query);                  $active_sessions = $this->_db->getCol($query);
   
                 if (DB::isError($active_sessions))                  if (DB::isError($active_sessions)) {
                         $this->_error($active_sessions->getMessage());                          return $active_sessions;
                           //$this->_error($active_sessions->getMessage());
                   }
   
                 if ($this->_raw_log)                  if ($this->_raw_log)
                         $this->_cache_raw_log_active_sessions = $active_sessions;                          $this->_cache_raw_log_active_sessions = $active_sessions;

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top