mongodb - PHP: forcing use of extended class in different namespace by core class / function -
Background (though my problem can be generalized): I would like to integrate with the original roles (role-based authentication) to add to the specific database and an additional layer of security to limit access to the archive. As if the code tries to use the "dbname.foo.bar.baz" collection, then it will check the existence of the PPRBCAC permission "/ Mongo / DBNM / AF / Bar / Falcon" and ensure that the existing user's permission is.
I would like to emphasize the original work to return to my extended version of e.g. (1) (2) Can someone suggest a way to get it? Php can not be inserted as a separate class and I can repeat the Mongo classes again I do not want to start typing because it is a common problem that I am using PPRBAC with other capabilities You should add the following usage statement to your Mongo client class, instead you are saying it: MongoDB instead of the original MongoDB , as it usually happens. MongoDB
define the extended version of the name space MyUniqueNamespace; Square MongoDB \ MongoDB {public work __construct () {die ("we are definitely using extended version!"); } Public Function someStandardFunction () {authoriseOrThrowException (); Return parent: some standardfunction (); }} Force Mongo client to use instead of \ MyUniqueNameSpace \ MongoDB MongoDB . Use the Usage or to use ... as the ... does not move as a mongodi: (
use \ MyUniqueNameSpace \ MongoDB; $ cl = new
Use \ MyUniqueNameSpace \ MongoDB;
Comments
Post a Comment