Development

/branches/1.1/lib/database/sfMySQLiDatabase.class.php

You must first sign up to be able to contribute.

root/branches/1.1/lib/database/sfMySQLiDatabase.class.php

Revision 17858, 1.4 kB (checked in by FabianLange, 5 years ago)

[1.1, 1.2, 1.3] fixed some codeing standards (fixes #6376 - patch from gimler)

Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
6  * (c) 2004-2006 Sean Kerr <sean@code-box.org>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 /**
13  * sfMySQLiDatabase provides connectivity for the MySQL brand database.
14  * @see sfMySQLDatabase
15  */
16 class sfMySQLiDatabase extends sfMySQLDatabase
17 {
18
19   /**
20    * Returns the appropriate connect method.
21    *
22    * @param bool $persistent Whether persistent connections are use or not
23    *                         The MySQLi driver does not support persistent
24    *                         connections so this argument is ignored.
25    *
26    * @return string name of connect method
27    */
28   protected function getConnectMethod($persistent)
29   {
30     return 'mysqli_connect';
31   }
32
33   /**
34    * Selects the database to be used in this connection
35    *
36    * @param string $database Name of database to be connected
37    *
38    * @return bool true if this was successful
39    */
40   protected function selectDatabase($database)
41   {
42    return ($database != null && !@mysqli_select_db($this->connection, $database));
43   }
44
45   /**
46    * Execute the shutdown procedure
47    *
48    * @throws <b>sfDatabaseException</b> If an error occurs while shutting down this database
49    */
50   public function shutdown()
51   {
52     if ($this->connection != null)
53     {
54       @mysqli_close($this->connection);
55     }
56   }
57 }
58
Note: See TracBrowser for help on using the browser.