what best slight removing database connection/object duty php?
a integrate options are:
$connection = {my db connection/object};
function passedin($connection) { ... }
function passedbyreference(&$connection) { ... }
function usingglobal() {
tellurian $connection;
...
}
so, upheld in, upheld reference, controlling global. i'm pondering functions wholly used within 1 digest wholly have 1 database connection. there churned connections, unequivocally upheld passed reference.
i'm thining upheld anxiety indispensable php5 controlling an object, following upheld controlling tellurian 2 possibilities.
the reason i'm seeking since i'm removing sleepy always putting $connection duty parameters.
Comments
Post a Comment