Login   Register  
PHP Classes
elePHPant
Icontem

Know in detail about the class

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      DConnect  >  All threads  >  Know in detail about the class  >  (Un) Subscribe thread alerts  
Subject:Know in detail about the class
Summary:The class is fine but need to know few functions
Messages:2
Author:Sohil Parekh
Date:2012-11-25 06:54:08
Update:2012-11-26 12:49:45
 

  1. Know in detail about the class   Reply   Report abuse  
Picture of Sohil Parekh
Sohil Parekh
2012-11-25 06:54:08
I wish to know the functioning of the Configs::Singleton() method.

  2. Re: Know in detail about the class   Reply   Report abuse  
Picture of João Mário Nedeff
João Mário Nedeff
2012-11-26 12:49:45 - In reply to message 1 from Sohil Parekh
Configs is a class which reads the connection info from a file called core.ini, stored in /project/configs folder. This is a standard way to store your connection info in a secure place.

It is called through a singleton method because the Config info is always the same, so its best to have only one Config object, from which the other classes will read the information.

The logic here is to store the info in a standard and secure place, and make this info available to other classes through a Config singleton object.

Than, we have a DConnect class which provides a very easy way to retrieve a PDO Object.

$conn = DConnect::Connect()

So, when you're coding, you never have to worry about server, user, password, mysql UTF8 parameters again, its all pre-set!