Skip to content

[2.x] Mysqli redesign #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Tests/Mysqli/MysqliStatementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function testStatementPreparesManyArrayValues()
{
$query = 'SELECT * FROM dbtest WHERE id IN (:preparedArray1,:preparedArray2,:preparedArray3,:preparedArray4,:preparedArray5,:preparedArray6,:preparedArray7,:preparedArray8,:preparedArray9,:preparedArray10)';

new MysqliStatement(static::$connection->getConnection(), $query);
new MysqliStatement(static::$connection->getConnection()->stmt_init(), $query);
}

/**
Expand All @@ -95,7 +95,7 @@ public function testStatementWithKeysMatching()
{
$query = 'SELECT * FROM dbtest WHERE `id` = :id AND `title` = :id_title';

new MysqliStatement(static::$connection->getConnection(), $query);
new MysqliStatement(static::$connection->getConnection()->stmt_init(), $query);
}

/**
Expand All @@ -108,6 +108,6 @@ public function testStatementWithMultipleUseOfVars()
{
$query = 'SELECT * FROM `dbtest` WHERE `description` LIKE :search_term AND `title` LIKE :search_term';

new MysqliStatement(static::$connection->getConnection(), $query);
new MysqliStatement(static::$connection->getConnection()->stmt_init(), $query);
}
}
4 changes: 2 additions & 2 deletions src/DatabaseDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,8 @@ protected function getAlterDbCharacterSet($dbName)
/**
* Return the query string to create new Database.
*
* @param stdClass $options Object used to pass user and database name to database driver. This object must have "db_name" and "db_user" set.
* @param boolean $utf True if the database supports the UTF-8 character set.
* @param \stdClass $options Object used to pass user and database name to database driver. This object must have "db_name" and "db_user" set.
* @param boolean $utf True if the database supports the UTF-8 character set.
*
* @return string The query that creates database
*
Expand Down
17 changes: 8 additions & 9 deletions src/DatabaseInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,12 @@ public function getCollation();
public function getConnection();

/**
* Method to get the database connection collation, as reported by the driver.
* Method to get the database connection collation in use by sampling a text field of a table in the database.
*
* If the connector doesn't support reporting this value please return an empty string.
*
* @return string
* @return string|boolean The collation in use by the database connection (string) or boolean false if not supported.
*
* @since 2.0.0
* @throws \RuntimeException
*/
public function getConnectionCollation();

Expand Down Expand Up @@ -256,16 +255,16 @@ public function getServerType();
public function getTableColumns($table, $typeOnly = true);

/**
* Retrieves field information about the given tables.
* Get the details list of keys for a table.
*
* @param mixed $tables A table name or a list of table names.
* @param string $table The name of the table.
*
* @return array
* @return array An array of the column specification for the table.
*
* @since 2.0.0
* @throws \RuntimeException
*/
public function getTableKeys($tables);
public function getTableKeys($table);

/**
* Method to get an array of all tables in the database.
Expand Down Expand Up @@ -450,7 +449,7 @@ public function lockTable($tableName);
* @param array|string $text A string or an array of strings to quote.
* @param boolean $escape True (default) to escape the string, false to leave it unchanged.
*
* @return string
* @return string|array
*
* @since 2.0.0
*/
Expand Down
2 changes: 1 addition & 1 deletion src/DatabaseQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ abstract class DatabaseQuery implements QueryInterface
/**
* The query object.
*
* @var Query\DatabaseQuery
* @var DatabaseQuery
* @since 2.0.0
*/
protected $querySet;
Expand Down
4 changes: 2 additions & 2 deletions src/Mysql/MysqlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ public function isConnectionEncryptionSupported(): bool
/**
* Return the query string to create new Database.
*
* @param stdClass $options Object used to pass user and database name to database driver. This object must have "db_name" and "db_user" set.
* @param boolean $utf True if the database supports the UTF-8 character set.
* @param \stdClass $options Object used to pass user and database name to database driver. This object must have "db_name" and "db_user" set.
* @param boolean $utf True if the database supports the UTF-8 character set.
*
* @return string The query that creates database
*
Expand Down
Loading