Letractively / add-mvc-framework

Automatically exported from code.google.com/p/add-mvc-framework
0 stars 0 forks source link

Failed connection doesn't trigger a serious error #130

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce the problem:
Connect with wrong credentials

expected output:
An exception page

actual output:
Just a PHP warning

Original issue reported on code.google.com by albertdi...@gmail.com on 20 Dec 2013 at 7:18

GoogleCodeExporter commented 9 years ago
I also think this is important

Original comment by albertdi...@gmail.com on 31 Jan 2014 at 3:58

GoogleCodeExporter commented 9 years ago
Must check add_adodb_* classes

Original comment by albertdi...@gmail.com on 24 Sep 2014 at 3:39

GoogleCodeExporter commented 9 years ago
{{{

   /**
    * Creates a single instance for the adodb class
    *
    */
   static function singleton() {
      $adodb = ADONewConnection(static::DB_TYPE);
      $global_varname = static::varname();

      if (
         !isset($GLOBALS[$global_varname])
         ||
            (
            isset($GLOBALS[$global_varname])
            &&
            !$GLOBALS[$global_varname] instanceof self
            )
         ) {
         $adodb_wrapper = $GLOBALS[$global_varname] = new static($adodb);
         if (!$adodb_wrapper -> Connect()) {
            throw new e_database("Failed to connect to the database",-1);
         }
         $adodb_wrapper -> adodb->SetFetchMode(static::FETCH_MODE);
      }

      return $GLOBALS[$global_varname];
   }
}}}

Testing needed

Original comment by albertdi...@gmail.com on 25 Sep 2014 at 2:00

GoogleCodeExporter commented 9 years ago

Original comment by albertdi...@gmail.com on 28 Jan 2015 at 2:34

GoogleCodeExporter commented 9 years ago

Original comment by albertdi...@gmail.com on 28 Jan 2015 at 5:09

GoogleCodeExporter commented 9 years ago
revision #1876

Original comment by albertdi...@gmail.com on 28 Jan 2015 at 5:14

GoogleCodeExporter commented 9 years ago
revision #1876

This revision relies on the developer returning adodb->Connect() on Connect()

Original comment by albertdi...@gmail.com on 28 Jan 2015 at 5:18