X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Flibs%2Frdbms%2Fdatabase%2FIMaintainableDatabase.php;h=18e3cbbc4600bf316bacc4ee5d1684aa4ca5d59e;hb=856c6769cd9502a0872c0f8db74ec0c43025ca27;hp=66012dae43f955d64a52806f861141aecf6e1f75;hpb=24ae22c2d274d83e74858eba02f493187d008197;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/database/IMaintainableDatabase.php b/includes/libs/rdbms/database/IMaintainableDatabase.php index 66012dae43..18e3cbbc46 100644 --- a/includes/libs/rdbms/database/IMaintainableDatabase.php +++ b/includes/libs/rdbms/database/IMaintainableDatabase.php @@ -62,8 +62,8 @@ interface IMaintainableDatabase extends IDatabase { * This is handy when you need to construct SQL for joins * * Example: - * extract( $dbr->tableNames( 'user', 'watchlist' ) ); - * $sql = "SELECT wl_namespace,wl_title FROM $watchlist,$user + * list( $user, $watchlist ) = $dbr->tableNames( 'user', 'watchlist' ) ); + * $sql = "SELECT wl_namespace, wl_title FROM $watchlist, $user * WHERE wl_user=user_id AND wl_user=$nameWithQuotes"; * * @return array @@ -275,6 +275,37 @@ interface IMaintainableDatabase extends IDatabase { * @since 1.29 */ public function unlockTables( $method ); + + /** + * List all tables on the database + * + * @param string $prefix Only show tables with this prefix, e.g. mw_ + * @param string $fname Calling function name + * @throws DBError + * @return array + */ + public function listTables( $prefix = null, $fname = __METHOD__ ); + + /** + * Determines if a given index is unique + * + * @param string $table + * @param string $index + * + * @return bool + */ + public function indexUnique( $table, $index ); + + /** + * mysql_fetch_field() wrapper + * Returns false if the field doesn't exist + * + * @param string $table Table name + * @param string $field Field name + * + * @return Field + */ + public function fieldInfo( $table, $field ); } class_alias( IMaintainableDatabase::class, 'IMaintainableDatabase' );