Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026

Diff for Metafox/lib/DB.php between version 1.5 and 1.6

version 1.5, 2017/06/09 15:05:06 version 1.6, 2024/11/20 15:48:03
Line 592  class DB
Line 592  class DB
      */       */
     public static function isError($value)      public static function isError($value)
     {      {
         return is_object($value) && is_a($value, 'DB_Error');          return is_object($value) && is_a($value, 'DB_Error');
     }      }
   
     // }}}      // }}}
Line 772  class DB
Line 772  class DB
             $parsed['dbsyntax'] = $str;              $parsed['dbsyntax'] = $str;
         }          }
   
         if (!count($dsn)) {          if (!strlen($dsn))
                   {
             return $parsed;              return $parsed;
         }          }
   
Line 865  class DB
Line 866  class DB
          * defined, and means that we deal with strings and array in the same           * defined, and means that we deal with strings and array in the same
          * manner. */           * manner. */
         $dsnArray = DB::parseDSN($dsn);          $dsnArray = DB::parseDSN($dsn);
   
         if ($hidePassword) {          if ($hidePassword) {
             $dsnArray['password'] = 'PASSWORD';              $dsnArray['password'] = 'PASSWORD';
         }          }
Line 875  class DB
Line 876  class DB
         if (is_string($dsn) && strpos($dsn, 'tcp') === false && $dsnArray['protocol'] == 'tcp') {          if (is_string($dsn) && strpos($dsn, 'tcp') === false && $dsnArray['protocol'] == 'tcp') {
             $dsnArray['protocol'] = false;              $dsnArray['protocol'] = false;
         }          }
   
         // Now we just have to construct the actual string. This is ugly.          // Now we just have to construct the actual string. This is ugly.
         $dsnString = $dsnArray['phptype'];          $dsnString = $dsnArray['phptype'];
         if ($dsnArray['dbsyntax']) {          if ($dsnArray['dbsyntax']) {
Line 898  class DB
Line 899  class DB
             $dsnString .= ':'.$dsnArray['port'];              $dsnString .= ':'.$dsnArray['port'];
         }          }
         $dsnString .= '/'.$dsnArray['database'];          $dsnString .= '/'.$dsnArray['database'];
   
         /* Option handling. Unfortunately, parseDSN simply places options into          /* Option handling. Unfortunately, parseDSN simply places options into
          * the top-level array, so we'll first get rid of the fields defined by           * the top-level array, so we'll first get rid of the fields defined by
          * DB and see what's left. */           * DB and see what's left. */
Line 925  class DB
Line 926  class DB
   
         return $dsnString;          return $dsnString;
     }      }
   
     // }}}      // }}}
 }  }
   

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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