Ok so it's my first time developing a small framework for myself, just to make life a little easier, I have created an Abstraction Layer for the database, however I am not entirely sure how I can shorten some functionality within it. Maybe you could help me,
I have a configuration file which stores all defines such as the database connectivity.
I have a registry which deals with storing objects from an object folder (database class) which is pre instantiated upon the execution of a command called - $registry::ADD_OBJECT('db'); this will then instantiate my db class so I can make references to functions inside of that like so:
however is there any way I can perhaps shorten the initial part down, by loosing the $registry? or even combining the $registry with GET_OBJECT. like
rGET_OBJECT->query('users');
any help would be great, theres no point giving the source as the file amount of lines is crazy, however any methods you can advise on would be brilliant.
I have a configuration file which stores all defines such as the database connectivity.
I have a registry which deals with storing objects from an object folder (database class) which is pre instantiated upon the execution of a command called - $registry::ADD_OBJECT('db'); this will then instantiate my db class so I can make references to functions inside of that like so:
$registry::GET_OBJECT('db')->query('users');
$registry::GET_OBJECT('db')->rows(5); // display the first 5 results.
however is there any way I can perhaps shorten the initial part down, by loosing the $registry? or even combining the $registry with GET_OBJECT. like
rGET_OBJECT->query('users');
any help would be great, theres no point giving the source as the file amount of lines is crazy, however any methods you can advise on would be brilliant.