X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/?a=blobdiff_plain;f=includes%2Flibs%2Frdbms%2Flbfactory%2FILBFactory.php;h=1e8838e71b1e5aecbdcc2faecedcb29ca687b5b7;hb=882323309ff1e3ee45e1e89ee8e57484f54f6e32;hp=98108a7df21cd54b67f0829fed5d5a7c5b7b9b41;hpb=d2b5c86eac27b0ce60076502f195b1b37d762c60;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/lbfactory/ILBFactory.php b/includes/libs/rdbms/lbfactory/ILBFactory.php index 98108a7df2..1e8838e71b 100644 --- a/includes/libs/rdbms/lbfactory/ILBFactory.php +++ b/includes/libs/rdbms/lbfactory/ILBFactory.php @@ -42,19 +42,20 @@ interface ILBFactory { * * @param array $conf Array with keys: * - localDomain: A DatabaseDomain or domain ID string. - * - readOnlyReason : Reason the master DB is read-only if so [optional] - * - srvCache : BagOStuff object for server cache [optional] - * - memStash : BagOStuff object for cross-datacenter memory storage [optional] - * - wanCache : WANObjectCache object [optional] - * - hostname : The name of the current server [optional] + * - readOnlyReason: Reason the master DB is read-only if so [optional] + * - srvCache: BagOStuff object for server cache [optional] + * - memStash: BagOStuff object for cross-datacenter memory storage [optional] + * - wanCache: WANObjectCache object [optional] + * - hostname: The name of the current server [optional] * - cliMode: Whether the execution context is a CLI script. [optional] - * - profiler : Class name or instance with profileIn()/profileOut() methods. [optional] + * - profiler: Class name or instance with profileIn()/profileOut() methods. [optional] * - trxProfiler: TransactionProfiler instance. [optional] * - replLogger: PSR-3 logger instance. [optional] * - connLogger: PSR-3 logger instance. [optional] * - queryLogger: PSR-3 logger instance. [optional] * - perfLogger: PSR-3 logger instance. [optional] - * - errorLogger : Callback that takes an Exception and logs it. [optional] + * - errorLogger: Callback that takes an Exception and logs it. [optional] + * - deprecationLogger: Callback to log a deprecation warning. [optional] * @throws InvalidArgumentException */ public function __construct( array $conf ); @@ -323,4 +324,34 @@ interface ILBFactory { * - ChronologyPositionIndex: timestamp used to get up-to-date DB positions for the agent */ public function setRequestInfo( array $info ); + + /** + * Make certain table names use their own database, schema, and table prefix + * when passed into SQL queries pre-escaped and without a qualified database name + * + * For example, "user" can be converted to "myschema.mydbname.user" for convenience. + * Appearances like `user`, somedb.user, somedb.someschema.user will used literally. + * + * Calling this twice will completely clear any old table aliases. Also, note that + * callers are responsible for making sure the schemas and databases actually exist. + * + * @param array[] $aliases Map of (table => (dbname, schema, prefix) map) + * @since 1.31 + */ + public function setTableAliases( array $aliases ); + + /** + * Convert certain index names to alternative names before querying the DB + * + * Note that this applies to indexes regardless of the table they belong to. + * + * This can be employed when an index was renamed X => Y in code, but the new Y-named + * indexes were not yet built on all DBs. After all the Y-named ones are added by the DBA, + * the aliases can be removed, and then the old X-named indexes dropped. + * + * @param string[] $aliases + * @return mixed + * @since 1.31 + */ + public function setIndexAliases( array $aliases ); }